Bug #51856 malloced memory freed by safemalloc in debug compiled MySQL Cluster
Submitted: 9 Mar 2010 9:16 Modified: 16 Mar 2010 11:15
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:7.0.14 OS:Windows
Assigned to: Magnus Blåudd CPU Architecture:Any

[9 Mar 2010 9:16] Magnus Blåudd
Description:
When debug compiling MySQL Cluster on Windows the mysys library was not compiled with -DSAFEMALLOC and -DSAFE_MUTEX causing mismatch between malloc and safemalloc free

How to repeat:
Since mysys only consists of C files, the defines was only added to CNAKE_CFLAGS_DEBUG. Recently a my_socket.cc file was added to the mysys project, thus causing it to use the CMAKE_CXXFLAGS_DEBUG(which was not set properly) causing mismatch between malloc and safemalloc free(for example)

Suggested fix:
Rename the my_socket.cc to my_socket.c
[9 Mar 2010 9:46] 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/102664
[16 Mar 2010 7:57] Magnus Blåudd
Pushed to 7.0.14 and 7.1.3-beta
[16 Mar 2010 11:16] Jon Stephens
Documented bugfix in the NDB-7.0.14 and 7.1.3 changelogs as follows:

        When debug compiling MySQL Cluster on Windows, the mysys library
        was not compiled with -DSAFEMALLOC and -DSAFE_MUTEX, due to the
        fact that my_socket.c was misnamed as my_socket.cc.

Closed.