Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#4089 closed defect (fixed)

GUI: Assertion isValidRect() fails on clicking add button

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


When clicking the add button on a completely clean checkout of r35804, an assertion fails: scummvm: ./common/rect.h:93: Common::Rect::Rect(int16, int16, int16, int16): Assertion `isValidRect()' failed.

Here's a backtrace: #0 0xb8099430 in __kernel_vsyscall () #1 0xb7b2a880 in raise () from /lib/tls/i686/cmov/ #2 0xb7b2c248 in abort () from /lib/tls/i686/cmov/ #3 0xb7b2372e in __assert_fail () from /lib/tls/i686/cmov/ #4 0x0809067c in Rect (this=0xbf897d64, x1=26479, y1=19502, x2=-9008, y2=-20580) at ./common/rect.h:93 #5 0x081b9d55 in GUI::StaticTextWidget::setLabel (this=0xa0528e8, label=@0xbf897e60) at gui/widget.cpp:215 #6 0x081bb101 in GUI::BrowserDialog::updateListing (this=0xa0527f0) at gui/browser.cpp:224 #7 0x081bb7fa in GUI::BrowserDialog::open (this=0xa0527f0) at gui/browser.cpp:168 #8 0x0817ebca in GUI::Dialog::runModal (this=0xa0527f0) at gui/dialog.cpp:74 #9 0x08186c55 in GUI::LauncherDialog::addGame (this=0xbf898ae8) at gui/launcher.cpp:667 #10 0x081868ad in GUI::LauncherDialog::handleCommand (this=0xbf898ae8, sender=0xa05211c, cmd=1094992967, data=0) at gui/launcher.cpp:856 #11 0x0818bc79 in GUI::CommandSender::sendCommand (this=0xa05211c, cmd=1094992967, data=0) at ./gui/object.h:54 #12 0x081ba2fa in GUI::ButtonWidget::handleMouseUp (this=0xa0520b0, x=70, y=7, button=1, clickCount=1) at gui/widget.cpp:251 #13 0x0817e6e6 in GUI::Dialog::handleMouseUp (this=0xbf898ae8, x=241, y=331, button=1, clickCount=1) at gui/dialog.cpp:201 #14 0x0817f988 in GUI::GuiManager::runLoop (this=0x9ff9738) at gui/GuiManager.cpp:287 #15 0x0817ebd7 in GUI::Dialog::runModal (this=0xbf898ae8) at gui/dialog.cpp:77 #16 0x0805479a in launcherDialog (system=@0x9f82008) at base/main.cpp:97 #17 0x08054cbf in scummvm_main (argc=1, argv=0xbf899234) at base/main.cpp:295 #18 0x08051812 in main (argc=1, argv=0xbf899234) at backends/platform/sdl/main.cpp:108

I did some quick investigations, and found the values that were causing the assertion to fail were 26479, 19502, -9008, -20580 They look like uninited vars to me.

(Though this isn't happening to everyone, it's not just me! It's been reported on the forum too: )

Ticket imported from: #2498358. Ticket imported from: bugs/4089.

Change History (5)

comment:1 by dreammaster, 15 years ago

I'd concurr with that - a quick investigation seems to indicate that _x/_y/_w/_h are uninitialised in the BrowserDialog constructor, so when it tries to add the StaticTextWidget at a screen position offset relative to the x/y of the dialog, it genereates the isValidRect() assertion.

Putting an explicit _x = 0; _y = 0; _w = 320; _h = 200; into the BrowserDialog::BrowserDialog constructor seems to fix it, although I'll leave it to someone with more experience with the GUI to concur and commit a fix

comment:2 by spookypeanut, 15 years ago

Fixed by wjp in r35807

comment:3 by spookypeanut, 15 years ago

Status: newclosed

comment:4 by sev-, 15 years ago

Resolution: fixed

comment:5 by digitall, 6 years ago

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