I filed a ticket for this: https://jira.mariadb.org/browse/CONC-495
but they closed it without answering my question.
Can someone please answer my question regarding how the leak was fixed? And what triggers the leak?
Georg Richter added a comment - 2 days ago
|
fixed - rev. 64a421295322214c827441cf824091dc874ddc6a
|
|
|
Animesh Soni added a comment - Yesterday - edited
|
I just checked that the ma_net.c looks is the same for 3.0.6 and 3.1.10. Would you be able to provide context on what was triggering the leak and how was it fixed?
|
Or provide me a link to another JIRA issue if there was one for the leak ?
|
Issue:
Hey our LSan run identified a memory leak in ma_net.c file. The memory allocated on line 311 is not freed when the function returns on line 340.
You should add this code before returning "ma_net_real_write" on line 340:
#ifdef HAVE_COMPRESS
|
if (net->compress)
|
free((char*) packet);
|
#endif
|
This is what the LSan callstack looks like:
Direct leak of 102 byte(s) in 6 object(s) allocated from:
0 0x7f92a113ab78 in malloc /home/fcm/Perforce/SDK/UnixClang/dev/scripts/llvm_RELEASE_401_source/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66
|
1 0x7f92a0383b55 in ma_net_real_write /mariadb-connector-c-3.0.6-src/libmariadb/ma_net.c:311
|
2 0x7f92a0383c57 in ma_net_flush /mariadb-connector-c-3.0.6-src/libmariadb/ma_net.c:166
|
3 0x7f92a0383fd8 in ma_net_write_command /mariadb-connector-c-3.0.6-src/libmariadb/ma_net.c:244
|
4 0x7f92a038b8ba in mthd_my_send_cmd /mariadb-connector-c-3.0.6-src/libmariadb/mariadb_lib.c:395
|
5 0x7f92a0392736 in net_stmt_close /mariadb-connector-c-3.0.6-src/libmariadb/mariadb_stmt.c:1324
|
6 0x7f92a0393333 in mysql_stmt_close /mariadb-connector-c-3.0.6-src/libmariadb/mariadb_stmt.c:1344
|
7 0x7f92a03aa9c7 in mysql_stmt_close_start_internal /mariadb-connector-c-3.0.6-src/libmariadb/mariadb_async.c:1509
|
8 0x7f92a03aeda0 in my_context_spawn /mariadb-connector-c-3.0.6-src/libmariadb/ma_context.c:201
|
Can I get a better context on how we could be running into this issue? Are there any known workarounds?
(we are avoiding making a custom version of the package)
{"report":{"fcp":757,"ttfb":165.09999990463257,"pageVisibility":"visible","entityId":91655,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"0cbb9b3d-5c2d-41f9-80ce-759536070cdf","navigationType":0,"readyForUser":838.2999997138977,"redirectCount":0,"resourceLoadedEnd":671.5999999046326,"resourceLoadedStart":170.59999990463257,"resourceTiming":[{"duration":15.900000095367432,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":170.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":186.5,"responseStart":0,"secureConnectionStart":0},{"duration":16.100000381469727,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":170.89999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":187,"responseStart":0,"secureConnectionStart":0},{"duration":73.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":171,"connectEnd":171,"connectStart":171,"domainLookupEnd":171,"domainLookupStart":171,"fetchStart":171,"redirectEnd":0,"redirectStart":0,"requestStart":171,"responseEnd":244.59999990463257,"responseStart":244.59999990463257,"secureConnectionStart":171},{"duration":146.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":171.19999980926514,"connectEnd":171.19999980926514,"connectStart":171.19999980926514,"domainLookupEnd":171.19999980926514,"domainLookupStart":171.19999980926514,"fetchStart":171.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":171.19999980926514,"responseEnd":317.5,"responseStart":317.5,"secureConnectionStart":171.19999980926514},{"duration":150.2000002861023,"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":171.2999997138977,"connectEnd":171.2999997138977,"connectStart":171.2999997138977,"domainLookupEnd":171.2999997138977,"domainLookupStart":171.2999997138977,"fetchStart":171.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":171.2999997138977,"responseEnd":321.5,"responseStart":321.5,"secureConnectionStart":171.2999997138977},{"duration":150.40000009536743,"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":171.59999990463257,"connectEnd":171.59999990463257,"connectStart":171.59999990463257,"domainLookupEnd":171.59999990463257,"domainLookupStart":171.59999990463257,"fetchStart":171.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":171.59999990463257,"responseEnd":322,"responseStart":322,"secureConnectionStart":171.59999990463257},{"duration":150.5,"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":171.7999997138977,"connectEnd":171.7999997138977,"connectStart":171.7999997138977,"domainLookupEnd":171.7999997138977,"domainLookupStart":171.7999997138977,"fetchStart":171.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":171.7999997138977,"responseEnd":322.2999997138977,"responseStart":322.2999997138977,"secureConnectionStart":171.7999997138977},{"duration":218.59999990463257,"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":172,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":172,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":390.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":150.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":172.19999980926514,"connectEnd":172.19999980926514,"connectStart":172.19999980926514,"domainLookupEnd":172.19999980926514,"domainLookupStart":172.19999980926514,"fetchStart":172.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":172.19999980926514,"responseEnd":322.69999980926514,"responseStart":322.69999980926514,"secureConnectionStart":172.19999980926514},{"duration":218.40000009536743,"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":172.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":172.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":390.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":150.90000009536743,"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":172.39999961853027,"connectEnd":172.39999961853027,"connectStart":172.39999961853027,"domainLookupEnd":172.39999961853027,"domainLookupStart":172.39999961853027,"fetchStart":172.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":172.39999961853027,"responseEnd":323.2999997138977,"responseStart":323.2999997138977,"secureConnectionStart":172.39999961853027},{"duration":231.09999990463257,"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":173.19999980926514,"connectEnd":173.19999980926514,"connectStart":173.19999980926514,"domainLookupEnd":173.19999980926514,"domainLookupStart":173.19999980926514,"fetchStart":173.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":173.19999980926514,"responseEnd":404.2999997138977,"responseStart":404.2999997138977,"secureConnectionStart":173.19999980926514},{"duration":273.19999980926514,"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":173.19999980926514,"connectEnd":173.19999980926514,"connectStart":173.19999980926514,"domainLookupEnd":173.19999980926514,"domainLookupStart":173.19999980926514,"fetchStart":173.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":173.19999980926514,"responseEnd":446.3999996185303,"responseStart":446.3999996185303,"secureConnectionStart":173.19999980926514},{"duration":28,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":419,"connectEnd":419,"connectStart":419,"domainLookupEnd":419,"domainLookupStart":419,"fetchStart":419,"redirectEnd":0,"redirectStart":0,"requestStart":419,"responseEnd":447,"responseStart":447,"secureConnectionStart":419},{"duration":221.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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":450.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":450.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":671.5999999046326,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":8,"responseStart":165,"responseEnd":169,"domLoading":168,"domInteractive":893,"domContentLoadedEventStart":893,"domContentLoadedEventEnd":941,"domComplete":1112,"loadEventStart":1112,"loadEventEnd":1113,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":875.6999998092651},{"name":"bigPipe.sidebar-id.end","time":876.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.start","time":877.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":878},{"name":"activityTabFullyLoaded","time":957.8999996185303}],"measures":[],"correlationId":"d5ae4d50d11541","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":13,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
What is wrong with previous fix for
CONC-495? See https://github.com/mariadb-corporation/mariadb-connector-c/blame/v3.1.10/libmariadb/ma_net.c#L343