[MDEV-9987] gen_lex_hash leaks memory, making LeakSanitizer builds fail Created: 2016-04-26  Updated: 2016-06-29  Resolved: 2016-04-26

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.0.24
Fix Version/s: 5.5.50, 10.0.25, 10.1.14

Type: Bug Priority: Minor
Reporter: David Gow Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: foundation
Environment:

Ubuntu clang version 3.6.0-2ubuntu1~trusty1 w/ LeakSanitizer,
MariaDB 10.0 branch as of ce38adddfa91949b30956abd0e4cab201effcdef



 Description   

sql/gen_lex_hash.cc leaks memory, causing builds with LeakSanitizer enabled to fail.

=================================================================
==26036==ERROR: LeakSanitizer: detected memory leaks
 
Direct leak of 13936 byte(s) in 1 object(s) allocated from:
    #0 0x4be8d5  (mariadb-server/asanbuild/sql/gen_lex_hash+0x4be8d5)
    #1 0x4e54e4  (mariadb-server/asanbuild/sql/gen_lex_hash+0x4e54e4)
 
SUMMARY: AddressSanitizer: 13936 byte(s) leaked in 1 allocation(s).
make[2]: *** [sql/lex_hash.h] Error 23

As the memory leak itself is not a real issue, LeakSanitizer can be disabled for gen_lex_hash by including a special function in the binary:

extern "C" int __lsan_is_turned_off() { return 1; }



 Comments   
Comment by Sergey Vojtovich [ 2016-04-26 ]

David, thanks for this bug report. We decided to fix memory leak itself: https://github.com/MariaDB/server/commit/4f1ad43992d75676687f29da96dd7c4147247a8f

Generated at Thu Feb 08 07:38:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.