Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: Falldog on September 13, 2012, 09:31:22 am

Title: Create custom event in thread will SIGILL
Post by: Falldog on September 13, 2012, 09:31:22 am
I try to write a plugin and create a custom wxThread

When I create an instance of custom event, will receive SIGILL, and the crash!
Quote
PyTaskEvent event( wxEVT_PYTASK, -1 );
I can create event normal in plugin(main thread?)

I try to create wxCommandEvent, fail too.

Why?
???
Title: Re: Create custom event in thread will SIGILL
Post by: MortenMacFly on September 13, 2012, 01:56:01 pm
Why?
Platform, version, pre-requisite (looks like Python), steps to reproduce, sample code?
Title: Re: Create custom event in thread will SIGILL
Post by: Falldog on September 13, 2012, 03:19:23 pm
I found the root cause...
It cause on next instruction
Quote
char msg[1024] = {0};
// ...
PyTaskEvent event( wxEVT_PYTASK, -1 );
event.SetString(wxString::Format(_T("SocketThread %d\n%s"), count, wxString::FromUTF8(msg)));

Crash at Format convert wxString to %s!?
CB will stop callstack at "PyTaskEvent event( wxEVT_PYTASK, -1 );"
Sorry to bother you...

BTW, where can I found wxString::Format() parameter mapping with wchar_t*, char* and wxString?
Title: Re: Create custom event in thread will SIGILL
Post by: oBFusCATed on September 13, 2012, 03:34:38 pm
BTW, where can I found wxString::Format() parameter mapping with wchar_t*, char* and wxString?
Probably here: http://docs.wxwidgets.org/stable/
Or here: http://svn.berlios.de/wsvn/codeblocks/trunk/src/include/globals.h?peg=8383 (we have some string conversion functions).