andLinux SVN 3558 gcc 4.0.4 Linux/unicode
Occasionaly when I change a project target via the toolbar: crash
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1230625104 (LWP 1566)]
0x08073a87 in wxStringBase::size (this=0x8ddd940)
at /usr/include/wx-2.6/wx/string.h:367
367 size_type size() const { return GetStringData()->nDataLength; }
(gdb) bt
#0 0x08073a87 in wxStringBase::size (this=0x8ddd940)
at /usr/include/wx-2.6/wx/string.h:367
#1 0x08073b2b in wxStringBase::length (this=0x8ddd940)
at /usr/include/wx-2.6/wx/string.h:369
#2 0x0809f3e1 in wxString::Len (this=0x8ddd940)
at /usr/include/wx-2.6/wx/string.h:689
#3 0x0809f543 in operator== (s1=@0xbfa40484, s2=@0x8ddd940)
at /usr/include/wx-2.6/wx/string.h:1437
#4 0xb76de3d8 in cbProject::SetActiveBuildTarget (this=0x8ddd818,
name=@0xbfa40484) at sdk/cbproject.cpp:1587
#5 0xb479f8b8 in CompilerGCC::DoUpdateTargetMenu (this=0x88e48a8,
targetIndex=2) at plugins/compilergcc/compilergcc.cpp:1235
#6 0xb47a4ce9 in CompilerGCC::OnSelectTarget (this=0x88e48a8,
event=@0xbfa40748) at plugins/compilergcc/compilergcc.cpp:2921
#7 0xb7993655 in wxAppConsole::HandleEvent ()
from /usr/lib/libwx_baseu-2.6.so.0
#8 0xb7a22b52 in wxEvtHandler::ProcessEventIfMatches ()
from /usr/lib/libwx_baseu-2.6.so.0
#9 0xb7a22c9d in wxEventHashTable::HandleEvent ()
from /usr/lib/libwx_baseu-2.6.so.0
#10 0xb7a22e1f in wxEvtHandler::ProcessEvent ()
from /usr/lib/libwx_baseu-2.6.so.0
#11 0xb7a22dbe in wxEvtHandler::ProcessEvent ()
---Type <return> to continue, or q <return> to quit---q
from /usr/lib/libwx_baseu-2.6.soQuit
(gdb) f 4
#4 0xb76de3d8 in cbProject::SetActiveBuildTarget (this=0x8ddd818,
name=@0xbfa40484) at sdk/cbproject.cpp:1587
1587 if (name == m_ActiveTarget)
(gdb) p name
$1 = (const wxString &) @0xbfa40484: {<wxStringBase> = {
static npos = 4294967295, m_pchData = 0x8e75cdc}, <No data fields>}
(gdb) p m_ActiveTarget
$2 = {<wxStringBase> = {static npos = 4294967295,
m_pchData = 0x67}, <No data fields>}
(gdb)
Sounds like the project pointer used is invalid...
Although I can't reproduce it, can you try the following?
In src/plugins/compilergcc/compilergcc.cpp:1234, there is this code:
if (m_Project)
m_Project->SetActiveBuildTarget(GetTargetString(m_TargetIndex));
Replace it with this:
if (Manager::Get()->GetProjectManager()->GetActiveProject())
Manager::Get()->GetProjectManager()->GetActiveProject()->SetActiveBuildTarget(GetTargetString(m_TargetIndex));
Test it out for a while (a day or two) and if the crash is gone tell me to commit it.