Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
None
Fix Version/s:
None
Component/s:
None
Environment:
Kubuntu 12.10 x64
I am getting a crash when trying to use prepared statements. I'm connecting to MySQL 5.5 via sockets. I'm using version 1.0.0 of the C library. The application does not crash when using the MySQL 5.1 or 5.5 client libraries.
Back trace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffeeeff700 (LWP 28598)]
_db_enter_ (_func_=_func_@entry=0x7ffff01f5360 "my_malloc", _file_=_file_@entry=0x7ffff01f5330 "/tmp/mariadb-native-client/libmysql/my_malloc.c", _line_=_line_@entry=31, _sfunc_=_sfunc_@entry=0x7fffeeefe708,
_sfile_=_sfile_@entry=0x7fffeeefe710, _slevel_=_slevel_@entry=0x7fffeeefe704, _sframep_=_sframep_@entry=0x7fffeeefe718) at /tmp/mariadb-native-client/libmysql/dbug.c:712
712 /tmp/mariadb-native-client/libmysql/dbug.c: No such file or directory.
(gdb) bt
#0 _db_enter_ (_func_=_func_@entry=0x7ffff01f5360 "my_malloc", _file_=_file_@entry=0x7ffff01f5330 "/tmp/mariadb-native-client/libmysql/my_malloc.c", _line_=_line_@entry=31, _sfunc_=_sfunc_@entry=0x7fffeeefe708,
_sfile_=_sfile_@entry=0x7fffeeefe710, _slevel_=_slevel_@entry=0x7fffeeefe704, _sframep_=_sframep_@entry=0x7fffeeefe718) at /tmp/mariadb-native-client/libmysql/dbug.c:712
#1 0x00007ffff01e4543 in my_malloc (Size=Size@entry=864, MyFlags=MyFlags@entry=48) at /tmp/mariadb-native-client/libmysql/my_malloc.c:31
#2 0x00007ffff01ec1d8 in mysql_stmt_init (mysql=0x555555941618) at /tmp/mariadb-native-client/libmysql/my_stmt.c:1029
#3 0x00007ffff040a11d in MySQL_Execute (sql_conn_num=0, stmt=0x7fffeeefe9d0, request=0x0, query_type=1, error=0x7fffeeefe890 "[", errlen=255) at monetra_mysql.c:599
#4 0x0000555555633750 in M_SQL_Execute (prepared_stmt_ptr=0x7fffeeefe9d0, stmt=0x0, tran_type=1, error=0x0, errlen=0) at sql.c:805
#5 0x000055555561f540 in M_Recurring_init () at recurring/recurring_manage.c:1190
#6 0x00005555555a443e in cron_loop (arg=0x0) at cron.c:1515
#7 0x000055555566fc13 in M_thread_func (arg=0x555555a41d68) at thread/thread.c:531
#8 0x00007ffff7377e9a in start_thread (arg=0x7fffeeeff700) at pthread_create.c:308
#9 0x00007ffff6c85cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()
When trying to build the client with debug symbols I'm running into another issue:
[ 42%] Building C object libmysql/CMakeFiles/libmariadb.dir/my_stmt.c.o
cd /tmp/mariadb-native-client/libmysql && /usr/bin/gcc -Dlibmariadb_EXPORTS -DHAVE_OPENSSL -g -DSAFEMALLOC -DSAFE_MUTEX -fPIC -I/tmp/mariadb-native-client/include -I/tmp/mariadb-native-client/libmysql -I/usr/local/ssl/include -D ENABLED_LOCAL_INFILE -D HAVE_COMPRESS -D THREAD -o CMakeFiles/libmariadb.dir/my_stmt.c.o -c /tmp/mariadb-native-client/libmysql/my_stmt.c
/tmp/mariadb-native-client/libmysql/my_stmt.c: In function ‘mysql_stmt_execute_generate_request’:
/tmp/mariadb-native-client/libmysql/my_stmt.c:640:3: error: ‘ALLOW_ZERO_PTR’ undeclared (first use in this function)
/tmp/mariadb-native-client/libmysql/my_stmt.c:640:3: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [libmysql/CMakeFiles/libmariadb.dir/my_stmt.c.o] Error 1
make[2]: Leaving directory `/tmp/mariadb-native-client'
make[1]: *** [libmysql/CMakeFiles/libmariadb.dir/all] Error 2
make[1]: Leaving directory `/tmp/mariadb-native-client'
make: *** [all] Error 2
Here is my build line:
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb -DOPENSSL_INCLUDE_DIR=/usr/local/ssl/include -DOPENSSL_CRYPTO_LIBRARY=/usr/local/ssl/lib/libcrypto.so -DOPENSSL_SSL_LIBRARY=/usr/local/ssl/lib/libssl.so -DCMAKE_BUILD_TYPE=Debug . && make VERBOSE=1
Since the debug build is failing when trying to compile my_stmt.c I think these two issues are related.
{"report":{"fcp":915.8000001907349,"ttfb":222.69999980926514,"pageVisibility":"visible","entityId":23129,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"45bf8a68-5963-4996-9f33-a304cab7a8cf","navigationType":0,"readyForUser":980.1999998092651,"redirectCount":0,"resourceLoadedEnd":835.3000001907349,"resourceLoadedStart":227.19999980926514,"resourceTiming":[{"duration":179.70000076293945,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":227.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":227.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":406.9000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":179.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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","startTime":227.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":227.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":407.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":189.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":227.69999980926514,"connectEnd":227.69999980926514,"connectStart":227.69999980926514,"domainLookupEnd":227.69999980926514,"domainLookupStart":227.69999980926514,"fetchStart":227.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":227.69999980926514,"responseEnd":417,"responseStart":417,"secureConnectionStart":227.69999980926514},{"duration":235.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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","startTime":227.80000019073486,"connectEnd":227.80000019073486,"connectStart":227.80000019073486,"domainLookupEnd":227.80000019073486,"domainLookupStart":227.80000019073486,"fetchStart":227.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":227.80000019073486,"responseEnd":463.30000019073486,"responseStart":463.19999980926514,"secureConnectionStart":227.80000019073486},{"duration":239.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":228,"connectEnd":228,"connectStart":228,"domainLookupEnd":228,"domainLookupStart":228,"fetchStart":228,"redirectEnd":0,"redirectStart":0,"requestStart":228,"responseEnd":467.30000019073486,"responseStart":467.30000019073486,"secureConnectionStart":228},{"duration":239.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":228.19999980926514,"connectEnd":228.19999980926514,"connectStart":228.19999980926514,"domainLookupEnd":228.19999980926514,"domainLookupStart":228.19999980926514,"fetchStart":228.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":228.19999980926514,"responseEnd":467.6000003814697,"responseStart":467.6000003814697,"secureConnectionStart":228.19999980926514},{"duration":239.5999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":228.4000005722046,"connectEnd":228.4000005722046,"connectStart":228.4000005722046,"domainLookupEnd":228.4000005722046,"domainLookupStart":228.4000005722046,"fetchStart":228.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":228.4000005722046,"responseEnd":468,"responseStart":468,"secureConnectionStart":228.4000005722046},{"duration":330.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":228.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":228.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":559.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":239.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":228.80000019073486,"connectEnd":228.80000019073486,"connectStart":228.80000019073486,"domainLookupEnd":228.80000019073486,"domainLookupStart":228.80000019073486,"fetchStart":228.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":228.80000019073486,"responseEnd":468.5,"responseStart":468.5,"secureConnectionStart":228.80000019073486},{"duration":330.3999996185303,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":228.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":228.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":559.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":240,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":229.10000038146973,"connectEnd":229.10000038146973,"connectStart":229.10000038146973,"domainLookupEnd":229.10000038146973,"domainLookupStart":229.10000038146973,"fetchStart":229.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":229.10000038146973,"responseEnd":469.1000003814697,"responseStart":469.1000003814697,"secureConnectionStart":229.10000038146973},{"duration":331.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":235.80000019073486,"connectEnd":235.80000019073486,"connectStart":235.80000019073486,"domainLookupEnd":235.80000019073486,"domainLookupStart":235.80000019073486,"fetchStart":235.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":235.80000019073486,"responseEnd":567.6999998092651,"responseStart":567.6999998092651,"secureConnectionStart":235.80000019073486},{"duration":386.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":236.80000019073486,"connectEnd":236.80000019073486,"connectStart":236.80000019073486,"domainLookupEnd":236.80000019073486,"domainLookupStart":236.80000019073486,"fetchStart":236.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":236.80000019073486,"responseEnd":623.4000005722046,"responseStart":623.4000005722046,"secureConnectionStart":236.80000019073486},{"duration":36.60000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":587.3000001907349,"connectEnd":587.3000001907349,"connectStart":587.3000001907349,"domainLookupEnd":587.3000001907349,"domainLookupStart":587.3000001907349,"fetchStart":587.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":587.3000001907349,"responseEnd":623.9000005722046,"responseStart":623.9000005722046,"secureConnectionStart":587.3000001907349},{"duration":204.89999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bv2/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":630.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":630.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":835,"responseStart":0,"secureConnectionStart":0},{"duration":204.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2bv2/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":630.6999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":630.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":835.3000001907349,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":52,"responseStart":223,"responseEnd":237,"domLoading":226,"domInteractive":1043,"domContentLoadedEventStart":1044,"domContentLoadedEventEnd":1091,"domComplete":1239,"loadEventStart":1239,"loadEventEnd":1239,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1022.5},{"name":"bigPipe.sidebar-id.end","time":1023.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1023.4000005722046},{"name":"bigPipe.activity-panel-pipe-id.end","time":1024.6000003814697},{"name":"activityTabFullyLoaded","time":1108.6999998092651}],"measures":[],"correlationId":"83d4f45429d532","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":100,"dbReadsTimeInMs":9,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
seems to be a typo in my_stmt.c:
libmysql/my_stmt.c:640: my_free((gptr)start, MYF(ALLOW_ZERO_PTR));
should be:
libmysql/my_stmt.c:640: my_free((gptr)start, MYF(MY_ALLOW_ZERO_PTR));
to use MY_ALLOW_ZERO_PTR constant from include/my_sys.h