08 May, 2009, Banner wrote in the 1st comment:
Votes: 0
Fri May  8 14:06:07 2009 :: Log Banner: oset 100 affect resistance fire

Program received signal SIGSEGV, Segmentation fault.
0x08125b62 in str_cmp (astr=0xbffb3b30 "resistance", bstr=0x6e696c62 <Address 0x6e696c62 out of bounds>) at db.c:4017
4017 if( LOWER( *astr ) != LOWER( *bstr ) )
(gdb) bt
#0 0x08125b62 in str_cmp (astr=0xbffb3b30 "resistance", bstr=0x6e696c62 <Address 0x6e696c62 out of bounds>) at db.c:4017
#1 0x080d2848 in get_atype (type=0xbffb3b30 "resistance") at build.c:463
#2 0x080dbd19 in do_oset (ch=0x8f62320, argument=0xbffb5cbb "fire") at build.c:3585
#3 0x08166014 in interpret (ch=0x8f62320, argument=0xbffb5ca5 "100 affect resistance fire") at interp.c:505
#4 0x08108236 in game_loop () at comm.c:787
#5 0x08106f21 in main (argc=2, argv=0xbffb6194) at comm.c:302
(gdb) frame 2
#2 0x080dbd19 in do_oset (ch=0x8f62320, argument=0xbffb5cbb "fire") at build.c:3585
3585 loc = get_atype( arg2 );
(gdb) list
3580 send_to_char( "detrap dodge peek scan gouge search\n\r", ch );
3581 send_to_char( "mount disarm kick parry bash stun\n\r", ch );
3582 send_to_char( "punch climb grip scribe brew\n\r", ch );
3583 return;
3584 }
3585 loc = get_atype( arg2 );
3586 if( loc < 1 )
3587 {
3588 ch_printf( ch, "Unknown field: %s\n\r", arg2 );
3589 return;
(gdb) frame 1
#1 0x080d2848 in get_atype (type=0xbffb3b30 "resistance") at build.c:463
463 if( !str_cmp( type, a_types[x] ) )
(gdb) list
458 int get_atype( char *type )
459 {
460 int x;
461
462 for( x = 0; x < MAX_APPLY_TYPE; x++ )
463 if( !str_cmp( type, a_types[x] ) )
464 return x;
465 return -1;
466 }
467
(gdb) frame 0
#0 0x08125b62 in str_cmp (astr=0xbffb3b30 "resistance", bstr=0x6e696c62 <Address 0x6e696c62 out of bounds>) at db.c:4017
4017 if( LOWER( *astr ) != LOWER( *bstr ) )
(gdb) list
4012 return TRUE;
4013 }
4014
4015 for( ; *astr || *bstr; astr++, bstr++ )
4016 {
4017 if( LOWER( *astr ) != LOWER( *bstr ) )
4018 return TRUE;
4019 }
4020
4021 return FALSE;
(gdb)


This crash occurs on my SWR when you attempt to set an affect that doesn't exist in the a_types list. Most of the build commands do this for some reason, and I'm certain the newest version of FUSS doesn't do it, even though the code is the same, so any help would be appreciated.
08 May, 2009, David Haley wrote in the 2nd comment:
Votes: 0
MAX_APPLY_TYPE probably isn't set correctly. It would appear that it's trying to access a string that is not in valid memory, which would happen if x (in that for loop) goes to an invalid value (i.e. greater than the size of a_types).
08 May, 2009, Banner wrote in the 3rd comment:
Votes: 0
David Haley said:
MAX_APPLY_TYPE probably isn't set correctly. It would appear that it's trying to access a string that is not in valid memory, which would happen if x (in that for loop) goes to an invalid value (i.e. greater than the size of a_types).

/*
* Apply types (for affects).
* Used in #OBJECTS.
*/
typedef enum
{
APPLY_NONE, APPLY_STR, APPLY_DEX, APPLY_INT, APPLY_WIS, APPLY_CON,
APPLY_SEX, APPLY_NULL, APPLY_LEVEL, APPLY_AGE, APPLY_HEIGHT, APPLY_WEIGHT,
APPLY_MANA, APPLY_HIT, APPLY_MOVE, APPLY_GOLD, APPLY_EXP, APPLY_AC,
APPLY_HITROLL, APPLY_DAMROLL, APPLY_SAVING_POISON, APPLY_SAVING_ROD,
APPLY_SAVING_PARA, APPLY_SAVING_BREATH, APPLY_SAVING_SPELL, APPLY_CHA,
APPLY_AFFECT, APPLY_RESISTANT, APPLY_IMMUNE, APPLY_SUSCEPTIBLE,
APPLY_WEAPONSPELL, APPLY_LCK, APPLY_BACKSTAB, APPLY_PICK, APPLY_TRACK,
APPLY_STEAL, APPLY_SNEAK, APPLY_HIDE, APPLY_PALM, APPLY_DETRAP, APPLY_DODGE,
APPLY_PEEK, APPLY_SCAN, APPLY_GOUGE, APPLY_SEARCH, APPLY_MOUNT, APPLY_DISARM,
APPLY_KICK, APPLY_PARRY, APPLY_BASH, APPLY_STUN, APPLY_PUNCH, APPLY_CLIMB,
APPLY_GRIP, APPLY_SCRIBE, APPLY_BREW, APPLY_WEARSPELL, APPLY_REMOVESPELL,
APPLY_EMOTION, APPLY_MENTALSTATE, APPLY_STRIPSN, APPLY_REMOVE, APPLY_DIG,
APPLY_FULL, APPLY_THIRST, APPLY_DRUNK, APPLY_BLOOD, APPLY_HYPERSPEED, APPLY_REALSPEED,
APPLY_LASERS, APPLY_MAXSHIELD, APPLY_MAXENERGY, APPLY_MAXMISSILES, APPLY_MAXROCKETS,
APPLY_MAXTORPEDOS, APPLY_TRACTORBEAM, APPLY_COMM, APPLY_SENSOR, APPLY_ASTRO_ARRAY,
APPLY_CHAFF, APPLY_MANUEVER, APPLY_ALARM, APPLY_AFTERBURNER, APPLY_CLOAK, APPLY_INTERDICTOR,
APPLY_GRAVWELL, MAX_APPLY_TYPE

} apply_types;

Is there something further that should be done to it?
08 May, 2009, David Haley wrote in the 4th comment:
Votes: 0
Well, it needs to be set correctly w.r.t. a_types, that is, a_types needs to have the right number of strings in it.
08 May, 2009, Banner wrote in the 5th comment:
Votes: 0
So I should pull it out of the enum table and change it to #define MAX_APPLY_TYPE ## instead?
08 May, 2009, David Haley wrote in the 6th comment:
Votes: 0
No, you should make sure that a_types has one entry per value in the apply_types enum.
08 May, 2009, Banner wrote in the 7th comment:
Votes: 0
David Haley said:
No, you should make sure that a_types has one entry per value in the apply_types enum.

I was missing two at the end. Thanks, David.
0.0/7