Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   v4 (http://angband.oook.cz/forum/forumdisplay.php?f=11)
-   -   bug - crash with tons of traps detected (http://angband.oook.cz/forum/showthread.php?t=5363)

grinder March 20, 2012 20:35

bug - crash with tons of traps detected
 
Using revision d1db92e30511af698cc55b284693a5f928fca67a (with a savefile that was generated along different versions), I get a crash on loading the savefile (available on request). The game first crashed on using a rod of detection near a large vault.

Backtrace:
Code:

#0  0x002ef4ee in fread () from /lib/tls/i686/cmov/libc.so.6
#1  0x0818653d in file_read (f=0x825687c, buf=0xbffff3e0 "traps", n=28) at z-file.c:513
#2  0x080d7bf5 in try_load (f=0x825687c) at savefile.c:472
#3  0x080d7ec1 in savefile_load (path=0x8200760 "~/.angband/Angband-v4/save/1000.Username") at savefile.c:555
#4  0x08064bc6 in play_game () at dungeon.c:1621
#5  0x0818d73e in main (argc=1, argv=0xbffff574) at main.c:457

Let me take the opportunity to thank you for making Angband such great fun, having v4 in parallel is a terrific idea.

CunningGabe March 20, 2012 21:24

Quote:

Originally Posted by grinder (Post 67666)
Using revision d1db92e30511af698cc55b284693a5f928fca67a (with a savefile that was generated along different versions), I get a crash on loading the savefile (available on request). The game first crashed on using a rod of detection near a large vault.

Thank you for the report! Are you saying that the game crashed when you used the rod of detection, and now that savefile just crashes when you try to load it? Also, was the vault on the dungeon level that you started on right after updating to that revision?

grinder March 20, 2012 21:43

Yes, it segfaulted while showing the "you detect traps" message. And yes, it segfaults on start, after pressing any key on the title screen (when save loading runs). Once, on a fluke, I was 'stepi'-ing in gdb around the crash point and the game was able to load, but crashed when I used an upstair.

As for whether the vault was created in latest revision, I believe I was playing with rev 81b526d8e4 (might be a bit earlier, sorry for imprecision), went down a stair, detected and got a crash. Then I updated to see if that would fix the crash, which didn't happen.

CunningGabe March 20, 2012 22:25

Hmm. Well, why don't you post the savefile here and I'll take a look.

grinder March 20, 2012 23:31

1 Attachment(s)
Thanks, here it is.

CunningGabe March 21, 2012 11:56

Are you building from source? If so, can you make the following changes and recompile:

1. Add trap.txt to the Makefile in lib/edit.
2. Change line 36 of slay.c, replacing 257 with 513.

With those changes, I am able to load your savefile. It seems that the slay cache was running out of room, leading (I think) to an array index out of bounds.

Magnate March 21, 2012 17:51

Quote:

Originally Posted by CunningGabe (Post 67678)
Are you building from source? If so, can you make the following changes and recompile:

1. Add trap.txt to the Makefile in lib/edit.
2. Change line 36 of slay.c, replacing 257 with 513.

With those changes, I am able to load your savefile. It seems that the slay cache was running out of room, leading (I think) to an array index out of bounds.

Oooh, that's extremely interesting - thanks for picking this up.

grinder March 21, 2012 18:07

Thanks, Gabe.

I'm building from source, but with your changes it still crashes the same way (same backtrace on gdb).

I'm using a 32bit linux (ubuntu 10.04) and, since the crash happens in libc ("fread () from /lib/tls/i686/cmov/libc", see gdb output above), it might be hard to reproduce on other platforms.

CunningGabe March 21, 2012 19:08

Quote:

Originally Posted by grinder (Post 67683)
Thanks, Gabe.

I'm building from source, but with your changes it still crashes the same way (same backtrace on gdb).

I'm using a 32bit linux (ubuntu 10.04) and, since the crash happens in libc ("fread () from /lib/tls/i686/cmov/libc", see gdb output above), it might be hard to reproduce on other platforms.

Hmm. I'm puzzled. I can imagine that the new trap saving and loading code might be messed up in some subtle platform-dependent way, but I can't imagine how that would have caused the original crash when you used the rod of detection.

The only other guess I have is that it has something to do with displaying items on trap squares (though again, I haven't had problems with this on my end, using Windows 7). If you're up for a little detective work, you could try the following:

1. Do Ctrl-a, c, z, P to create a scroll of trap detection.
2. Read the scroll.
3. Drop a bunch of items (without moving).

If everything is working correctly, whenever an item drops onto a known trap square, it should show up as a red &.

grinder March 23, 2012 03:32

Items on traps display fine. OTOH, using the debug mode to create a lvl50 character and teleporting to large-vault-depth gets crashy quick, sometimes even before detecting traps.

You say my save file works OK for you? Because I'm starting to suspect the crash could have led to an inconsistent save file 'traps' entry.


All times are GMT +1. The time now is 12:15.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.