Opened 5 years ago

Closed 5 years ago

#11214 closed defect (fixed)

GUI: Saving a game crashes in tile mode

Reported by: sluicebox Owned by: bgK
Priority: blocker Component: GUI
Version: Keywords:
Cc: sluicebox Game:


Saving a game on at least Windows and Ubuntu with the ScummVM dialog in tile mode fails an assertion. This was introduced in 1dce33dd9f909b09a73902b3939b61a81a149b7a. Probably occurs in all desktop environments since it's related to layout.

To reproduce:

  1. Launch the ScummVM save dialog from within a game
  2. Set the dialog to tile mode if it's in list mode
  3. Click any save slot

An assertion will fail when initializing the game description dialog.

#3  0x00007ffff68fa012 in __GI___assert_fail (assertion=0x555557932550 "isValidRect()", file=0x555557932540 "./common/rect.h", line=102, 
    function=0x555557933800 <Common::Rect::Rect(short, short, short, short)::__PRETTY_FUNCTION__> "Common::Rect::Rect(int16, int16, int16, int16)") at assert.c:101
#4  0x0000555555a684ab in Common::Rect::Rect (this=0x7ffffff38cf0, x1=7, y1=2, x2=-29, y2=19) at ./common/rect.h:102
#5  0x00005555576b7ea8 in GUI::EditTextWidget::getEditRect (this=0x555559039830) at gui/widgets/edittext.cpp:109
#6  0x00005555576d219e in GUI::EditableWidget::reflowLayout (this=0x555559039830) at gui/widgets/editable.cpp:60
#7  0x00005555576b7a1e in GUI::EditTextWidget::reflowLayout (this=0x555559039830) at gui/widgets/edittext.cpp:64
#8  0x0000555557669c5a in GUI::Dialog::reflowLayout (this=0x5555592f6e88) at gui/dialog.cpp:111
#9  0x000055555767156e in GUI::GuiManager::openDialog (this=0x555558f1da30, dialog=0x5555592f6e88) at gui/gui-manager.cpp:469
#10 0x0000555557669b8c in GUI::Dialog::open (this=0x5555592f6e88) at gui/dialog.cpp:86
#11 0x0000555557694608 in GUI::SavenameDialog::open (this=0x5555592f6e88) at gui/saveload-dialog.cpp:1160
#12 0x0000555557669b3f in GUI::Dialog::runModal (this=0x5555592f6e88) at gui/dialog.cpp:74
#13 0x00005555576938fc in GUI::SaveLoadChooserGrid::selectDescription (this=0x5555592f6d50) at gui/saveload-dialog.cpp:1038
#14 0x00005555576937f8 in GUI::SaveLoadChooserGrid::runIntern (this=0x5555592f6d50) at gui/saveload-dialog.cpp:1024
#15 0x000055555768f688 in GUI::SaveLoadChooserDialog::run (this=0x5555592f6d50, target=..., metaEngine=0x555558950000) at gui/saveload-dialog.cpp:194
#16 0x000055555768f035 in GUI::SaveLoadChooser::runModalWithPluginAndTarget (this=0x5555590343a0, plugin=0x5555588d39f0, target=...) at gui/saveload.cpp:103
#17 0x000055555768ef53 in GUI::SaveLoadChooser::runModalWithCurrentTarget (this=0x5555590343a0) at gui/saveload.cpp:84
#18 0x0000555556bde3fd in Sci::kSaveGame (s=0x555558940070, argc=3, argv=0x5555591e2410) at engines/sci/engine/kfile.cpp:1036
#19 0x0000555556c2dcbd in Sci::callKernelFunc (s=0x555558940070, kernelCallNr=41, argc=3) at engines/sci/engine/vm.cpp:381
#20 0x0000555556c2ff63 in Sci::run_vm (s=0x555558940070) at engines/sci/engine/vm.cpp:901
#21 0x0000555556bc66ea in Sci::SciEngine::runGame (this=0x555558f1aac0) at engines/sci/sci.cpp:667
#22 0x0000555556bc5387 in Sci::SciEngine::run (this=0x555558f1aac0) at engines/sci/sci.cpp:435
#23 0x00005555559c8a6c in runGame (plugin=0x5555588d39f0, system=..., edebuglevels=...) at base/main.cpp:280
#24 0x00005555559c9d4b in scummvm_main (argc=1, argv=0x7fffffffe0d8) at base/main.cpp:562
#25 0x00005555559c63be in main (argc=1, argv=0x7fffffffe0d8) at backends/platform/sdl/posix/posix-main.cpp:45

Originally reported in ticket #11213

Change History (1)

comment:1 by bgK, 5 years ago

Owner: set to bgK
Resolution: fixed
Status: newclosed

In 287a4a12:

GUI: Fix crash when opening the save name dialog

The changes in 1dce33dd9f909b09a73902b3939b61a81a149b7a introduced a
case where the width of widgets would not be set. This commit reverts
the offending changes and introduces a different fix for the original

Only recompute the width/height of a stack if it is not explicitly set.

Fixes #11214.

Note: See TracTickets for help on using tickets.