Bay 12 Games Forum

Other Projects => Curses => Topic started by: seth-- on April 02, 2013, 08:05:26 pm

Title: Segmentation fault in lcs
Post by: seth-- on April 02, 2013, 08:05:26 pm
Here is the save.dat http://dropcanvas.com/zfbz0

Tell me if you need gamelog.txt too

The game was downloaded from svn a few hours ago (don't know the exact commit, the source folder was deleted)

How to reproduce:
Press w, the squad will be in the bank
Press down once
Press right until it crashes

This is what it looks like (it always crashes just when the squad is under the loot)
Code: [Select]
American Bank Corp, Level 1
#-CODE NAME------------SKILL---WEAPON---------ARMOR----------HEALTH---TRANSPORT-
1 Sophie Hooker        27/1    AK-47 (21)     Police Uniform Liberal  On Foot
2 Heather Weathers     23/0    Shotgun (3)    Police Uniform Liberal  On Foot
3 Louise Shaw          28/0    Shotgun (4)    Police Uniform Liberal  On Foot
4
5
6
--------------------------------------------------------------------------------
 W,A,D,X - Move  G - Get Loot   M - Map   E - Equip  |                    CAGES|
                 N - Options    S - Wait  L - Reload |                         |
 O - Change the squad's Liberal order     U - Use    |                         |
 # - Check the status of a squad Liberal  V - Evade  |                    CAGES|
 0 - Show the squad's Liberal status      K - Kidnap |                         |
 F - Fight!      T - Talk       R - Release hostage  |                         |
                                                     |          LOOT!          |
                                                     |          SQUAD          |
                                                     |                         |
                                                     |                    CAGES|
                                                     |                         |
                                                     |                         |
                                                     |                         |
                                                     |                     EXT |
                                                     |                     .   |
                                                     Segmentation fault (core dumped)

I'm using linux
Title: Re: Segmentation fault in lcs
Post by: SealyStar on April 02, 2013, 10:24:25 pm
That screen mockup...

How long did that take to make? o_o
Title: Re: Segmentation fault in lcs
Post by: Jboy2000000 on April 02, 2013, 11:05:01 pm
Well, one thing Im noticing is the cages that shouldn't be there, as well as the single exit. Also the lack of walls. Something besides the crash is definitely wrong with your game.
Title: Re: Segmentation fault in lcs
Post by: Jonathan S. Fox on April 03, 2013, 01:58:14 am
I'm not able to reproduce this using the latest SVN, but Jboy is right -- judging by the screenshot, your map appears to be corrupted. Maps aren't saved in the save file directly, so a problem with your map files could explain why I'm not able to reproduce the issue. Given the exit in the bottom right of your screen, this doesn't look like a fallback map being generated when the map can't be loaded. Instead, I suspect your map file for the bank is being read in, but it's either reading incorrectly in the Linux build, or your data files are corrupt.

One test you can do is to check out if the Nuclear Plant in the outskirts of the city is also giving you a weird map layout and potentially segfaulting. It's the only other location that uses CSV files to store map data, the way the Bank does.

If the Nuclear Plant is similarly problematic, then it sounds like the Linux version isn't handling the new maps correctly. They're text files, so it could be another line endings issue; running them through dos2unix may be worth trying (though I don't remember where the Linux version keeps its data files off the top of my head).

If the Nuclear Plant seems fine, it's probably just an issue with one of your files being corrupted. Rebuilding the game or just replacing the two .csv files regarding the Bank should fix it, in that case.

That screen mockup...

How long did that take to make? o_o

Heheh, I assume it's an actual capture of the screen. You can do something similar in Windows by right clicking, selecting "Mark", and dragging the flashing box over the screen. For example, this is what the Bank map SHOULD look like when you first show up:

Code: [Select]
American Bank Corp, Level 1
#-CODE NAME------------SKILL---WEAPON---------ARMOR----------HEALTH---TRANSPORT-
1 Fiona Cheney         15/0    .38 Rev (XX)   Clothes        Liberal  On Foot
2
3
4
5
6
--------------------------------------------------------------------------------
 W,A,D,X - Move  G - Get Loot   M - Map   E - Equip  |                         |
                 N - Options    S - Wait  L - Reload |                         |
 O - Change the squad's Liberal order     U - Use    |                         |
 # - Check the status of a squad Liberal  V - Evade  |                         |
 0 - Show the squad's Liberal status      K - Kidnap | EXT  EXT  EXT  EXT  EXT |
 F - Fight!      T - Talk       R - Release hostage  |                         |
                                                     |                         |
                                                     |          SQUAD      EXT |
                                                     |                         |
                                                     |..........     .....     |
                                                     |..........     ..... EXT |
                                                     |..........     .....     |
                                                     |          -----          |
                                                     |                         |
                                                     |                         |
                                                     ---------------------------
Title: Re: Segmentation fault in lcs
Post by: usr_share on April 03, 2013, 02:01:02 am
It's likely that some of the files from the art/ directory weren't installed when you typed "make install". Copy them to /usr/local/share/lcs/art manually.

To maintainers: add their names into the Makefile.
Title: Re: Segmentation fault in lcs
Post by: seth-- on April 03, 2013, 04:48:58 pm
That screen mockup...

How long did that take to make? o_o
I copied and pasted

I'm not able to reproduce this using the latest SVN, but Jboy is right -- judging by the screenshot, your map appears to be corrupted. Maps aren't saved in the save file directly, so a problem with your map files could explain why I'm not able to reproduce the issue. Given the exit in the bottom right of your screen, this doesn't look like a fallback map being generated when the map can't be loaded. Instead, I suspect your map file for the bank is being read in, but it's either reading incorrectly in the Linux build, or your data files are corrupt.

One test you can do is to check out if the Nuclear Plant in the outskirts of the city is also giving you a weird map layout and potentially segfaulting. It's the only other location that uses CSV files to store map data, the way the Bank does.
If the Nuclear Plant is similarly problematic, then it sounds like the Linux version isn't handling the new maps correctly. They're text files, so it could be another line endings issue; running them through dos2unix may be worth trying (though I don't remember where the Linux version keeps its data files off the top of my head).

If the Nuclear Plant seems fine, it's probably just an issue with one of your files being corrupted. Rebuilding the game or just replacing the two .csv files regarding the Bank should fix it, in that case.
The nuclear plant is ok, it doesn't segfault and i can find the thing to sabotage.
This is what the map looks like:
Code: [Select]
Nuclear Power Plant, Level 1
#-COD                                                                      PORT-
1 Sop                                   ☺                                  ot
2 Lou                                                                      ot
3 Hea                        █        █                                    ot
4 Ela                        █        █ ███████████                        ot
5                            █████░████ █ █ $ ░ █
6                            ░ █$     █ ░ ░   █ ░
-----                        █ ░      █ █████░█ █                          -----
 W,A,                        █ █      ░ █    $█ █                              |
                            ███████░███ █     █ ███                            |
 O -                           █  ░   █ ███░███ █                              |
 # -                           █  █ $ █ █!$   █ █                              |
 0 -                           ██░█████ █░█████ ██░█                           |
 F -                           ░      █ █  ░  █ █                              |
                               █      █ █  █  █ █                              |
                                                                               |
                                                                               |
                                                                               |
                                                                               |
                                                                               |
                                                                               |
                                                                               |
                                                                               |
                                                     ---------------------------
I think it's the fallback map you mentioned, because after copying the csv files it became bigger and with more "!" points.
The bank looks like yours now.

Does the fallback bank map fail for anyone else?

I didn't had the csv files in /usr/share/lcs/art but I had them in the source dir. Maybe it's because of this part of the makefile?
Code: [Select]
SUBDIRS = src
lcsdir = $(datadir)/lcs
artdir = $(lcsdir)/art
dist_art_DATA = art/abort.cmv  art/glamshow.cmv  art/largecap.cpc  art/newspic.cpc\
 art/anchor.cmv  art/lacops.cmv    art/newscast.cmv  art/newstops.cpc\
 art/clips.xml  art/weapons.xml art/deptstore.xml  art/loot.xml  art/vehicles.xml\
 art/armors.xml  art/masks.xml  art/pawnshop.xml  art/armsdealer.xml  art/sitemaps.txt\
 art/oubliette.xml

Title: Re: Segmentation fault in lcs
Post by: usr_share on April 04, 2013, 10:40:59 am
Yes, exactly. It's missing the csv files. Please just copy them manually.
Title: Re: Segmentation fault in lcs
Post by: seth-- on April 05, 2013, 07:03:16 pm
Yes, exactly. It's missing the csv files. Please just copy them manually.
I did and it worked but the makefile should be fixed