Re: Crash after server move

Ammaross Danan <[email protected]> Wed, 28 Mar 2007 00:27:57 -0600
Newsgroups gmane.games.devel.mud.rom
Organization Ardenmore
Message-ID <[email protected]>
Valnir wrote:
> We're getting ready to port our mud to a new server and we're having a bit
> of an issue. Everything compiles clean, but when we login we get past our
> account login and when we select what character to play the mud crashes.
>  
> Program terminated with signal 11, Segmentation fault.
> #0  0x080b373c in set_host (ch=0xb74f63bc, d=0xb74f5240) at comm.c:5793
> 5793                free_string(ch->usrdata->alt_hosts[h]);
>   
print ch->usrdata
print h
print ch->usrdata->alt_hosts[h]

These will give us the proper feedback on exactly what is causing the 
crash. I'm willing to bet ch->usrdata is 0x0, or is 0x3 or some such 
invalid mem address (caused by an overrun of some sort). If it is, you 
may want to insert an alloc_mem in the new_char_data() and the 
corresponding free_mem() in the free_char_data().
> (gdb) where
> #0  0x080b373c in set_host (ch=0xb74f63bc, d=0xb74f5240) at comm.c:5793
> #1  0x080a905c in nanny (d=0xb74f5240, argument=0xb74f5661 "Valnir") at
> comm.c:2560
> #2  0x080a4a49 in game_loop_unix (control=4) at comm.c:885
> #3  0x080a4424 in main (argc=2, argv=0xbf911974) at comm.c:490
> (gdb) 
>  
> It's crashing while trying to update the listing of hosts that a players has
> connected from.
>  
>     /* consolidate list and remove the current host from the list, if needed
> */
>   
might want to put this block inside a if ( ch->usrdata != null ) check
>     for ( h = 0; h < MAX_HOSTS; h++ )
>     {
>         if ( !str_cmp( ch->usrdata->alt_hosts[h], d->host ) )
>             continue;
>  
>         if ( !IS_NULLSTR(ch->usrdata->alt_hosts[h]) )
>         {
>             hosts[i++] = str_dup(ch->usrdata->alt_hosts[h]);
>             free_string(ch->usrdata->alt_hosts[h]);
>             ch->usrdata->alt_hosts[h] = &str_empty[0];
>         }
>     }
> The new server is running GCC 4.1.1 and any help would be greatly
> appreciated. Thanks!
>  
> - Valnir
>  
>
>
>   
Ammaross Danan
Realms of the Forgotten
www.rotf.net 4998
-- 
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom