[wontfix for gtkmm-3] new-delete-type-mismatch on window close when compiled with -fsanitize=address
When you compile your application with -fsanitize=address
, closing the window results in a new-delete-type-mismatch
crash.
Example code
minimal.cpp
Based on: Programming with gtkmm 3- Simple Example
Compiling
g++ minimal.cpp -o simple `pkg-config gtkmm-3.0 --cflags --libs` -fsanitize=address
Executing
./simple
Once the program has started, click on the close button and you will see the following crash.
Crash
=================================================================
==11293==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x60b000072be0 in thread T0:
object passed to delete has wrong type:
size of the allocated type: 104 bytes;
size of the deallocated type: 48 bytes.
#0 0x7f2ab928b0b5 in operator delete(void*, unsigned long) (/lib64/libasan.so.5+0x1110b5)
#1 0x7f2ab88b8a2d in Glib::SignalProxyConnectionNode::destroy_notify_handler(void*, _GClosure*) (/lib64/libglibmm-2.4.so.1+0x6ca2d)
#2 0x7f2ab7bfde23 in g_closure_unref (/lib64/libgobject-2.0.so.0+0x12e23)
#3 0x7f2ab7c1921b in g_signal_handlers_destroy (/lib64/libgobject-2.0.so.0+0x2e21b)
#4 0x7f2ab7c03290 (/lib64/libgobject-2.0.so.0+0x18290)
#5 0x7f2ab84e764b (/lib64/libgtk-3.so.0+0x3ae64b)
#6 0x7f2ab7c05495 in g_object_run_dispose (/lib64/libgobject-2.0.so.0+0x1a495)
#7 0x7f2ab8fc13af in Gtk::Window::_release_c_instance() (/lib64/libgtkmm-3.0.so.1+0x40e3af)
#8 0x7f2ab8fc143f in Gtk::Window::~Window() (/lib64/libgtkmm-3.0.so.1+0x40e43f)
#9 0x40141b in main (/home/fabian/Desktop/simple+0x40141b)
#10 0x7f2ab75a7f42 in __libc_start_main (/lib64/libc.so.6+0x23f42)
#11 0x40116d in _start (/home/fabian/Desktop/simple+0x40116d)
0x60b000072be0 is located 0 bytes inside of 104-byte region [0x60b000072be0,0x60b000072c48)
allocated by thread T0 here:
#0 0x7f2ab92899d7 in operator new(unsigned long) (/lib64/libasan.so.5+0x10f9d7)
#1 0x7f2ab8eec906 in Gtk::Application::add_window(Gtk::Window&) (/lib64/libgtkmm-3.0.so.1+0x339906)
#2 0x7f2ab796ffff (/lib64/libstdc++.so.6+0xa2fff)
SUMMARY: AddressSanitizer: new-delete-type-mismatch (/lib64/libasan.so.5+0x1110b5) in operator delete(void*, unsigned long)
==11293==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
==11293==ABORTING
Other Information
- GTK version:
gtk3-3.24.11-1
- gtkmm version:
gtkmm30-3.24.2-1
- System:
Fedora 30
- GCC version:
gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)
Edited by Daniel Boles