Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Code::Blocks (sometimes) crashes while closing.
Der Meister:
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:
--- Code: ---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
--- End code ---
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?
klight:
I've noticed this somewhere in the late 1640's or early 1650's svn's. Mine happend on a WinXP machine. It first caught me by surprise because I had exited C::B and was trying to start it back up and the dialog about running multiple instances showed up. Nothing about C::B was visble on the task bar or when I <ctrl>-<tab>, but after a <ctrl>-<alt>-<del> there was a CodeBlocks process in the Processes list.
It doesn't happen often. I can only remember it one other time.
I'll try to pay more attention next time and perhaps Dr.MinGW will help :?
Ceniza:
I have compiled Code::Blocks under Linux only 3 times, and 1 under FreeBSD. The first compilation, that was a long time ago (the project was still on CVS), always crashed on exit, like a last millisecond crash before it could finish exiting. A few days ago I compiled Code::Blocks again but didn't test it that much, even though I don't remember it crashing. Compiled a more recent version and the crashing is back.
The FreeBSD one, on the other hand, was the same version as the first I compiled for Linux, and it didn't crash.
Sometimes those crashes are caused by a plugin, so I'd recommend to disable all the plugins and quit Code::Blocks. Open it again, close it. Did it crash? If it didn't, open it, enable a plugin. Close it. Open it again and close it. Did it crash? If it didn't, open it, enable another plugin. Close it. And so on.
If you find it crashes when you enable a specific plugin, try the same with only that plugin enabled. If it keeps crashing with just that plugin then we got something.
I'd test it myself but right now I must go.
Der Meister:
--- Quote from: Ceniza on January 06, 2006, 09:51:26 pm ---The first compilation, that was a long time ago (the project was still on CVS), always crashed on exit, like a last millisecond crash before it could finish exiting.
--- End quote ---
Yes, I had those problems, too, but this was even before RC2 if I remember correctly.
Anyway, I tried removing all plugins and things got even more weired. After doing so Code::Blocks asked me if I want to save my layout every time I tried to close Code::Blocks even if I didn't change anything. But, as described before, if Code::Blocks asks me it does not crash.
Then I tried adding more and more plugins. It worked for the first two oder three I tried (Well, Code::Blocks asked me all the time if it should save the layout although it never changed) but as I added the compiler-plugin Code::Blocks stopped asking and started crashing.
To make it even more complicated: I removed all plugins again. Now Code::Blocks doesn't ask me if the layout should be saved if I didn't change it - but (what a sursprise) it crashes.
Thus, I don't think a plugin is causing these problems. Either it is a problem with the core part of Code::Blocks or a problem with my system. Would be nice if you could check if the crash that happens on your machine is the same as the one I'm dealing with...
PS: Is it correct that the config-file does not contain newlines anymore? I noticed that because I directly edited the config-file to remove the plugins as Code::Blocks does not save the current configuration before the crash.
killerbot:
with todays commits, the config file has newlines again.
Navigation
[0] Message Index
[#] Next page
Go to full version