Author Topic: Create custom event in thread will SIGILL  (Read 3936 times)

Offline Falldog

  • Multiple posting newcomer
  • *
  • Posts: 19
Create custom event in thread will SIGILL
« 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?
???

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: Create custom event in thread will SIGILL
« Reply #1 on: September 13, 2012, 01:56:01 pm »
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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Falldog

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Create custom event in thread will SIGILL
« Reply #2 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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12121
    • Travis build status
Re: Create custom event in thread will SIGILL
« Reply #3 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).
(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!]