Crash when buildhelp icon is clicked twice

Bug #1644553 reported by Steven De Herdt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

Playing bzr8184: when i click a buildhelp icon, got the window to select which building to construct, and then click another (or the same) buildhelp icon, an assertion failed:

widelands: src/ui_basic/unique_window.cc:114: virtual UI::UniqueWindow::~UniqueWindow(): Controletest 'registry_->window == this' faalt.

Thread 1 "widelands" received signal SIGABRT, Aborted.
0xb7fd9ce5 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7fd9ce5 in __kernel_vsyscall ()
#1 0xb7586dc0 in __libc_signal_restore_set (set=0xbfffc990) at ../sysdeps/unix/sysv/linux/nptl-signals.h:79
#2 __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#3 0xb7588287 in __GI_abort () at abort.c:89
#4 0xb757fa17 in __assert_fail_base (fmt=0xb460b3d3 "%s%s%s:%u: %s%sControletest '%s' faalt.\n%n", assertion=0x80e94151 "registry_->window == this",
    file=0x80e940f4 "src/ui_basic/unique_window.cc", line=114,
    function=0x80e941e0 <UI::UniqueWindow::~UniqueWindow()::__PRETTY_FUNCTION__> "virtual UI::UniqueWindow::~UniqueWindow()") at assert.c:92
#5 0xb757fa9b in __GI___assert_fail (assertion=0x80e94151 "registry_->window == this",
    file=0x80e940f4 "src/ui_basic/unique_window.cc", line=114,
    function=0x80e941e0 <UI::UniqueWindow::~UniqueWindow()::__PRETTY_FUNCTION__> "virtual UI::UniqueWindow::~UniqueWindow()") at assert.c:101
#6 0x80a802e3 in UI::UniqueWindow::~UniqueWindow (this=0x833625c0, __in_chrg=<optimized out>)
    at src/ui_basic/unique_window.cc:114
#7 0x80af0b2a in FieldActionWindow::~FieldActionWindow (this=0x833625c0, __in_chrg=<optimized out>)
    at src/wui/fieldaction.cc:261
#8 0x80af0b51 in FieldActionWindow::~FieldActionWindow (this=0x833625c0, __in_chrg=<optimized out>)
    at src/wui/fieldaction.cc:266
#9 0x80a6448b in UI::Panel::check_child_death (this=0x829bcf28) at src/ui_basic/panel.cc:695
#10 0x80a63436 in UI::Panel::do_run (this=0x829bcf28) at src/ui_basic/panel.cc:186
#11 0x807b4540 in UI::Panel::run<UI::Panel::Returncodes> (this=0x829bcf28) at ../src/ui_basic/panel.h:96
#12 0x808c6685 in Widelands::Game::run (this=0xbfffddc4, loader_ui=0xbfffcfd4, start_game_type=Widelands::Game::NewSPScenario, script_to_run="",
    replay=false, prefix_for_replays="single_player") at src/logic/game.cc:525
#13 0x808c43f9 in Widelands::Game::run_splayer_scenario_direct (this=0xbfffddc4, mapname="campaigns/tutorial03_seafaring.wmf", script_to_run="")
    at src/logic/game.cc:233
#14 0x807ad102 in WLApplication::mainmenu_tutorial (this=0x812b4840) at src/wlapplication.cc:1069
#15 0x807acc30 in WLApplication::mainmenu (this=0x812b4840) at src/wlapplication.cc:996
#16 0x807a90b3 in WLApplication::run (this=0x812b4840) at src/wlapplication.cc:442
#17 0x807a73ff in main (argc=1, argv=0xbffff2e4) at src/main.cc:49

Works (i.e. crashes) every time.

Related branches

Revision history for this message
kaputtnik (franku) wrote :

Couldn't confirm this. Maybe i did not understand what triggers the assertion.

I could click an a construction sites help button several times, also for different buildings and get no crash.

Linux
Widelands Version bzr8186

Revision history for this message
SirVer (sirver) wrote :

kaputtnik, did you use a release version? assert() are only in debug builds (which is a mistake and should be fixed, for example by moving to google logging and using CHECK instead of asserts.

Revision history for this message
kaputtnik (franku) wrote :

Normally i play ever debug builds.

Steven has played the seafaring tutorial, so i tested this also by starting widelands like:

./widelands --scenario=/home/kaputtnik/Quellcode/widelands-repo/trunk/data/campaigns/tutorial03_seafaring.wmf

Got no crash, see attached image. The window title shows the usage of a debug build.

Revision history for this message
kaputtnik (franku) wrote :

Oh, sorry misunderstoud the bug description...

Now i can confirm this: The crash happens when the buildhelp is enabled (TAB) and one is clicking on one of the shown icons plus clicking again on one of the shown icons without closing the formerly opened window called "Action".

Changed in widelands:
status: New → Confirmed
Revision history for this message
Steven De Herdt (stdh) wrote :

My explanation was not very clear, a picture could help...

Revision history for this message
GunChleoc (gunchleoc) wrote :

I suspect that the culprit might be http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/revision/8184

Can you bzr revert -r8183 to check if the error still occurs?

Revision history for this message
Steven De Herdt (stdh) wrote :

I checked on another machine (amd64 instead of my usual i386), and I can confirm: in r8183 it works normally (with the 'action' window open, clicking another building space replaces the 'action' window with that for the new location); while in r8190 I get this crash.

GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build20-rc1
importance: Undecided → High
GunChleoc (gunchleoc)
Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
GunChleoc (gunchleoc)
Changed in widelands:
status: Confirmed → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.