The following is the backtrace and code causing the crash.
the "name" string data pointer inside the languages array is never initialized to wxEmptyString on gtk.
GetStringData() is returning m_pchData as 0x0 -1 or (0xfffffff4) as
the address of the languages[].name wxString data.
The culprit is Statement 801: GetStringData()->Unlock();
Now...
Why is languages[].name data pointer not being constructed? Its being set to
all 0x0's
Is it possible that name *is* being constructed, then the non wxWidget array
"languages" is being cleared because languages is not holding pointers
but objects?
I'll test that conjecture next.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1230338368 (LWP 30464)]
0x0806e494 in wxStringData::IsEmpty (this=0xfffffff4) at string.h:219
219 bool IsEmpty() const { return (nRefs == -1); }
(gdb) bt
#0 0x0806e494 in wxStringData::IsEmpty (this=0xfffffff4) at string.h:219
#1 0x0806e4fc in wxStringData::Unlock (this=0xfffffff4) at string.h:236
#2 0xb78e5569 in wxStringBase::operator= (this=0x8822644,
stringSrc=@0xbfa66a20) at ../src/common/string.cpp:801
#3 0x0806ea4b in wxString::operator= (this=0x8822644) at string.h:610
#4 0xb52767b1 in LoadDefaultSettings (languages=0x8822644)
at codestatconfig.cpp:224
#5 0xb52770c3 in LoadSettings (languages=0x8822644) at codestatconfig.cpp:297
#6 0xb527787c in CodeStatConfigDlg (this=0x88224e0, parent=0x8a5e518)
at codestatconfig.cpp:42
#7 0xb527275d in CodeStat::GetConfigurationPanel (this=0x88540b0,
parent=0x8a5e518) at codestat.cpp:80
#8 0xb76b20f0 in PluginManager::GetConfigurationPanels (this=0x8a040b0,
group=4, parent=0x8a5e518, arrayToFill=@0xbfa6718c)
at sdk/pluginmanager.cpp:454
#9 0xb7655632 in EditorConfigurationDlg::AddPluginPanels (this=0xbfa66f98)
at sdk/editorconfigurationdlg.cpp:258
#10 0xb765adaa in EditorConfigurationDlg (this=0xbfa66f98, parent=0x8338098)
at sdk/editorconfigurationdlg.cpp:234
#11 0xb766d512 in EditorManager::Configure (this=0x846ac38)
at sdk/editormanager.cpp:264
#12 0x08093cd5 in MainFrame::OnSettingsEditor (this=0x8338098,
event=@0xbfa67524) at src/main.cpp:2976
#13 0xb7885a99 in wxAppConsole::HandleEvent (this=0x8130ea0,
handler=0x8338098, func=
{__pfn = 0x8093ca8 <MainFrame::OnSettingsEditor(wxCommandEvent&)>, __delta = 0}, event=@0xbfa67524) at ../src/common/appbase.cpp:320
#14 0xb79246d2 in wxEvtHandler::ProcessEventIfMatches (entry=@0x80eb298,
handler=0x8338098, event=@0xbfa67524) at ../src/common/event.cpp:1185
#15 0xb7924abb in wxEventHashTable::HandleEvent (this=0x80eb4d8,
event=@0xbfa67524, self=0x8338098) at ../src/common/event.cpp:867
#16 0xb7925a33 in wxEvtHandler::ProcessEvent (this=0x8338098,
---Type <return> to continue, or q <return> to quit---q
event=@0xbfa67524)Quit
(gdb) l
867 ../src/common/event.cpp: No such file or directory.
in ../src/common/event.cpp
(gdb)
// assigns one string to another
wxStringBase& wxStringBase::operator=(const wxStringBase& stringSrc)
{
wxASSERT( stringSrc.GetStringData()->IsValid() );
// don't copy string over itself
if ( m_pchData != stringSrc.m_pchData ) {
if ( stringSrc.GetStringData()->IsEmpty() ) {
Reinit();
}
else {
// adjust references
GetStringData()->Unlock(); <==== crash victim =====
m_pchData = stringSrc.m_pchData;
GetStringData()->Lock();
}
}
return *this;
}