Opened 13 years ago

Closed 13 years ago

Last modified 6 years ago

#5954 closed defect (fixed)

LAUNCHER: Can't quit from unsupported game dialog

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

Description

When attempting to quit from the unsupported game dialog (when the config flag enable_unsupported_game_warning is true), ScummVM instead returns to the launcher at which point trying to start any game segfaults out.

Ticket imported from: #3481395. Ticket imported from: bugs/5954.

Change History (7)

comment:1 by digitall, 13 years ago

Replicated under Valgrind. Likely the following is cause of segfault: ==25315== Invalid read of size 4 ==25315== at 0x91FBD13: Common::String::operator+=(Common::String const&) (st r.cpp:273) ==25315== by 0x91FCA0B: Common::operator+(char const*, Common::String const&) (str.cpp:586) ==25315== by 0x90BB74B: GUI::GuiManager::redraw() (gui-manager.cpp:206) ==25315== by 0x90BC15B: GUI::GuiManager::closeTopDialog() (gui-manager.cpp:44 9) ==25315== by 0x90BA47B: GUI::Dialog::close() (dialog.cpp:99) ==25315== by 0x90C16E4: GUI::LauncherDialog::close() (launcher.cpp:680) ==25315== by 0x90C2DEC: GUI::LauncherDialog::handleCommand(GUI::CommandSender *, unsigned int, unsigned int) (launcher.cpp:1018) ==25315== by 0x8D7A7DE: GUI::CommandSender::sendCommand(unsigned int, unsigne d int) (object.h:53) ==25315== by 0x90F0C55: GUI::ListWidget::handleKeyDown(Common::KeyState) (lis t.cpp:337) ==25315== by 0x90BA8D8: GUI::Dialog::handleKeyDown(Common::KeyState) (dialog. cpp:216) ==25315== by 0x90C2BB8: GUI::LauncherDialog::handleKeyDown(Common::KeyState) (launcher.cpp:977) ==25315== by 0x90BBB6D: GUI::GuiManager::runLoop() (gui-manager.cpp:317) ==25315== Address 0xbeb2e744 is not stack'd, malloc'd or (recently) free'd

2 messages of 4 byte invalid read, and 1 of 1... before segfault.. Probably trying to access a deallocated object...

comment:2 by SF/mthreepwood, 13 years ago

OK, I guess I didn't make it clear enough: The segfault is *not* the problem, it's the symptom. We should be quitting instead of continuing to run the launcher.

comment:3 by digitall, 13 years ago

Agreed, and I was aware of that, but I wondered if the cause of the segfault would reveal why the launcher fails to clean up and exit... I assume something is getting locked up in a loop... which the segfault finally "exits".

comment:4 by lordhoto, 13 years ago

Seeing the backtrace the easiest explanation is that the dialog in question never gets properly removed the from dialog stack, but the dialog object gets destroyed never the less. There might be some problem in how the dialog returns to the launcher.

comment:5 by lordhoto, 13 years ago

Owner: set to lordhoto
Resolution: fixed
Status: newclosed

comment:6 by lordhoto, 13 years ago

I added an workaround for this with 453eeb496c7cf2ef9b999c82b8211ced048c0eca. A probably better solution would be to only have one run loop for the GUI, but that might require a bit more tinkering.

comment:7 by digitall, 6 years ago

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