I'm using Code::Blocks Version 1.0 revision 1662 (gcc 3.4.4 Linux/unicode, build: Jan 6 2006 19:33:53) with wxGTK-2.6.2 and stumbled over a rather weired crash today.
If I start Code::Blocks and modify my default layout (for example resizing the window with the project tree or something like this) and the close Code::Blocks it will ask me if I want to save my changes to the default layout. It doesn't matter if I save it or not, Code::Blocks shuts down as it should and the changes are stored correctly (if I demanded Code::Blocks to save them). But if I don't modify my layout Code::Blocks produces a segmentation fault while shutting down. (It doesn't matter if a project was open - the behaviour is exactly the same as without one.)
Here is the output from gdb:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 17056)]
0xb788a370 in wxGenericTreeCtrl::CalculateSize ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
(gdb) bt
#0 0xb788a370 in wxGenericTreeCtrl::CalculateSize ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#1 0xb78904ac in wxGenericTreeCtrl::CalculateLevel ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#2 0xb78907a6 in wxGenericTreeCtrl::CalculatePositions ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#3 0xb7891473 in wxGenericTreeCtrl::OnInternalIdle ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#4 0xb77d11b6 in wxAppBase::SendIdleEvents ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#5 0xb77d11e6 in wxAppBase::SendIdleEvents ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#6 0xb77d11e6 in wxAppBase::SendIdleEvents ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#7 0xb77d10fc in wxAppBase::ProcessIdle ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#8 0xb7727215 in wxPaletteBase::GetColoursCount ()
from /usr/lib/libwx_gtk2u_core-2.6.so.0
#9 0xb6e30d18 in g_idle_remove_by_data () from /usr/lib/libglib-2.0.so.0
#10 0xb6e30efc in g_idle_remove_by_data () from /usr/lib/libglib-2.0.so.0
#11 0xb6e31868 in g_idle_remove_by_data () from /usr/lib/libglib-2.0.so.0
#12 0xb6e2d5a5 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#13 0xb70a26cb in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#14 0xb7744126 in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#15 0xb77d0e29 in wxAppBase::MainLoop () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#16 0xb77d0f66 in wxAppBase::OnRun () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#17 0x080601c8 in CodeBlocksApp::OnRun (this=0x3) at app.cpp:452
#18 0xb753d07a in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#19 0xb753d3ee in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#20 0x0805f64a in main (argc=1, argv=0x3) at app.cpp:86
The value in the first line differs sometimes but the crash always happens in wxGenericTreeCtrl::CalculateSize.
The strange thing is: No Code::Blocks-code seems to be (directly) involved in the crash.
The crash did not appear with my previous version (I think it was revision 1648). To make it even more complicated: Code::Blocks is not the only thing that changed. Today I did an update of glib (new version: 2.8.4) and gtk+ (new version: 2.8.8 ) - both compiled with gcc 3.3.6 while wxGTK and Code::Blocks are compiled with gcc 3.4.4. Thus I first thought about a problem with that libraries and did an update from wxGTK up to version 2.6.2 (compiled with gcc 3.4.4 - I had to do this update for another reason (incompatibility from wxGTK 2.6.1 with the new gtk-version), too) and even recompiled gtk+ with gcc 3.4.4. But nothing changed. Then I did a few test within Code::Blocks and discovered the behaviour described at the top of this post. As the crash does not appear in every situation (but can be reproduced, at least on my machine) I have no idea whether this is a bug in Code::Blocks (it could be although no code from Code::Blocks is directly involved in the crash - possible due to a wrong parameter in a wxWidgets-related function or some other malpractice that causes problems) or if it is just a problem with my system (which is indeed not really consistent as parts of it are compiled with gcc 3.3 while other parts are compiled with gcc 3.4).
And because of this, here is my question: Has anyone an idea what the reason for this problem is or can anyone reproduce this crash?