Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Obsolete > v4

 
 
Thread Tools Display Modes
Old March 23, 2012, 11:52   #11
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
Quote:
Originally Posted by grinder View Post
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.
I was seeing the same thing -- but expanding the SLAY_CACHE_SIZE in slay.c seems to have fixed that for me. Maybe I'll try jumping around some more to make sure.

Quote:
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.
Yeah, you're probably right.
CunningGabe is offline  
Old March 26, 2012, 08:28   #12
grinder
Rookie
 
Join Date: Mar 2012
Posts: 13
grinder is on a distinguished road
Quote:
Originally Posted by CunningGabe View Post
Yeah, you're probably right.
Today I ran under gdb to catch the crash: it seems to happen on saving/quitting besides a large vault, when freeing the traps in cave_free (cave.c:3642).

Code:
*** glibc detected *** /.../v4/src/angband: double free or corruption (!prev): 0x082a1e50 ***

[cut a bunch of stuff]

4  0x002fe161 in malloc_printerr (action=<value optimized out>, str=0x6 <Address 0x6 out of bounds>, ptr=0x82a1e50)
    at malloc.c:6266
#5  0x002ff9b8 in _int_free (av=<value optimized out>, p=<value optimized out>) at malloc.c:4794
#6  0x00302a9d in *__GI___libc_free (mem=0x82a1e50) at malloc.c:3738
#7  0x0818c7a8 in mem_free (p=0x82a1e54) at z-virt.c:65
#8  0x08052f85 in cave_free (c=0x82a414c) at cave.c:3642
#9  0x080850e2 in cleanup_angband () at init2.c:3691
#10 0x0818d6f3 in main (argc=1, argv=0xbffff574) at main.c:460
I'll try to gather more useful info on this.
grinder is offline  
Old March 26, 2012, 10:52   #13
grinder
Rookie
 
Join Date: Mar 2012
Posts: 13
grinder is on a distinguished road
All I could gather was: saving and quitting from a dungeon level which has a high feeling (murderous or omens of death) results in a crash while freeing stuff, always in mem_free at z-virt.c.

mem_free was usually called from cave.c's cave_free (freeing traps, see backtrace above), sometimes in keymap_free at keymap.c and once in free_obj_alloc at object/obj-make.c.

The savefile gets corrupted somehow, leading to the crashes I posted about.

Edit: forgot to add that this was with latest (f7c33f8a9b) revision from git, which includes the slays cache fix. The character was created in this revision and I used debug mode to beef him up and teleport to around dl 97.
grinder is offline  
Old March 26, 2012, 13:08   #14
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
Okay, _now_ I think I see the problem. In cave.c line 3625, I should be using tr_max instead of trap_max. The former is the max number of traps on a level, and the latter is the max number of trap kinds. So I was allocating only 30 or so spaces instead of the 1024 specified in limits.txt.

I'll fix that tonight and give the variables better names so I stop confusing myself.
CunningGabe is offline  
Old March 26, 2012, 15:24   #15
grinder
Rookie
 
Join Date: Mar 2012
Posts: 13
grinder is on a distinguished road
Quote:
Originally Posted by CunningGabe View Post
In cave.c line 3625, I should be using tr_max instead of trap_max.
Wonderful, this fixes the crash when loading the original save for me (besides not crashing in debug mode tests). Thank you again, Gabe!
grinder is offline  
Old March 26, 2012, 15:35   #16
CunningGabe
Swordsman
 
Join Date: Feb 2008
Location: Boston, MA
Posts: 250
CunningGabe is on a distinguished road
Quote:
Originally Posted by grinder View Post
Wonderful, this fixes the crash when loading the original save for me (besides not crashing in debug mode tests). Thank you again, Gabe!
And thank you for the detective work!
CunningGabe is offline  
 

Tags
crash, traps


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crash bug Jungle_Boy v4 12 October 30, 2011 23:22
Crash bug in V3.3.1 awldune Development 3 October 10, 2011 14:22
Crash bug Napsterbater Vanilla 6 February 26, 2011 10:56
Crash Bug? Rizwan Vanilla 4 February 25, 2010 13:58
[FA] Crash Bug Zikke Variants 8 February 19, 2009 05:20


All times are GMT +1. The time now is 07:39.


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