jackaudio / jack2

jack2 codebase
GNU General Public License v2.0
2.19k stars 374 forks source link

ASAN: malloc vs delete mismatch #237

Open abique opened 7 years ago

abique commented 7 years ago

Hi,

I got this issue recently

==27525==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x60300004f180

0 0x7ffff6f00520 in operator delete(void*) /build/gcc-multilib/src/gcc/libsanitizer/asan/asan_new_delete.cc:92

#1 0x7ffff5ebbd88  (/usr/lib/libjack.so.0+0x12d88)
#2 0x7ffff5eb68e9 in jack_port_register (/usr/lib/libjack.so.0+0xd8e9)

Good luck!

sletz commented 7 years ago

Without any more precise log it is just unusable...

Le 14 nov. 2016 à 00:25, Alexandre Bique notifications@github.com a écrit :

Hi,

I got this issue recently

==27525==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x60300004f180

0 0x7ffff6f00520 in operator delete(void*) /build/gcc-multilib/src/gcc/libsanitizer/asan/asan_new_delete.cc:92

1 0x7ffff5ebbd88 (/usr/lib/libjack.so.0+0x12d88)

2 0x7ffff5eb68e9 in jack_port_register (/usr/lib/libjack.so.0+0xd8e9)

Good luck!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

abique commented 7 years ago

I believe you could wrap the delete with std::unique_ptr<>? Then you can easily find the mismatch with what is left? Or use some static analysis?

abique commented 7 years ago

And also the mismatch happens in jack_port_register so I believe that there are not so many things going on there...

milasudril commented 7 years ago

Do you use overrides for operator new? If so C++14 adds some more entry points to define. See https://github.com/milasudril/snowflake-toolkit/commit/1f4ce0a7bc16e88606a9d2ae07656f27a9a7199b