View Single Post
Old October 31, 2018, 20:04   #63
Vivit
Rookie
 
Vivit's Avatar
 
Join Date: Oct 2018
Posts: 5
Vivit is on a distinguished road
gdb says that the offending line is z-virt.c:67 in mem_free():
Code:
61	void mem_free(void *p)
62	{
63		if (!p) return;
64	
65		if (mem_flags & MEM_POISON_FREE)
66			memset(p, 0xCD, SZ(p));
67		free((char *)p - sizeof(size_t));
68	}
Going up from the stack frame where the fault occurred reveals the following function call:
Code:
#8  0x00573ce4 in string_free (
    str=0x1fa4384 "\270J\372\001are the illegitimate but acknowledged child of a Serf.  ")
    at z-virt.c:110
If I restart the program and reproduce the bug again, the program hangs up in the same place, but with a different string (since the string is one of the things being randomized by the chargen) and different garbage at the beginning of it.

Continuing to test this bug, I've hit other error messages as well, like "realloc(): invalid old size". In this case, the program seems to crash hard; my terminal hangs up. The "double free" message I only see if I'm tracing the program with gdb, but the "invalid old size" displays (right at the end of the curses display, without even a newline before it) even if I'm not tracing the program.

I've also noticed some inconsistent behavior: the history at the bottom of the character sheet sometimes changes when I press 'p'.

Code:
 Name                Age             19          Self  RB  CB  EB   Best
<CHARACTER DATA>
 Max Depth           Town    Shots        0/turn
             
 You are one of several children of a Yeoman.  You are the black sheep 
 of the family.                                                        

<BIG BLANK SPACE>

                                   ['r' to reroll, 'p' for previous roll or 'Enter' to accept]
Note that there is no description of the character's appearance here! This particular bit of data of the data seems to get lost pretty often. The family information there is the same as it was before.

However, sometimes weirder things happen. A crash ususually follows:
Code:
 Name                Age             19          Self  RB  CB  EB   Best
<CHARACTER DATA>
 Max Depth           Town    Shots        0/turn

<NOTHING AT ALL>

                                   ['r' to reroll, 'p' for previous roll or 'Enter' to accept]
Code:
 Name                Age             17          Self  RB  CB  EB   Best
<CHARACTER DATA>
 Max Depth           Town    Shots        0/turn
             
 8o                                                                   
                                                                       
<BIG BLANK SPACE>

                                   ['r' to reroll, 'p' for previous roll or 'Enter' to accept]
I don't always have to strictly alternate between 'p' and 'r' to get the program to crash. Sometimes just pressing them without much pattern will cause it to happen. However, if I press only 'p' or only 'r' a bunch of times, it usually does NOT happen.

Sometimes, especially if I press 'r' a bunch of times in a row without pressing 'p', I will reach a state where pressing 'p' will restore the stats of the previously-rolled sheet, but see the history stay the same. In this state, if I press 'r', the history does change, but if I press 'p', the history stays the same. After rolling a number of new characters, the program may resume retrieving previous characters' histories as normal. Sometimes when histories are not being retrieved properly, the appearance description disappears when the previous sheet is loaded, but the genealogical information remains. When this happens, pressing 'p' again will restore the appearance description with the rest of the history.

Last edited by Vivit; October 31, 2018 at 23:02.
Vivit is offline   Reply With Quote