So with a custom Event, wxPostEvent crashes with the following log :
Code: Select all
#0 0x00007ffff5464885 in raise () from /lib64/libc.so.6
#1 0x00007ffff5465e61 in abort () from /lib64/libc.so.6
#2 0x00007ffff54a587f in __libc_message () from /lib64/libc.so.6
#3 0x00007ffff54ab088 in malloc_printerr () from /lib64/libc.so.6
#4 0x00007ffff54ae6cd in _int_malloc () from /lib64/libc.so.6
#5 0x00007ffff54b01b7 in malloc () from /lib64/libc.so.6
#6 0x00007ffff5eb806d in operator new (sz=48) at ../../../../libstdc++-v3/libsupc++/new_op.cc:52
#7 0x000000000056ab4b in wxObjectList::CreateNode(wxNodeBase*, wxNodeBase*, void*, wxListKey const&) ()
#8 0x00007ffff706ed9e in wxListBase::Append(void*) () from /tools/common/external/wxWidgets2.8.10/lib/libwx_gtk2-2.8.so.0
#9 0x00007ffff70bd8bd in wxEvtHandler::AddPendingEvent(wxEvent&) () from /tools/common/external/wxWidgets2.8.10/lib/libwx_gtk2-2.8.so.0
#10 0x00000000004d8201 in BaseMainFrame::SendMessageEventToUser(MessageType, std::string, std::string, FontColour, bool, bool) ()
Code: Select all
CustomGUIMessageEvent p_event(EVENT_MESSAGE, ID_ERROR_MESSAGE);
p_event.SetMessage(ErrorMessage);
p_event.SetMessageTitle(Title);
wxPostEvent(this, p_event);
Notes:
* Platform : Linux, Compiler : g++ 4.7, Wxwidgets : 2.8.10
* The error is not easily reproducible - I have to leave the setup for a few hours - But it's always the same backtrace.
Trials of debug :
1. Adding Mutex on the wxPostEvent calls on the same target, trying to synchronize event posting myself instead of depending on wxPostEvent being thread-safe ( fails )
2. Investigating custom event internal members and disabling COW (Copy-On Write ) for stl strings by providing a copy constructor ( fails )