Opened 15 years ago

Closed 15 years ago

Last modified 5 years ago

#4173 closed defect (fixed)

GUI: Crash on exit

Reported by: lordhoto Owned by: SF/tanoku
Priority: normal Component: GUI
Version: Keywords:
Cc: Game:

Description

Hi,

I had an (sadly not reproduce able) problem with our GUI code. When I exited (from within kyra, but I tried to check valgrind, no invalid memory writes when I played through the same part of the game again) I got an segmentation fault. Here is the backtrace:

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fb0a11426f0 (LWP 9744)] 0x00007fb09f060055 in free () from /lib/libc.so.6 (gdb) bt #0 0x00007fb09f060055 in free () from /lib/libc.so.6 #1 0x0000000000ad951b in Common::String::decRefCount (this=0x2371ca8, oldRefCount=0x1fbf810) at common/str.cpp:217 #2 0x0000000000ad95db in ~String (this=0x2371ca8) at common/str.cpp:119 #3 0x00000000005553c2 in ~Node (this=0x2371ca8) at ./common/hashmap.h:72 #4 0x0000000000555745 in Common::ObjectPool<Common::HashMap<Common::String, int, Common::Hash<Common::String>, Common::EqualTo<Common::String> >::Node, 10ul>::deleteChunk (this=0x2371b30, ptr=0x2371ca8) at ./common/memorypool.h:94 #5 0x0000000000555771 in Common::HashMap<Common::String, int, Common::Hash<Common::String>, Common::EqualTo<Common::String> >::freeNode ( this=0x2371b30, node=0x2371ca8) at ./common/hashmap.h:101 #6 0x0000000000a1fe2f in Common::HashMap<Common::String, int, Common::Hash<Common::String>, Common::EqualTo<Common::String> >::clear ( this=0x2371b30, shrinkArray=false) at ./common/hashmap.h:339 #7 0x0000000000a1e890 in GUI::ThemeEval::reset (this=0x2371b30) at gui/ThemeEval.cpp:44 #8 0x0000000000a198eb in GUI::ThemeEngine::unloadTheme (this=0x20728d0) at gui/ThemeEngine.cpp:654 #9 0x0000000000a1a604 in ~ThemeEngine (this=0x20728d0) at gui/ThemeEngine.cpp:296 #10 0x00000000009f78ff in ~GuiManager (this=0x2072030) at gui/GuiManager.cpp:79 #11 0x000000000040e9c0 in Common::Singleton<GUI::GuiManager>::destroyInstance () at ./common/singleton.h:61 #12 0x000000000040e9d6 in Common::Singleton<GUI::GuiManager>::destroy () at ./common/singleton.h:81 #13 0x000000000040e7f1 in scummvm_main (argc=4, argv=0x7fffa9168038) at base/main.cpp:354 #14 0x000000000040b1f7 in main (argc=4, argv=0x7fffa9168038) at backends/platform/sdl/main.cpp:108

I sadly have the fear that it might be related to somehow corrupted memory. As a side note I was also able to crash the GUI when exiting the debugger today, but sadly I don't have any backtrace for that one.

Ticket imported from: #2609755. Ticket imported from: bugs/4173.

Attachments (1)

valgrind.log (6.5 KB ) - added by lordhoto 15 years ago.
GUI related valgrind warnings

Download all attachments as: .zip

Change History (11)

comment:1 by lordhoto, 15 years ago

Oh I forgot to say: branch-0-13-0 of r38426 with g++ (Ubuntu 4.3.2-1ubuntu12) 4.3.2 on Linux/amd64 (Ubuntu).

comment:2 by SF/tanoku, 15 years ago

You are right Johannes, that's ought to be memory corruption -- looks like a hash table destructor is trying to free a string which was already freed... Something quite impossible to debug with only the backtrace.

Are you 100% sure that the memory corruption originates from the GUI code? Maybe you did something strange in Kyra the first time...

comment:3 by lordhoto, 15 years ago

Just did another valgrind run of the last part of the game, which I played when I got that crash, still no warnings from within kyra. This time I did some debugger opening/closing etc. though and bingo got some invalid writes from GUI code. I'll attach the related valgrind log as a file.

by lordhoto, 15 years ago

Attachment: valgrind.log added

GUI related valgrind warnings

comment:4 by SF/tanoku, 15 years ago

Do you happen to recall which dialog was being drawn when that happened?

comment:5 by lordhoto, 15 years ago

The only dialog I used was the debugger, so that must be it :-).

comment:6 by SF/tanoku, 15 years ago

Classic or modern theme? ^^

comment:7 by SF/tanoku, 15 years ago

Nevermind, fixed now. Cheers Johannes, thanks for reporting. ^^

comment:8 by SF/tanoku, 15 years ago

Resolution: fixed
Status: newclosed

comment:9 by lordhoto, 15 years ago

I hope that was the reason for the crash though.

comment:10 by digitall, 5 years ago

Component: GUI
Note: See TracTickets for help on using tickets.