News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Create custom event in thread will SIGILL

Started by Falldog, September 13, 2012, 09:31:22 AM

Previous topic - Next topic

Falldog

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!
QuotePyTaskEvent event( wxEVT_PYTASK, -1 );
I can create event normal in plugin(main thread?)

I try to create wxCommandEvent, fail too.

Why?
???

MortenMacFly

Quote from: falldog on September 13, 2012, 09:31:22 AM
Why?
Platform, version, pre-requisite (looks like Python), steps to reproduce, sample code?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Falldog

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?

oBFusCATed

Quote from: falldog on September 13, 2012, 03:19:23 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).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]