Bug #58173 Valgrind warning in load_defaults()
Submitted: 13 Nov 2010 8:51 Modified: 15 Dec 2010 1:20
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.5 OS:Any
Assigned to: Mats Kindahl CPU Architecture:Any

[13 Nov 2010 8:51] Alexander Nozdrin
Description:
New valgrind warning in next-mr-stage / next-mr-bugfixing:
==28291== 240 bytes in 2 blocks are still reachable in loss record 4 of 7
==28291==    at 0x4A05809: malloc (vg_replace_malloc.c:149)
==28291==    by 0x445D84: my_malloc (my_malloc.c:38)
==28291==    by 0x44611E: my_strdup (my_malloc.c:146)
==28291==    by 0x44A3BB: fn_expand (default.c:165)
==28291==    by 0x44A5C5: my_search_option_files (default.c:234)
==28291==    by 0x44AF5B: my_load_defaults (default.c:550)
==28291==    by 0x44AC3F: load_defaults (default.c:453)
==28291==    by 0x4101D3: parse_args(int, char**) (mysqltest.cc:6437)
==28291==    by 0x41AC08: main (mysqltest.cc:8142)

How to repeat:
Check out PB.
[13 Nov 2010 15:17] Alexander Nozdrin
This bug was actually introduced in 5.5 by Bug#57108.
[15 Nov 2010 15:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/123927

3124 Mats Kindahl	2010-11-15
      Bug #58173: Valgrind warning in load_defaults()
      
      Memory was allocated for storing path names inside
      fn_expand(), which were not free:ed anywhere.
      
      This patch fixes the problem by storing the path
      names in statically allocated buffers instead,
      which is automatically free:ed when the server
      exits.
[16 Nov 2010 10:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/124012

3124 Mats Kindahl	2010-11-16
      Bug #58173: Valgrind warning in load_defaults()
      
      Memory was allocated for storing path names inside
      fn_expand(), which were not free:ed anywhere.
      
      This patch fixes the problem by storing the path
      names in statically allocated buffers instead,
      which is automatically free:ed when the server
      exits.
[16 Nov 2010 11:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/124014

3350 Mats Kindahl	2010-11-16 [merge]
      Merging patch for BUG#58173 into mysql-trunk-bugfixing
[5 Dec 2010 12:38] Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)
[15 Dec 2010 1:20] Paul Dubois
Noted in 5.5.8 changelog.

Memory was allocated in fn_expand() for storing path names, but not
freed anywhere.
[16 Dec 2010 22:26] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (version source revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (merge vers: 5.5.9) (pib:24)