Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: snakesin on May 11, 2010, 03:04:56 pm

Title: Crash on wxString related function frequently
Post by: snakesin on May 11, 2010, 03:04:56 pm
Hello everyone,
I had encounter a crash problem frequently, the call stack in crash reports are almost point the problem to wxString.
But I can not figure out the root cause of this issue. This codeblocks was use wxWidget 2.8.10. thanks.

Case 1:
Code
    <frame level="2" function="wcslen" offset="00000058"/>
    <frame level="3" function="wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)" offset="0000008d"/>
    <frame level="4" function="wxStringBase" offset="00000000" file="/usr/local/include/wx-2.8/wx/string.h" line="368"/>
    <frame level="5" function="wxString::wxString(wxWCharBuffer const&amp;)" offset="0000002c"/>
    <frame level="6" function="EncodingDetector::ConvertToWxStr(unsigned char const*, unsigned int)" offset="000000bc"/>
    <frame level="7" function="EncodingDetector::DetectEncoding(unsigned char const*, unsigned int, bool)" offset="000003b1"/>
    <frame level="8" function="EncodingDetector::DetectEncoding(wxString const&amp;, bool)" offset="000000f4"/>
    <frame level="9" function="EncodingDetector::EncodingDetector(wxString const&amp;)" offset="0000006a"/>

Case 2:
Code
    <frame level="2" function="wxStringBase::operator=(wxStringBase const&amp;)" offset="00000017"/>
    <frame level="3" function="wxString::operator=(wxString const&amp;)" offset="00000000" file="/usr/local/include/wx-2.8/wx/string.h" line="660"/>
    <frame level="4" function="wxLongRcStringPropertyClass::SetColor(wxString)" offset="0000009b"/>
    <frame level="5" function="wxLongRcStringPropertyClass::SetValueFromString(wxString const&amp;, int)" offset="000000a4"/>
    <frame level="6" function="wxPropertyGridState::SetPropertyValue(wxPGProperty*, wxString const&amp;)" offset="0000006c"/>
    <frame level="7" function="wxPropertyGrid::SetPropertyValue(wxPGId, wxString const&amp;)" offset="00000045"/>
    <frame level="8" function="wxPropertyGridManager::SetPropertyValue(wxPGId, wxString const&amp;)" offset="00000075"/>
Title: Re: Crash on wxString related function frequently
Post by: oBFusCATed on May 11, 2010, 10:53:17 pm
What about sharing some basic info like OS, CB, compiler versions?

We're magicians level 0 :-P
Title: Re: Crash on wxString related function frequently
Post by: snakesin on May 12, 2010, 04:05:03 am
Sorry for incomplete information  :?
The OS was fedora 11
code::blocks 8.02
compiler was gcc 4.4.0

I had add some plugin to make my c::b meet my requirement. Maybe I misuse the wxString in some places ?
Does it caused by the difference of unicode or other encoding ?
Title: Re: Crash on wxString related function frequently
Post by: oBFusCATed on May 12, 2010, 10:56:59 am
Can you try a nightly build, the encoding detector has been improved/changed after the release of 8.02 ...
Title: Re: Crash on wxString related function frequently
Post by: Jenna on May 12, 2010, 01:38:38 pm
If you use threads, make sure not to access gui-elements directly from inside the thread and be aware that wxString is *not* threadsafe.