Threaded Mysql C Api App. Bug

Threaded Mysql C Api App. Bug
We have a constant running Linux application with 2 threads, a (query)producer and (query)consumer. Every 2-3 days a crash occurs. Here is the gdb backtrace of the core file:

#0 0x006bf910 in my_malloc () from /usr/lib/mysql/libmysqlclient_r.so.15
#1 0x006c2caa in memdup_root () from /usr/lib/mysql/libmysqlclient_r.so.15
#2 0x006e6b23 in unpack_fields () from /usr/lib/mysql/libmysqlclient_r.so.15
#3 0x006e70b3 in mysql_read_default_options () from /usr/lib/mysql/libmysqlclient_r.so.15
#4 0x006e54f4 in mysql_free_result () from /usr/lib/mysql/libmysqlclient_r.so.15
#5 0x080d8698 in MYSQL_OBJ::Exec (this=0x899abe0,
qry=0x89a2fb8 “SELECT * FROM conntbl WHERE (id1=’57783′ AND id2=’41508′) OR (id1=’41508′ AND id2=’57783′)”)
at ce.cpp:4704
#6 0x080db4ae in MYSQL_OBJ::RunNextQuery_ifLastResult_isProcessed (this=0x899abe0) at ce.cpp:4493
#7 0x080f0c4c in SqlThread (ptr=0x80fa2bf) at xs.cpp:53
#8 0x00c8d73b in __pthread_initialize_minimal_internal () from /lib/libpthread.so.0
#9 0x00c0bcfe in tdestroy_recurse () from /lib/libc.so.6

We need a threadprogramming/mysql api expert, who helps us to remove this bug.

Leave a Reply

Your email address will not be published. Required fields are marked *