Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#9618 closed defect (fixed)

GUI: Could not load widget position for ''!

Reported by: angstsmurf Owned by: criezy
Priority: normal Component: GUI
Version: Keywords:
Cc: Game:

Description

It seems I can crash ScummVM 1.9.0 by starting it in graphics mode Normal (no scaling), changing graphics mode to OpenGL in options, switching to the Paths panel and then clicking on OK. The console will show the error Could not load widget position for ''!

ScummVM 1.9.0 stable, OS X 64-bit version, OS X El Capitan 10.11.6

Attachments (1)

bug9618_valgrind.txt (70.6 KB ) - added by criezy 8 years ago.
Valgrind output

Download all attachments as: .zip

Change History (4)

comment:1 by criezy, 8 years ago

I can reproduce it with the current master, although it sometimes crashes just before arriving to this error in the _name.empty() test. The first two errors given by valgrind are:

==87107== Invalid read of size 8
==87107==    at 0x1020DDF1F: GUI::TabWidget::reflowLayout() (tab.cpp:280)
==87107==    by 0x10206A038: GUI::Dialog::reflowLayout() (dialog.cpp:120)
==87107==    by 0x10208DB1D: GUI::OptionsDialog::reflowLayout() (options.cpp:1124)
==87107==    by 0x102094CA2: GUI::GlobalOptionsDialog::reflowLayout() (options.cpp:1862)
==87107==    by 0x102079AB0: GUI::GuiManager::screenChange() (gui-manager.cpp:496)
==87107==    by 0x10207938F: GUI::GuiManager::checkScreenChange() (gui-manager.cpp:480)
==87107==    by 0x102086E17: GUI::OptionsDialog::close() (options.cpp:430)
==87107==    by 0x102092F81: GUI::GlobalOptionsDialog::close() (options.cpp:1576)
==87107==    by 0x102088B09: GUI::OptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (options.cpp:637)
==87107==    by 0x102094529: GUI::GlobalOptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (options.cpp:1809)
==87107==    by 0x10214C2EA: GUI::CommandSender::sendCommand(unsigned int, unsigned int) (object.h:55)
==87107==    by 0x1020CD2E9: GUI::ButtonWidget::handleMouseUp(int, int, int, int) (widget.cpp:339)
==87107==  Address 0x1058b4870 is 0 bytes inside a block of size 232 free'd
==87107==    at 0x4D8D: free (vg_replace_malloc.c:477)
==87107==    by 0x1020D1291: GUI::ButtonWidget::~ButtonWidget() (widget.h:197)
==87107==    by 0x102094C02: GUI::GlobalOptionsDialog::reflowLayout() (options.cpp:1857)
==87107==    by 0x102079AB0: GUI::GuiManager::screenChange() (gui-manager.cpp:496)
==87107==    by 0x10207938F: GUI::GuiManager::checkScreenChange() (gui-manager.cpp:480)
==87107==    by 0x102086E17: GUI::OptionsDialog::close() (options.cpp:430)
==87107==    by 0x102092F81: GUI::GlobalOptionsDialog::close() (options.cpp:1576)
==87107==    by 0x102088B09: GUI::OptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (options.cpp:637)
==87107==    by 0x102094529: GUI::GlobalOptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (options.cpp:1809)
==87107==    by 0x10214C2EA: GUI::CommandSender::sendCommand(unsigned int, unsigned int) (object.h:55)
==87107==    by 0x1020CD2E9: GUI::ButtonWidget::handleMouseUp(int, int, int, int) (widget.cpp:339)
==87107==    by 0x10206A4AE: GUI::Dialog::handleMouseUp(int, int, int, int) (dialog.cpp:212)
==87107== 
==87107== Invalid read of size 4
==87107==    at 0x10000409C: Common::String::empty() const (str.h:199)
==87107==    by 0x102083FB4: GUI::GuiObject::reflowLayout() (object.cpp:43)
==87107==    by 0x1020DDF27: GUI::TabWidget::reflowLayout() (tab.cpp:280)
==87107==    by 0x10206A038: GUI::Dialog::reflowLayout() (dialog.cpp:120)
==87107==    by 0x10208DB1D: GUI::OptionsDialog::reflowLayout() (options.cpp:1124)
==87107==    by 0x102094CA2: GUI::GlobalOptionsDialog::reflowLayout() (options.cpp:1862)
==87107==    by 0x102079AB0: GUI::GuiManager::screenChange() (gui-manager.cpp:496)
==87107==    by 0x10207938F: GUI::GuiManager::checkScreenChange() (gui-manager.cpp:480)
==87107==    by 0x102086E17: GUI::OptionsDialog::close() (options.cpp:430)
==87107==    by 0x102092F81: GUI::GlobalOptionsDialog::close() (options.cpp:1576)
==87107==    by 0x102088B09: GUI::OptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (options.cpp:637)
==87107==    by 0x102094529: GUI::GlobalOptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (options.cpp:1809)
==87107==  Address 0x1058b4888 is 24 bytes inside a block of size 232 free'd
==87107==    at 0x4D8D: free (vg_replace_malloc.c:477)
==87107==    by 0x1020D1291: GUI::ButtonWidget::~ButtonWidget() (widget.h:197)
==87107==    by 0x102094C02: GUI::GlobalOptionsDialog::reflowLayout() (options.cpp:1857)
==87107==    by 0x102079AB0: GUI::GuiManager::screenChange() (gui-manager.cpp:496)
==87107==    by 0x10207938F: GUI::GuiManager::checkScreenChange() (gui-manager.cpp:480)
==87107==    by 0x102086E17: GUI::OptionsDialog::close() (options.cpp:430)
==87107==    by 0x102092F81: GUI::GlobalOptionsDialog::close() (options.cpp:1576)
==87107==    by 0x102088B09: GUI::OptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (options.cpp:637)
==87107==    by 0x102094529: GUI::GlobalOptionsDialog::handleCommand(GUI::CommandSender*, unsigned int, unsigned int) (options.cpp:1809)
==87107==    by 0x10214C2EA: GUI::CommandSender::sendCommand(unsigned int, unsigned int) (object.h:55)
==87107==    by 0x1020CD2E9: GUI::ButtonWidget::handleMouseUp(int, int, int, int) (widget.cpp:339)
==87107==    by 0x10206A4AE: GUI::Dialog::handleMouseUp(int, int, int, int) (dialog.cpp:212)
==87107== 

I will also attach the full valgrind output.

by criezy, 8 years ago

Attachment: bug9618_valgrind.txt added

Valgrind output

comment:2 by criezy, 8 years ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

Thank you for reporting this bug.
It was due to a logical error in our code that caused access to freed memory, and I have now fixed this in commit 9f94294.
The bug has been present for several years and occurs on all platform. However it only occurs if the current tab when you close the options dialog is the Paths tab.

comment:3 by digitall, 6 years ago

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