[CONC-438] mysql_free_result hangs Created: 2019-09-09  Updated: 2021-02-08  Resolved: 2021-02-08

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Juha Heinanen Assignee: Georg Richter
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Debian 9



 Description   

Once in a while INSERT query hangs for 10+ minutes. Backtrace of the process in hanging state is below. Unfortunately Debian libmariadbclient18 package does not include symbols.

Any ideas what might cause the hang? Is it possible the issue if fixed in newer versions of libmariadbclient?

------------------------------------------------------------------------------------------------------------

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fa641ed98a0 in __poll_nocancel () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
#0 0x00007fa641ed98a0 in __poll_nocancel () at ../sysdeps/unix/syscall-template.S:84
No locals.
#1 0x00007fa63fe5fec1 in ?? () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#2 0x00007fa63fe5ff48 in ?? () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#3 0x00007fa63fe60052 in ?? () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#4 0x00007fa63fe60115 in ?? () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#5 0x00007fa63fe3be51 in ?? () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#6 0x00007fa63fe3ccec in ?? () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#7 0x00007fa63fe2e87f in ?? () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#8 0x00007fa63fe2ffae in mysql_free_result () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#9 0x00007fa63fe31936 in mysql_real_query () from /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
No symbol table info available.
#10 0x00007fa64040c05c in db_mysql_submit_query (_h=0x7fa641258a90, _s=0x7fa64086b2d0 <sql_str>) at km_dbase.c:112
i = 0
code = 32678
_func_ = "db_mysql_submit_query"
#11 0x00007fa64065ab88 in db_do_submit_query (_h=0x7fa641258a90, _query=0x7fa64086b2d0 <sql_str>, submit_query=0x7fa64040bcf1 <db_mysql_submit_query>) at db_query.c:58
ret = 32678
tvb =

{tv_sec = 94212721508036, tv_usec = 140352034278032}

tve =

{tv_sec = 108261778181, tv_usec = 1382979469336}

tz =

{tz_minuteswest = 24, tz_dsttime = 65147}

tdiff = 908405824
_func_ = "db_do_submit_query"
#12 0x00007fa64065d1ca in db_do_insert_cmd (_h=0x7fa641258a90, _k=0x7fa636252960 <db_keys>, _v=0x7fa636252c40 <db_vals>, _n=24, val2str=0x7fa6404255a6 <db_mysql_val2str>, submit_query=0x7fa64040bcf1 <db_mysql_submit_query>, mode=0) at db_query.c:242
off = 711
ret = 322
...



 Comments   
Comment by Juha Heinanen [ 2019-09-10 ]

I was not able to add the version of the library. The app has been built with this:

Package: libmariadbclient-dev-compat (10.1.41-0+deb9u1)
MariaDB database development files (libmysqlclient compatibility)

Comment by Juha Heinanen [ 2019-09-18 ]

I build libmariadbclient.so.18 with debug symbols. Below is new backtrace from the hanging process with symbols.

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f517466d8a0 in __poll_nocancel () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
#0 0x00007f517466d8a0 in __poll_nocancel () at ../sysdeps/unix/syscall-template.S:84
No locals.
#1 0x00007f51725f3ef1 in poll (__timeout=2000, __nfds=1, __fds=0x7ffed132f808) at /usr/include/x86_64-linux-gnu/bits/poll2.h:46
No locals.
#2 vio_io_wait (vio=vio@entry=0x560529eb39d8, event=event@entry=VIO_IO_EVENT_READ, timeout=2000) at ./vio/viosocket.c:992
ret = <optimized out>
revents = <optimized out>
pfd =

{fd = 18, events = 3, revents = 0}

state =

{m_flags = 3509778656, m_socket = 0x7ffed132f820, m_thread = 0x0, m_number_of_bytes = 21474836512, m_timer_start = 140732408199414, m_timer = 0x7ffed132f8fc, m_operation = 3509778680, m_src_file = 0x7ffed132f8fc "\376\177", m_src_line = 16, m_wait = 0x7f517398d010}

#3 0x00007f51725f3f78 in vio_socket_io_wait (vio=vio@entry=0x560529eb39d8, event=event@entry=VIO_IO_EVENT_READ) at ./vio/viosocket.c:108
timeout = <optimized out>
ret = -516
#4 0x00007f51725f4082 in vio_read (vio=vio@entry=0x560529eb39d8, buf=0x560529eb3bd8 "\001", size=size@entry=16384) at ./vio/viosocket.c:184
error = <optimized out>
ret = <optimized out>
flags = 64
#5 0x00007f51725f4145 in vio_read_buff (vio=0x560529eb39d8, buf=0x560529eb7be8 "\001", size=4) at ./vio/viosocket.c:232
rc = <optimized out>
#6 0x00007f51725cfe91 in my_real_read (net=0x7f5173d674e0, complen=complen@entry=0x7ffed132f9f8, header=0 '\000') at ./sql/net_serv.cc:877
pos = 0x560529eb7be8 "\001"
length = <optimized out>
i = <optimized out>
retry_count = <optimized out>
len = <optimized out>
expect_error_packet = <optimized out>
alarmed = 0 '\000'
remain = 4
#7 0x00007f51725d0d1c in my_net_read_packet (net=net@entry=0x7f5173d674e0, read_from_server=read_from_server@entry=0 '\000') at ./sql/net_serv.cc:1140
len = <optimized out>
complen = 0
#8 0x00007f51725c28af in cli_safe_read (mysql=mysql@entry=0x7f5173d674e0) at ./sql-common/client.c:587
net = 0x7f5173d674e0
len = <optimized out>
#9 0x00007f51725c8323 in cli_advanced_command (mysql=0x7f5173d674e0, command=<optimized out>, header=0x0, header_length=0, arg=0x0, arg_length=0, skip_check=0 '\000', stmt=0x0) at ./sql-common/client.c:729
net = 0x7f5173d674e0
result = 0 '\000'
stmt_skip = <optimized out>
#10 0x00007f51725be2a1 in mysql_ping (mysql=<optimized out>) at ./libmysql/libmysql.c:982
res = <optimized out>
#11 0x00007f5172bb14e6 in db_mysql_submit_query (_h=0x7f51739ecff0, _s=0x7f5172fff2d0 <sql_str>) at km_dbase.c:83
t = 1568791290
i = 0
code = 22021
_func_ = "db_mysql_submit_query"
...

Comment by Georg Richter [ 2021-02-08 ]

This bug doesn't affect Connector/C but the client library (libmysql) of MariaDB 10.1 - which is not supported anymore.

Generated at Thu Feb 08 03:05:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.