[crossfire] Re: [Crossfire-cvs] CVS commit: crossfire

Alex Schultz alex_sch at telus.net
Mon Oct 3 01:04:01 CDT 2005


     crossfire-cvs-admin at lists.sourceforge.net
     
      wrote:

>
     
     Module Name:	crossfire
     
     >
     
     Committed By:	cavesomething
     
     >
     
     Date:		Mon Oct  3 03:29:41 UTC 2005
     
     >
     
     
     >
     
     Modified Files:
     
     >
     
     	crossfire: ChangeLog
     
     >
     
     	crossfire/common: item.c loader.l map.c
     
     >
     
     	crossfire/doc/Developers: map-technical
     
     >
     
     	crossfire/include: define.h libproto.h map.h sproto.h
     
     >
     
     	crossfire/server: apply.c c_object.c shop.c skill_util.c
     
     >
     
     Added Files:
     
     >
     
     	crossfire/doc/Developers: shops
     
     >
     
     
     >
     
     Log Message:
     
     >
     
     add support for specialised shops
     
     >
     
     
     >
     
     
     Mikee and I both discovered a segfault caused here:

Saving map /scorn/shops/bowshop

Program received signal SIGSEGV, Segmentation fault.
print_shop_string (m=0xafffee20, output_string=0xafffee20 "") at map.c:710
710         for (i=0; i>items[0].index; i++) {
(gdb) bt
#0  print_shop_string (m=0xafffee20, output_string=0xafffee20 "") at 
map.c:710
#1  0x080d29d9 in new_save_map (m=0x888d1d8, flag=0) at map.c:1194
#2  0x080aab16 in swap_map (map=0x888d1d8) at swap.c:166
#3  0x080aabf2 in check_active_maps () at swap.c:194
#4  0x08085429 in main (argc=13, argv=0xafffee20) at main.c:1247
(gdb) print i
$13 = 0
(gdb) print items[i]
Cannot access memory at address 0x0
(gdb) print items
$15 = (shopitems *) 0x0
(gdb) print m->shopitems
$14 = (shopitems *) 0x2e3a72
(gdb) print *m->shopitems
Cannot access memory at address 0x2e3a72

Looking at this, the issue is "items" being a null pointer. Also, from 
what I've found, it's something perticular about the bowshop that's 
causing it. Also, if this helps:

(gdb) up
#1  0x080d29d9 in new_save_map (m=0x888d1d8, flag=0) at map.c:1194
1194            print_shop_string(m, shop);
(gdb) print m
$19 = (mapstruct *) 0x888d1d8
(gdb) print shop
$20 = 
"\000\000\000\000\000\000\000\004\000\000\000\000\210S\035\b(\uffff\uffff\b\000\000\000\000\004\000\000\000\uffff7\uffff\bK\001\000\000\000\000\000\000\210\uffff\uffff\uffff\uffffU\v\b\uffff\205\uffff\b", 
'\0' <repeats 19 times>, 
"\004\000\000\000\000\210S\035\b(\uffff\uffff\b\000\000\000\000\004\000\000\000\000{\uffff\bJ\001\000\000\000\000\000\000\uffff\uffff\uffff\uffff\uffffU\v\b\uffff7\uffff\b", 
'\0' <repeats 19 times>, 
"\004\000\000\000\000\210S\035\b(\uffff\uffff\b\000\000\000\000\004\000\000\000\220u\uffff\bI\001\000\000\000\000\000\000\b\uffff\uffff\uffff\uffffU\v\b\000{\uffff\b", 
'\0' <repeats 19 times>, 
"\004\000\000\000\000\210S\035\b(\uffff\uffff\b\000\000\000\000\004\000\000\000(\uffff\uffff\bH\001\000"...


    Alex Schultz

    
    


More information about the crossfire mailing list