Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Segfault thread  (Read 1885 times)

Kay12

  • Bay Watcher
  • Fighting for Elite Liberal values since 2009!
    • View Profile
Re: Segfault thread **NEW ONE DISCOVERED!**
« Reply #15 on: September 13, 2009, 03:42:48 am »

This really struck me hard since I'm doing really good in LCS, but I decided to get rid of one of my ex-sleepers by having him steal a car, get a lab coat and a crowbar and perform a suicidal attack against the nuclear plant. When stealing the car, the cops (two officers) noticed him, a chase ensued, and he managed to get away from both of them during the first round. And then came a segfault. Luckily my save wasn't ruined, but I thought I'd let you know anyway.

EDIT: Happened again. Chases on foot with ex-sleepers seem to ruin something.
« Last Edit: September 13, 2009, 06:29:53 am by Kay12 »
Logged
Try Liberal Crime Squad, an excellent Liberal Crime adventure game by Toady One and the open source community!
LCS in SourceForge - LCS Wiki - Forum thread for 4.04

themel

  • Bay Watcher
    • View Profile
Re: Segfault thread
« Reply #16 on: September 14, 2009, 02:24:54 pm »

I reproducibly get a segfault from this save.dat on Linux x86-64 after going to University District, Broccoli Forest Vegan Coop and moving one step towards the door.

Backtrace:
Program terminated with signal 11, Segmentation fault.
#0  advancecreature (cr=...) at sitemode/advance.cpp:278
278        if(!cr.alive)return;
(gdb) bt
#0  advancecreature (cr=...) at sitemode/advance.cpp:278
#1  0x00000000004406ae in creatureadvance () at sitemode/advance.cpp:46
#2  0x0000000000448147 in mode_site () at sitemode/sitemode.cpp:1382
#3  0x0000000000485801 in advanceday (clearformess=@0x7fff299702ff, canseethings=1 '\1') at daily/daily.cpp:559
#4  0x00000000004331f7 in mode_base () at basemode/basemode.cpp:771
#5  0x0000000000424980 in mode_title () at title/titlescreen.cpp:131
#6  0x000000000040441b in main (argc=<value optimized out>, argv=<value optimized out>) at game.cpp:414


I assume it has something to do with the fact that Jeffrey still seems to lug around the hostage?
Logged

themel

  • Bay Watcher
    • View Profile
Re: Segfault thread
« Reply #17 on: September 15, 2009, 12:19:11 pm »

Okay, here's a workaround that at least fixes the crashing, no idea why the hostage/corpse didn't get properly dumped in the first place.

Index: src/title/saveload.cpp
===================================================================
--- src/title/saveload.cpp      (revision 339)
+++ src/title/saveload.cpp      (working copy)
@@ -480,6 +480,8 @@
       {
          pool[pl]=new Creature;
          fread(pool[pl],sizeof(Creature),1,h);
+         // freading a pointer from a file is just a tiny bit crazy...
+         pool[pl]->prisoner = NULL;
          //read extra interrogation data if applicable
          if(pool[pl]->align==-1 && pool[pl]->alive)
          {

Logged
Pages: 1 [2]