#0 0x080cae52 in write_to_buffer (d=0xb621e388, txt=0xbfbee110 "\033
#0 0x080cae52 in write_to_buffer (d=0xb621e388, txt=0xbfbee110 "\033[1;36m", length=7) at comm.c:2159
2159 if ( d->pProtocol->WriteOOB > 0 )
(gdb) bt
#0 0x080cae52 in write_to_buffer (d=0xb621e388, txt=0xbfbee110 "\033[1;36m", length=7) at comm.c:2159
#1 0x080dd230 in send_to_char (txt=0x8213fea "", ch=0xb622041c) at comm.c:9162
#2 0x0805da60 in do_look (ch=0xb622041c, argument=0x821370f "") at act_info.c:2468
#3 0x0809d770 in copyover_recover () at act_wiz.c:6757
#4 0x080c7fcc in main (argc=4, argv=0xbfbfe714) at comm.c:464
[/code]
The reason it's crashing here is because d, or d->pProtocol is not set right. You'll need to give us the info on those. "print *d" and "print *d->pProtocol".[/quote]
[quote=[url=/topic-3866-63513#p63513]KaVir[/url]][quote=Davion]The reason it's crashing here is because d, or d->pProtocol is not set right.[/quote]
Agreed. Looks like a missing "d->pProtocol = ProtocolCreate();"
Take a look at the INSTALL_ROM.TXT where it adds the protocol data to the descriptor in the init_descriptor() function. After the "dnew = new_descriptor();" it sets some of the dnew structure elements, including dnew->pProtocol. That doesn't appear to be done after a copyover.
[/quote]
Thanks guys, I'll take a look at this when I get home from work. I restored backups of the changed files, but kept the changed files separate to make it a lot quicker to restore what I was using :p
void copyover_recover ()
{
DESCRIPTOR_DATA *d;
FILE *fp;
char name [100];
char buf[1000];
char protocol_stuff[MSL];
char host[MSL];
int desc;
bool fOld;
extern char *help_copyover_end;
logf ("Copyover recovery initiated");
fp = fopen (COPYOVER_FILE, "r");
if (!fp) /* there are some descriptors open which will hang forever then ? */
{
perror ("copyover_recover:fopen");
logf ("Copyover file not found. Exitting.\r\n");
exit (1);
}
unlink (COPYOVER_FILE); /* In case something crashes - doesn't prevent reading */
for (;;)
{
fscanf (fp, "%d %s %s %s\n", &desc, name, host, protocol_stuff );
//fscanf (fp, "%d %s %s\n", &desc, name, host);
if (desc == -1)
break;
/* Write something, and check if it goes error-free */
if (help_copyover_end == '\0')
sprintf(buf, "\r\nRestoring from copyover…\r\n");
else
sprintf(buf, help_copyover_end);
//if (!write_to_descriptor (desc, "\r\nRestoring from copyover…\r\n",0))
if (!write_to_descriptor (desc, buf,0))
{
close (desc); /* nope */
continue;
}
d = new_descriptor();
d->descriptor = desc;
d->pProtocol = ProtocolCreate();
d->host = str_dup (host);
d->next = descriptor_list;
descriptor_list = d;
ProtocolNegotiate(d);
d->connected = CON_COPYOVER_RECOVER; /* -15, so close_socket frees the char */
/* Now, find the pfile */
fOld = load_char_obj (d, name);
if (!fOld) /* Player file not found?! */
{
write_to_descriptor (desc, "\r\nSomehow, your character was lost in the copyover. Sorry.\r\n", 0);
close_socket (d);
}
else /* ok! */
{
/* Just In Case */
if (!d->character->in_room)
d->character->in_room = get_room_index (ROOM_VNUM_TEMPLE);
/* Insert in the char_list */
d->character->next = char_list;
char_list = d->character;
char_to_room (d->character, d->character->in_room);
act ("$n materializes!", d->character, NULL, NULL, TO_ROOM);
d->connected = CON_PLAYING;
d->character->pcdata->noagg = 0;
CopyoverSet( d, protocol_stuff );
ROOM_INDEX_DATA *to_room;
if(is_room_owner(d->character,d->character->in_room) && IS_SET(d->character->in_room->croom_flag2, ROOM_SHIP))
{
if((to_room = get_room_index(d->character->pcdata->seanum)) != NULL)
{
OBJ_DATA *ship;
char buf[MSL];
char *name;
name = d->character->name;
ship = create_object(get_obj_index(OBJ_VNUM_SHIP), 0, 44);
ship->owner = str_dup(d->character->name);
ship->level = d->character->level;
sprintf( buf, ship->short_descr, name );
free_string( ship->short_descr );
ship->short_descr = str_dup( buf );
sprintf( buf, ship->description, name );
free_string( ship->description );
ship->description = str_dup( buf );
obj_to_room( ship, to_room );
}
}
do_look (d->character, "auto");
if (d->character->pet != NULL)
{
char_to_room(d->character->pet,d->character->in_room);
if (HAS_TRIGGER_MOB(d->character->pet, TRIG_PETLOG))
p_percent_trigger( d->character->pet, NULL, NULL, NULL, NULL, NULL, TRIG_PETLOG );
act("$n materializes!",d->character->pet,NULL,NULL,TO_ROOM);
}
}
}
fclose (fp);
}
#583 0x080caef4 in write_to_buffer (d=0xb4899fc8, txt=0x8517600 "[*****] BUG: Buffer overflow. Closing.\r\n\n\r", length=42) at comm.c:2188
#584 0x080ddfe9 in act_new (format=0xbfbec5b0 "[*****] BUG: Buffer overflow. Closing.\r\n", ch=0xb489b85c, arg1=0x0, arg2=0x0, type=3, min_pos=0) at comm.c:9692
#585 0x080909ab in wiznet (string=0xbfbec5b0 "[*****] BUG: Buffer overflow. Closing.\r\n", ch=0x0, obj=0x0, flag=1048576, flag_skip=0, min_level=0) at act_wiz.c:920
#586 0x080e89e1 in bug (str=0x0, param=0) at db.c:5059
#587 0x080caef4 in write_to_buffer (d=0xb4899fc8, txt=0x8517600 "[*****] BUG: Buffer overflow. Closing.\r\n\n\r", length=42) at comm.c:2188
#588 0x080ddfe9 in act_new (format=0xbfbfd880 "[*****] BUG: Buffer overflow. Closing.\r\n", ch=0xb489b85c, arg1=0x0, arg2=0x0, type=3, min_pos=0) at comm.c:9692
#589 0x080909ab in wiznet (string=0xbfbfd880 "[*****] BUG: Buffer overflow. Closing.\r\n", ch=0x0, obj=0x0, flag=1048576, flag_skip=0, min_level=0) at act_wiz.c:920
#590 0x080e89e1 in bug (str=0x0, param=0) at db.c:5059
#591 0x080caef4 in write_to_buffer (d=0xb4899fc8, txt=0x8517600 "[*****] BUG: Buffer overflow. Closing.\r\n\n\r", length=23) at comm.c:2188
#592 0x080ddfe9 in act_new (format=0x8223aaa "$n materializes!", ch=0xb48b0574, arg1=0x0, arg2=0x0, type=0, min_pos=5) at comm.c:9692
#593 0x0809d633 in copyover_recover () at act_wiz.c:6728
#594 0x080c7fe0 in main (argc=4, argv=0xbfc14a74) at comm.c:464
(gdb) print d
$1 = (DESCRIPTOR_DATA *) 0xb7436e04
(gdb) print *d
$2 = {next = 0x0, snoop_by = 0x0, character = 0xb7438e98, original = 0x0, valid = 1 '\001', host = 0xb7438e5c "173-217-57-163-bssr.mid.dyn.suddenlink.net", descriptor = 9,
connected = 0, fcommand = 0 '\0', inbuf = '\0' <repeats 4095 times>, incomm = '\0' <repeats 1023 times>, inlast = '\0' <repeats 1023 times>, repeat = 0,
outbuf = 0xb743865c "", outsize = 2000, outtop = 0, showstr_head = 0x0, showstr_point = 0x0, ansi = 0 '\0', pEdit = 0x0, pString = 0x0, editor = 0, acc_name = 0x0,
last_input = 0, pProtocol = 0x0}
(gdb) print d->pProtocol
$3 = (protocol_t *) 0x0
(gdb) print *d->pProtocol
Cannot access memory at address 0x0
(gdb)
#0 0x00d90643 in strlen () from /lib/libc.so.6
#1 0x00d603ec in vfprintf () from /lib/libc.so.6
#2 0x00d7c94c in vsprintf () from /lib/libc.so.6
#3 0x00d6619b in sprintf () from /lib/libc.so.6
#4 0x0820ae66 in msdp_update () at update.c:4279
#5 0x08206ed3 in update_handler () at update.c:3023
#6 0x080c88a4 in game_loop_unix (control=4) at comm.c:952
#7 0x080c7fd9 in main (argc=2, argv=0xbfb64204) at comm.c:466