segfault on dismantle a building on ubuntu 12.04

Bug #1220546 reported by dershrimp on 2013-09-04
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Medium
Unassigned

Bug Description

Playing widelands on ubuntu 12.04, with the actual trunk.
Widelands crashes on trying to dismantle any possible building (not just starting buildings or conquered enemy buildings as in bug #1205010). The returns popup shows no materials to return like in the other bug. Clicking on the dismantle button and confirming the confirmation popup crashes widelands with segmentation fault.
Widelands also crashes after sometime when playing with computer players, presumably when the computerplayers try to dismantle a building.

Last lines of output and backtrace:

ComputerPlayer(2): initializing (2)
Forcing flag at (45, 49)
Message: adding (wh) (warehouse) 1
Forcing flag at (89, 77)
Message: adding (wh) (warehouse) 2
Sound_Handler: Mix_PlayChannel failed
Sound_Handler: Mix_PlayChannel failed
Sound_Handler: loaded song "music/ingame_12.ogg"
Program received signal SIGSEGV, Segmentation fault.
0x08267478 in Widelands::DismantleSite::init(Widelands::Editor_Game_Base&) ()

#0 0x08267478 in Widelands::DismantleSite::init(Widelands::Editor_Game_Base&)
    ()
#1 0x0826784c in Widelands::DismantleSite::DismantleSite(Widelands::DismantleSite_Descr const&, Widelands::Editor_Game_Base&, Widelands::Coords, Widelands::Player&, bool, std::vector<Widelands::Building_Index, std::allocator<Widelands::Building_Index> >&) ()
#2 0x0826cfbe in Widelands::Editor_Game_Base::warp_dismantlesite(Widelands::Coords, unsigned char, bool, std::vector<Widelands::Building_Index, std::allocator<Widelands::Building_Index> >) ()
#3 0x081e064d in ?? ()
#4 0x081e0709 in Widelands::Player::dismantle_building(Widelands::Building*)
    ()
#5 0x08252eab in Widelands::Cmd_Queue::run_queue(int, int&) ()
#6 0x0821838f in Widelands::Game::think() ()
#7 0x08374a4c in Interactive_Base::think() ()
#8 0x0836d498 in Interactive_Player::think() ()
#9 0x082938d0 in UI::Panel::run() ()
#10 0x08218fb8 in Widelands::Game::run(UI::ProgressWindow*, Widelands::Game::Start_Game_Type, bool) ()
#11 0x0817d03c in WLApplication::new_game() ()
#12 0x0817d49c in WLApplication::mainmenu_singleplayer() ()
#13 0x081804a4 in WLApplication::mainmenu() ()
#14 0x08180a3b in WLApplication::run() ()

dershrimp (dershrimp) wrote :
Hans Joachim Desserud (hjd) wrote :

Thanks for reporting this issue.

I am able to reproduce this issue on Ubuntu 12.04, but dismantling works as expected on 13.04.

Changed in widelands:
importance: Undecided → Medium
milestone: none → build18-rc1
status: New → Confirmed
tags: added: dismantle
SirVer (sirver) wrote :

Really strange. Maybe related to boost? Some boost versions are known to be buggy with c++11 and certain combinations of compilers.

Jens Beyer (qcumber-some) wrote :

Woho, good one, SirVer.

Tried with libboost-1.48 (which is shipped by Canonical, but not set as default on 12.04). Works like a charm.

Could someone else please double-check this? (you will need to make a clean checkout or at least remove everything in build/* and run compile.sh/cmake again to pick up the new boost version).

dershrimp (dershrimp) wrote :

YES, thanks a lot SirVer! Works for me aswell with libboost-1.48.
Maybe the "building widelands" page (https://wl.widelands.org/wiki/BuildingWidelands/) should be updated. Should say libboost-dev 1.48 instead of 1.35 in the needed packages section.

Finally I can play widelands again :-)

SirVer (sirver) wrote :

Especialy the cmake Check should be updated. Can you do this jens?

Jens Beyer (qcumber-some) wrote :

Done (both the CMake and the Wiki part).

Jens Beyer (qcumber-some) wrote :

Also in the recipe for widelands-daily

Changed in widelands:
status: Confirmed → Fix Committed
Jens Beyer (qcumber-some) wrote :

I realized I made a mistake with widelands-daily. No urgency (nothing has changed - that's the good part of it). I will fix it tonight.

Changed in widelands:
assignee: nobody → Jens Beyer (Qcumber-some) (qcumber-some)
status: Fix Committed → In Progress
Changed in widelands:
status: In Progress → Fix Committed
assignee: Jens Beyer (Qcumber-some) (qcumber-some) → nobody
Hans Joachim Desserud (hjd) wrote :

Not quite fixed just yet. We just got a ftbfs on Precise because it claims the version of boost is too old [1]. I think I've mentioned this before, but it turns out in Ubuntu 12.04 libboost-dev version 1.48.0.2 depends on libboost1.46-dev which will be installed by default [2]. So even though the generic -dev package fullfills the version number requirement it will pull in an older version. Somehow we need to force it to install the later version without breaking later releases by looking for a specific package version. I think if we tried to define the build dependency as "libboost1.48-dev | libboost-dev" it should look up the specific version or fall back to the generic one installing whichever qualifies. This is untested though...

[1] https://launchpadlibrarian.net/149513898/buildlog_ubuntu-precise-i386.widelands_1%3A17-ppa0-bzr6742-201309061547~ubuntu12.04.1_FAILEDTOBUILD.txt.gz
[2] http://packages.ubuntu.com/precise/libboost-dev

Jens Beyer (qcumber-some) wrote :

But now it is really fixed.

Your suggestion worked.

I changed it slightly to libboost1.48-dev | libboost-dev (>= 1.48)

Precise uses 1.48 now and saucy still uses its 1.53 without failing.

Thanks for the good info!

SirVer (sirver) wrote :

Released in build-18 rc1.

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

Other bug subscribers