In attachment is a simple application to testing mysql_library_init() and mysql_library_end() calls. Compile it with gcc test-init.c -o test-init `mysql_config --cflags --libs`
And when above test-init.c is linked with `mysql_config --cflags --libmysqld-libs` then second run cause deadlock in inline_mysql_cond_destroy. Same reproducer, but third different error.
__lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
95 ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adresár alebo súbor neexistuje.
(gdb) bt
#0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 0x00007ffff6184eb5 in __pthread_cond_destroy (cond=cond@entry=0x7ffff7568ae0 <COND_thread_count>) at pthread_cond_destroy.c:34
#2 0x00007ffff67436c0 in inline_mysql_cond_destroy (that=0x7ffff7568ae0 <COND_thread_count>) at ./include/mysql/psi/mysql_thread.h:1131
#3 clean_up_mutexes () at ./libmysqld/../sql/mysqld.cc:2264
#4 0x00007ffff6748974 in end_embedded_server () at ./libmysqld/lib_sql.cc:648
#5 0x00007ffff674c7ec in mysql_server_end () at ./libmysql/libmysql.c:213
#6 0x00005555555549e4 in main (argc=<optimized out>, argv=<optimized out>) at test-init.c:49
(gdb)
This is from MariaDB version 10.1.26, which is available in current Debian stable.
So it is not only problem of Connector/C, but also of MariaDB server itself.
Pali
added a comment - And when above test-init.c is linked with `mysql_config --cflags --libmysqld-libs` then second run cause deadlock in inline_mysql_cond_destroy. Same reproducer, but third different error.
$ gcc -W -Wall -O2 -g test-init.c -o test-init `mysql_config --cflags --libmysqld-libs`
$ gdb --args ./test-init 2 127.0.0.1 3306 pali pali
...
(gdb) r
...
^C
Program received signal SIGINT, Interrupt.
__lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
95 ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adresár alebo súbor neexistuje.
(gdb) bt
#0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 0x00007ffff6184eb5 in __pthread_cond_destroy (cond=cond@entry=0x7ffff7568ae0 <COND_thread_count>) at pthread_cond_destroy.c:34
#2 0x00007ffff67436c0 in inline_mysql_cond_destroy (that=0x7ffff7568ae0 <COND_thread_count>) at ./include/mysql/psi/mysql_thread.h:1131
#3 clean_up_mutexes () at ./libmysqld/../sql/mysqld.cc:2264
#4 0x00007ffff6748974 in end_embedded_server () at ./libmysqld/lib_sql.cc:648
#5 0x00007ffff674c7ec in mysql_server_end () at ./libmysql/libmysql.c:213
#6 0x00005555555549e4 in main (argc=<optimized out>, argv=<optimized out>) at test-init.c:49
(gdb)
This is from MariaDB version 10.1.26, which is available in current Debian stable.
So it is not only problem of Connector/C, but also of MariaDB server itself.
Now bug is marked closed. Does it mean that both Connector/C and also libmysqld are fixed? As in "Fix Version/s" field is only 3.0.5 version. What is state with 2.3 series?
Pali
added a comment - Now bug is marked closed. Does it mean that both Connector/C and also libmysqld are fixed? As in "Fix Version/s" field is only 3.0.5 version. What is state with 2.3 series?
we will not fix it in C/C 2.3 series.
Please also note that there is no need to initialize the client library multiple times. If you don't call mysql_library_init explicitly a call to mysql_init will automatically initialize the library.
Georg Richter
added a comment - - edited Hi Pali,
we will not fix it in C/C 2.3 series.
Please also note that there is no need to initialize the client library multiple times. If you don't call mysql_library_init explicitly a call to mysql_init will automatically initialize the library.
People
Georg Richter
Pali
Votes:
0Vote for this issue
Watchers:
2Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":979.5,"ttfb":334.80000019073486,"pageVisibility":"visible","entityId":67798,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"fb4eca2d-b124-444e-8c87-32156f374c58","navigationType":0,"readyForUser":1080.8000001907349,"redirectCount":0,"resourceLoadedEnd":1664,"resourceLoadedStart":342.5,"resourceTiming":[{"duration":84.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":342.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":342.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":426.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":84.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":342.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":342.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":427.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":151.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":342.90000009536743,"connectEnd":342.90000009536743,"connectStart":342.90000009536743,"domainLookupEnd":342.90000009536743,"domainLookupStart":342.90000009536743,"fetchStart":342.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":342.90000009536743,"responseEnd":494.2000002861023,"responseStart":494.2000002861023,"secureConnectionStart":342.90000009536743},{"duration":264.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":343.09999990463257,"connectEnd":343.09999990463257,"connectStart":343.09999990463257,"domainLookupEnd":343.09999990463257,"domainLookupStart":343.09999990463257,"fetchStart":343.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":343.09999990463257,"responseEnd":607.5999999046326,"responseStart":607.5999999046326,"secureConnectionStart":343.09999990463257},{"duration":268.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":343.30000019073486,"connectEnd":343.30000019073486,"connectStart":343.30000019073486,"domainLookupEnd":343.30000019073486,"domainLookupStart":343.30000019073486,"fetchStart":343.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":343.30000019073486,"responseEnd":611.7000002861023,"responseStart":611.7000002861023,"secureConnectionStart":343.30000019073486},{"duration":268.7000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":343.5,"connectEnd":343.5,"connectStart":343.5,"domainLookupEnd":343.5,"domainLookupStart":343.5,"fetchStart":343.5,"redirectEnd":0,"redirectStart":0,"requestStart":343.5,"responseEnd":612.2000002861023,"responseStart":612.2000002861023,"secureConnectionStart":343.5},{"duration":269,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":343.7000002861023,"connectEnd":343.7000002861023,"connectStart":343.7000002861023,"domainLookupEnd":343.7000002861023,"domainLookupStart":343.7000002861023,"fetchStart":343.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":343.7000002861023,"responseEnd":612.7000002861023,"responseStart":612.7000002861023,"secureConnectionStart":343.7000002861023},{"duration":302.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":343.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":343.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":645.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":269.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":344,"connectEnd":344,"connectStart":344,"domainLookupEnd":344,"domainLookupStart":344,"fetchStart":344,"redirectEnd":0,"redirectStart":0,"requestStart":344,"responseEnd":613.0999999046326,"responseStart":613.0999999046326,"secureConnectionStart":344},{"duration":302,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":344.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":344.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":646.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":269.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":344.30000019073486,"connectEnd":344.30000019073486,"connectStart":344.30000019073486,"domainLookupEnd":344.30000019073486,"domainLookupStart":344.30000019073486,"fetchStart":344.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":344.30000019073486,"responseEnd":613.9000000953674,"responseStart":613.9000000953674,"secureConnectionStart":344.30000019073486},{"duration":799.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":345.09999990463257,"connectEnd":345.09999990463257,"connectStart":345.09999990463257,"domainLookupEnd":345.09999990463257,"domainLookupStart":345.09999990463257,"fetchStart":345.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":345.09999990463257,"responseEnd":1144.9000000953674,"responseStart":1144.9000000953674,"secureConnectionStart":345.09999990463257},{"duration":1314.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":349.59999990463257,"connectEnd":349.59999990463257,"connectStart":349.59999990463257,"domainLookupEnd":349.59999990463257,"domainLookupStart":349.59999990463257,"fetchStart":349.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":349.59999990463257,"responseEnd":1664,"responseStart":1664,"secureConnectionStart":349.59999990463257},{"duration":485.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":659.9000000953674,"connectEnd":659.9000000953674,"connectStart":659.9000000953674,"domainLookupEnd":659.9000000953674,"domainLookupStart":659.9000000953674,"fetchStart":659.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":659.9000000953674,"responseEnd":1145.8000001907349,"responseStart":1145.8000001907349,"secureConnectionStart":659.9000000953674},{"duration":795.7000002861023,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":972.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":972.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1767.8000001907349,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":181,"responseStart":334,"responseEnd":345,"domLoading":340,"domInteractive":1695,"domContentLoadedEventStart":1695,"domContentLoadedEventEnd":1751,"domComplete":2238,"loadEventStart":2238,"loadEventEnd":2239,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1666.0999999046326},{"name":"bigPipe.sidebar-id.end","time":1666.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1667},{"name":"bigPipe.activity-panel-pipe-id.end","time":1669},{"name":"activityTabFullyLoaded","time":1783.5}],"measures":[],"correlationId":"7f272cc27a2482","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
And when above test-init.c is linked with `mysql_config --cflags --libmysqld-libs` then second run cause deadlock in inline_mysql_cond_destroy. Same reproducer, but third different error.
$ gcc -W -Wall -O2 -g test-init.c -o test-init `mysql_config --cflags --libmysqld-libs`
$ gdb --args ./test-init 2 127.0.0.1 3306 pali pali
...
(gdb) r
...
^C
Program received signal SIGINT, Interrupt.
__lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
95 ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adresár alebo súbor neexistuje.
(gdb) bt
#0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 0x00007ffff6184eb5 in __pthread_cond_destroy (cond=cond@entry=0x7ffff7568ae0 <COND_thread_count>) at pthread_cond_destroy.c:34
#2 0x00007ffff67436c0 in inline_mysql_cond_destroy (that=0x7ffff7568ae0 <COND_thread_count>) at ./include/mysql/psi/mysql_thread.h:1131
#3 clean_up_mutexes () at ./libmysqld/../sql/mysqld.cc:2264
#4 0x00007ffff6748974 in end_embedded_server () at ./libmysqld/lib_sql.cc:648
#5 0x00007ffff674c7ec in mysql_server_end () at ./libmysql/libmysql.c:213
#6 0x00005555555549e4 in main (argc=<optimized out>, argv=<optimized out>) at test-init.c:49
(gdb)
This is from MariaDB version 10.1.26, which is available in current Debian stable.
So it is not only problem of Connector/C, but also of MariaDB server itself.