production_program.cc:249 Not implemented.

Bug #1352943 reported by Ahmend Ghandi
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

Steps to reproduce:
1. Start a new game as Atlanteans.
2. Build a mill.
3. Click on a flag and open Configure economy.
4. Select cornflour and decrease the target amount.
5. Speed up the game and wait for the mill from step to finish building.

Once the mill has finished, and attempts to start working, the game crashes with the following error:

[/build/buildd/widelands-18-ppa0-bzr7164/src/logic/production_program.cc:249] Not implemented.

(Originally discovered in r7164, still reproducible in r7168)

Related branches

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

If you need a savegame or more information just tell me

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Hi Ahmend and welcome to Launchpad! :)

Thanks for reporting this issue. If you have a save game or replay demonstrating this crash, it would be great if you could attach that to the bug report. Alternatively, if you know which building or worker is causing the crash, you could post a list of steps on how to trigger it.

Changed in widelands:
importance: Undecided → Medium
tags: added: crash
Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

Steps to reproduce:

1) Load the savegame
2) Set time compression to around 8x
3) -> Error occurs

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Great. Thanks a lot. It crashed for me almost immediately when attempting to save the game (I set it to autosave quite often). I've attached a gdb backtrace.

Changed in widelands:
status: New → Confirmed
tags: added: savegame
Changed in widelands:
importance: Medium → High
milestone: none → build19-rc1
Revision history for this message
GunChleoc (gunchleoc) wrote :

We worked on some of the class members of the productionsite recently, and changed some char buffers to strings. Maybe the bug is connected to that change, and it might actually be caused by something in map_io/widelands_map_buildingdata_data_packet.cc

Revision history for this message
GunChleoc (gunchleoc) wrote :

other things I recently fiddled with is the production program string output and related conf files. Also, it might have the same cause as this bug: https://bugs.launchpad.net/widelands/+bug/1351620

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

What is more, the AI seems to be stuck (does not expand anymore). But I guess that would be a different ticket?

Revision history for this message
TiborB (tiborb95) wrote :

Ahmed,

in regard to AI there is big enhancement (branch tibor-ai5) waiting for merge. And also right now I am working on further changes.

So if you are willing to spend your time, compile this branch and I will welcome your feedback. Moreover the branch should be very close to trunk so you should not miss nothing significant.

BTW I also run into this bug right now.

Revision history for this message
Joseph O Morrow (josephomorrow-o) wrote :

I have a dual-screen shot of frozen widelands borderless screen on left and last standard output on right, along with a gdb "bt".

Revision history for this message
TiborB (tiborb95) wrote :

Hi,
when looking at wlapplication.cc, the code is:

 try {
  // Load selected campaign-map-file
  if (filename.size())
   return game.run_splayer_scenario_direct(filename.c_str(), "");
 } catch (const std::exception & e) {
  log("Fata exception: %s\n", e.what());
  emergency_save(game);
  throw;
 }

Do I understand it properly that you (game itself?) were going to run some "scenario splash"?

But what is more important, wexeption is hiding some details, so could you please get rid of exemption handling like here:

//try {
  // Load selected campaign-map-file
  if (filename.size())
   return game.run_splayer_scenario_direct(filename.c_str(), "");
// } catch (const std::exception & e) {
// log("Fata exception: %s\n", e.what());
// emergency_save(game);
// throw;
// }

and provide bt once more?

Second comment - you can run widelands in window mode, no need for second screens then.

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

@Tibor: Do you mean me?

Revision history for this message
TiborB (tiborb95) wrote :

@Ahmend: yes, post #8 was for you

I noticed the type in your name just after I submitted the post, and there is no way to edit posts...

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

 @Tibor: I was talking about post #10 ;)

I already tried your branch (needed to merge from trunk to get the fix for https://bugs.launchpad.net/widelands/+bug/1351620)
Except for that I cant really give you any feedback, because I keep running into this ticket's bug ;)

Revision history for this message
TiborB (tiborb95) wrote :

Oh no, #10 was for reaction to #9

Just yesterday evening I pushed new revisions 7103 where trunk has been merged.

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

But #9 is unrelated to this bug here, isnt it? (Just want to make sure - otherwise I can try to get the backtrace ..)

Revision history for this message
TiborB (tiborb95) wrote :

#9 is exactly this bug here

BTW, now I do all my testing with barbarians and it does not crashes - so it seems to be a problem of specific building of specific tribe....

Yes, you can make modifications as suggested in #10 and backtrace

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

Ok I tried to comment the exception handling and so far I could not reproduce the bug (a little confused now).

However the performance drops significantly after a while on my savegame (using your branch as well as trunk)

I will attach a savegame

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :
Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

Finally, the crash occured again:

Fata exception: [../src/logic/production_program.cc:249] Not implemented.
Game: Writing Preload Data ... took 14ms
Game: Writing Game Class Data ... took 0ms
Game: Writing Player Info ... took 29ms
Game: Writing Map Data!
Writing Elemental Data ... took 0ms
 Writing Player Names And Tribe Data ... took 0ms
 Writing Port Spaces Data ... took 1ms
 Writing Heights Data ... took 3ms
 Writing Terrain Data ... took 14ms
 Writing Player Start Position Data ... took 1ms
 Writing Player Message Data ... took 5ms
 Writing Resources Data ... took 23ms
 Writing Map Extra Data ... took 2ms
 Writing Map Version ... took 0ms
 Writing Allowed Worker Types Data ... took 0ms
 Writing Flag Data ... took 7ms
 Writing Road Data ... took 2ms
 Writing Building Data ... took 4ms
 Writing Map Objects ... took 85ms
 Writing Flagdata Data ... took 7ms
 Writing Roaddata Data ... took 18ms
 Writing Buildingdata Data ... took 17ms
 Writing Node Ownership Data ... took 4ms
 Writing Exploration Data ... took 4ms
 Writing Players Unseen Data ... took 47ms
 Writing Scripting Data ... took 260ms
 Writing Objective Data ... took 0ms
 Map_Saver::save() took 505ms
Game: Writing Map Data took 507ms
Game: Writing Player Economies Info ... took 1ms
Game: Writing Command Queue Data ... took 709ms
Game: Writing Interactive Player Data ... took 1ms
Game_Saver::save() took 1262ms
SaveHandler::save_game() took 1263ms
terminate called after throwing an instance of '_wexception'
  what(): [../src/logic/production_program.cc:249] Not implemented.

Program received signal SIGABRT, Aborted.
0x00007ffff56cbf89 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x00007ffff56cbf89 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff56cf398 in __GI_abort () at abort.c:89
#2 0x00007ffff5fd76b5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff5fd5836 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff5fd5863 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff5fd5af6 in __cxa_rethrow () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x0000000000b4b629 in WLApplication::load_game (this=0x16da070) at ../src/wlapplication.cc:1604
#7 0x0000000000b4a3e1 in WLApplication::mainmenu_singleplayer (this=0x16da070) at ../src/wlapplication.cc:1388
#8 0x0000000000b49de1 in WLApplication::mainmenu (this=0x16da070) at ../src/wlapplication.cc:1304
#9 0x0000000000b45833 in WLApplication::run (this=0x16da070) at ../src/wlapplication.cc:478
#10 0x0000000000b43a06 in main (argc=1, argv=0x7fffffffdf88) at ../src/main.cc:104

Revision history for this message
TiborB (tiborb95) wrote : Re: [Bug 1352943] [NEW] production_program.cc:249 Not implemented.
Download full text (3.5 KiB)

Are you sure you commented out right lines and recompiled? There should be
no mention of wexeption and no emergency save.

> Finally, the crash occured again:
>
> Fata exception: [../src/logic/production_program.cc:249] Not implemented.
> Game: Writing Preload Data ... took 14ms
> Game: Writing Game Class Data ... took 0ms
> Game: Writing Player Info ... took 29ms
> Game: Writing Map Data!
> Writing Elemental Data ... took 0ms
> Writing Player Names And Tribe Data ... took 0ms
> Writing Port Spaces Data ... took 1ms
> Writing Heights Data ... took 3ms
> Writing Terrain Data ... took 14ms
> Writing Player Start Position Data ... took 1ms
> Writing Player Message Data ... took 5ms
> Writing Resources Data ... took 23ms
> Writing Map Extra Data ... took 2ms
> Writing Map Version ... took 0ms
> Writing Allowed Worker Types Data ... took 0ms
> Writing Flag Data ... took 7ms
> Writing Road Data ... took 2ms
> Writing Building Data ... took 4ms
> Writing Map Objects ... took 85ms
> Writing Flagdata Data ... took 7ms
> Writing Roaddata Data ... took 18ms
> Writing Buildingdata Data ... took 17ms
> Writing Node Ownership Data ... took 4ms
> Writing Exploration Data ... took 4ms
> Writing Players Unseen Data ... took 47ms
> Writing Scripting Data ... took 260ms
> Writing Objective Data ... took 0ms
> Map_Saver::save() took 505ms
> Game: Writing Map Data took 507ms
> Game: Writing Player Economies Info ... took 1ms
> Game: Writing Command Queue Data ... took 709ms
> Game: Writing Interactive Player Data ... took 1ms
> Game_Saver::save() took 1262ms
> SaveHandler::save_game() took 1263ms
> terminate called after throwing an instance of '_wexception'
> what(): [../src/logic/production_program.cc:249] Not implemented.
>
> Program received signal SIGABRT, Aborted.
> 0x00007ffff56cbf89 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
> 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis
nicht gefunden.
> (gdb) bt
> #0 0x00007ffff56cbf89 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1 0x00007ffff56cf398 in __GI_abort () at abort.c:89
> #2 0x00007ffff5fd76b5 in __gnu_cxx::__verbose_terminate_handler() ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #3 0x00007ffff5fd5836 in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #4 0x00007ffff5fd5863 in std::terminate() () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #5 0x00007ffff5fd5af6 in __cxa_rethrow () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #6 0x0000000000b4b629 in WLApplication::load_game (this=0x16da070) at
../src/wlapplication.cc:1604
> #7 0x0000000000b4a3e1 in WLApplication::mainmenu_singleplayer
(this=0x16da070) at ../src/wlapplication.cc:1388
> #8 0x0000000000b49de1 in WLApplication::mainmenu (this=0x16da070) at
../src/wlapplication.cc:1304
> #9 0x0000000000b45833 in WLApplication::run (this=0x16da070) at
../src/wlapplication.cc:478
> #10 0x0000000000b43a06 in main (argc=1, argv=0x7fffffffdf88) at
../src/main.cc:104
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1352943
>
> Title:
> produ...

Read more...

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

No Im not .. Ive tried to recompile several times now (and deleted the build folder beforehand) but the binary does not seem to change.

Is there a make clean or something similar?

Revision history for this message
TiborB (tiborb95) wrote :

I think also wrpl file is needed for replay.

If you have not figured the problem out yet, I would suggest delete everything, do again bzr pull, and for all compilations copy the folder with pulled source to new one and preserve original folder unchanged. I think compile.sh creates binary in directory with source....

I noticed slowdowns as well. It seems that decreasing the speed for short time is enough, the game somehow recovers (shown on fps statistics) and you can increase the speed back. I dont know what is behind.

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

Ok, Ive deleted all my widelands folders, did a fresh bzr pull, made changes compiled (using only cmake, not the compile script), symlinked widelands in its root folder ... but still something catched the exception.

Here is the bzr diff (changes were done on your ai5 branch):

=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc 2014-07-25 22:17:48 +0000
+++ src/wlapplication.cc 2014-08-08 23:12:20 +0000
@@ -1595,14 +1595,14 @@
  else
   return false;

- try {
+// try {
   if (game.run_load_game(filename, ""))
    return true;
- } catch (const std::exception & e) {
- log("Fata exception: %s\n", e.what());
- emergency_save(game);
- throw;
- }
+// } catch (const std::exception & e) {
+// log("Fata exception: %s\n", e.what());
+// emergency_save(game);
+// throw;
+// }
  return false; // keep compiler silent.
 }

Revision history for this message
TiborB (tiborb95) wrote :

"symlinked widelands in its root folder" - why this? Just run the .../widelands binary that is listes on the end of compilation report....

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

When I run the binary produced by the cmake config without further parameters the wl binary can not find the pics/ (or images/ ? folder) because that folder is further up in the tree.

Revision history for this message
TiborB (tiborb95) wrote :

Strange

Uninstall the Widelands installed by package manager if you have it
installed, and try once more.

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :
Download full text (3.8 KiB)

Ok, I figured that the exception came from Game::run_load_game() in game.cc - seems to be a different one. However it results in the same exception ..

I commented the try/catch there as well - here is the backtrace: (again, this is on tibor-ai5)

terminate called after throwing an instance of '_wexception'
  what(): [/home/ahmend/dev/tibor-ai5/src/logic/production_program.cc:249] Not implemented.

Program received signal SIGABRT, Aborted.
0x00007ffff56cbf89 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x00007ffff56cbf89 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff56cf398 in __GI_abort () at abort.c:89
#2 0x00007ffff5fd76b5 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff5fd5836 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff5fd5863 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff5fd5aa2 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x0000000000d16224 in Widelands::ProductionProgram::ActReturn::Negation::description (
    this=0x7adaea0) at /home/ahmend/dev/tibor-ai5/src/logic/production_program.cc:249
#7 0x0000000000d17e77 in Widelands::ProductionProgram::ActReturn::execute (this=0x6fe8260, game=
    ..., ps=...) at /home/ahmend/dev/tibor-ai5/src/logic/production_program.cc:562
#8 0x0000000000c87b59 in Widelands::ProductionSite::program_act (this=0x3855b10, game=...)
    at /home/ahmend/dev/tibor-ai5/src/logic/productionsite.cc:655
#9 0x0000000000c87a02 in Widelands::ProductionSite::act (this=0x3855b10, game=..., data=0)
    at /home/ahmend/dev/tibor-ai5/src/logic/productionsite.cc:628
#10 0x0000000000c3cd88 in Widelands::Cmd_Act::execute (this=0xc320dd0, game=...)
    at /home/ahmend/dev/tibor-ai5/src/logic/instances.cc:99
#11 0x0000000000d0ab2a in Widelands::Cmd_Queue::run_queue (this=0x7fffffffb5b0, interval=400,
    game_time_var=@0x7fffffffb410: 12466331)
    at /home/ahmend/dev/tibor-ai5/src/logic/cmd_queue.cc:125
#12 0x0000000000c2015b in Widelands::Game::think (this=0x7fffffffb3f0)
    at /home/ahmend/dev/tibor-ai5/src/logic/game.cc:619
#13 0x0000000000e25a0f in Interactive_Base::think (this=0x34e20f0)
    at /home/ahmend/dev/tibor-ai5/src/wui/interactive_base.cc:380
#14 0x0000000000e35c91 in Interactive_Player::think (this=0x34e20f0)
    at /home/ahmend/dev/tibor-ai5/src/wui/interactive_player.cc:226
#15 0x0000000000d8c6af in UI::Panel::do_think (this=0x34e20f0)
    at /home/ahmend/dev/tibor-ai5/src/ui_basic/panel.cc:588
#16 0x0000000000d8bc26 in UI::Panel::run (this=0x34e20f0)
    at /home/ahmend/dev/tibor-ai5/src/ui_basic/panel.cc:213
#17 0x0000000000c1fdf0 in Widelands::Game::run (this=0x7fffffffb3f0, loader_ui=0x7fffffffa3b0,
    start_game_type=Widelands::Game::Loaded, script_to_run=..., replay=false)
    at /home/ahmend/dev/tibor-ai5/src/logic/game.cc:571
#18 0x0000000000c1f3a5 in Widelands::Game::run_load_game (this=0x7fffffffb3f0, filename=...,
    script_to_run=...) at /home/ahmend/dev/tibor-ai5/src/...

Read more...

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

Ok, so from what I gather

condition_list.push_back(condition->description(ps.owner().tribe()));

is called several time. It works on Player1 and fails for a call on player 2.

But I do not understand why the exception is not thrown right away since condition->description() just throws an exception right away ..

Revision history for this message
TiborB (tiborb95) wrote :

Ahmend,

I finally got some spare time to look at our daily communication, and on PC not on a mobile, and it seems I messed things badly :(

We are debugging bug in production_program.cc and I told you to edit wlapplication.cc. And I even dont know where this file came from.
Probably from some other thread... So I appologize... And now it makes sense why production_program.cc still throws exemption...

Also when looking at production_program.cc it is not so easy to get rid of that exemption throwing. I will try to figure it out.

Revision history for this message
Joseph O Morrow (josephomorrow-o) wrote :

Quick guesses: Check out inheritors of the virtual function, while checking production data in tribal building. What has recently changed? Is any data now out-of-range?

Revision history for this message
Ahmend Ghandi (5-spam-m) wrote :

Looking at my games the error might be related to windmills (atlanteans). Ive got plenty of mills filled up but not producing anything. And they are not in the "economy doesnt need the ware" state ..

Revision history for this message
wl-zocker (wl-zocker) wrote :

The Atlantean mill and smokery cause a crash (I have not yet tested other buildings). But those two buildings are the only one that contain the line "return=skipped when site has blackroot and economy needs blackrootflour and not economy needs cornflour", so maybe this special condition is the problem.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

wl-zocker: You're right. I tried now and it was straight-forward to trigger the crash when building an Atlantean mill and reduce the target amount for cornflour. I'll add this to the bug description.

PS. For people posting links to other bugs, if you write bug NUMBER, Launchpad will figure it out and create a link for you automatically. It evens adds the title in the tooltip. :) For instance bug 1352943.

description: updated
tags: added: gamedata
Changed in widelands:
status: Confirmed → Triaged
GunChleoc (gunchleoc)
Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
status: Triaged → In Progress
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
GunChleoc (gunchleoc)
Changed in widelands:
assignee: GunChleoc (gunchleoc) → nobody
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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