Welcome to the Builder Academy

Question GDB core file debug help

More
23 Apr 2016 05:27 - 23 Apr 2016 05:43 #5789 by JTP
Replied by JTP on topic GDB core file debug help
It happened again :(

Code:
[New Thread 16666] Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/ld-linux.so.2 Core was generated by `bin/circle -q 6969'. Program terminated with signal 11, Segmentation fault. #0 0x080b48e7 in sub_write (arg=0xbf94d9e6 "Enyuu bravely enters the portal.", ch=0xa498590, find_invis=1 '\001', targets=<value optimized out>) at dg_comm.c:184 184 for (to = world[IN_ROOM(ch)].people; (gdb) bt #0 0x080b48e7 in sub_write (arg=0xbf94d9e6 "Enyuu bravely enters the portal.", ch=0xa498590, find_invis=1 '\001', targets=<value optimized out>) at dg_comm.c:184 #1 0x080ba1c1 in do_osend (obj=0x9f4d2d8, argument=0xbf94d9df " }256 Enyuu bravely enters the portal.", cmd=6, subcmd=1) at dg_objcmd.c:249 #2 0x080ba388 in obj_command_interpreter (obj=0x9f4d2d8, argument=0xbf94d9d4 "oechoaround }256 Enyuu bravely enters the portal.") at dg_objcmd.c:835 #3 0x080c37b4 in script_driver (go_adress=0xbf94dea0, trig=0x9f4d3c8, type=1, mode=0) at dg_scripts.c:2674 #4 0x080c73eb in cmd_otrig (obj=0x9f4d2d8, actor=0xa4febe8, cmd=0xbf94defc "enter", argument=0xbf9547ba "portal", type=4) at dg_triggers.c:718 #5 0x080c754b in command_otrigger (actor=0xa4febe8, cmd=0xbf94defc "enter", argument=0xbf9547b9 " portal") at dg_triggers.c:745 #6 0x080f4e31 in command_interpreter (ch=0xa4febe8, argument=0xbf9547b4 "enter portal") at interpreter.c:533 #7 0x080a7765 in game_loop (local_mother_desc=3) at comm.c:891 #8 0x080a8c07 in init_game (argc=Cannot access memory at address 0x100 ) at comm.c:535 #9 main (argc=Cannot access memory at address 0x100 ) at comm.c:355 (gdb) frame 0 #0 0x080b48e7 in sub_write (arg=0xbf94d9e6 "Enyuu bravely enters the portal.", ch=0xa498590, find_invis=1 '\001', targets=<value optimized out>) at dg_comm.c:184 184 for (to = world[IN_ROOM(ch)].people; (gdb) print ch $1 = (char_data *) 0xa498590 (gdb) print ch->in_room $2 = 65535 (gdb) print world[ch->in_room].people Cannot access memory at address 0xb844b000 (gdb) print world[ch->in_room].people->next_in_room Cannot access memory at address 0xb844b000 (gdb) print world[ch->in_room].people->next_in_room->next_in_room Cannot access memory at address 0xb844b000 (gdb)



So whats going on ?
Last edit: 23 Apr 2016 05:43 by JTP.

Please Log in or Create an account to join the conversation.

More
24 Apr 2016 15:22 #5791 by thomas
Replied by thomas on topic GDB core file debug help
Code:
(gdb) print ch->in_room $2 = 65535

this is NOWHERE (or -1, if you will). The character is not in the world. Basically, somewhere you have a char_from_room() without the corresponding char_to_room() call.



Solution: in sub_write, in dg_comm.c, add a check for being in NOWHERE (around here github.com/tbamud/tbamud/blob/master/src/dg_comm.c#L183 )
Code:
- if (IS_SET(targets, TO_ROOM)) + if (IS_SET(targets, TO_ROOM) && IN_ROOM(ch) != NOWHERE) for (to = world[IN_ROOM(ch)].people; to; to = to->next_in_room) if (to != ch && SENDOK(to)) sub_write_to_char(to, tokens, otokens, type);

Please Log in or Create an account to join the conversation.

More
24 Apr 2016 15:57 - 24 Apr 2016 16:00 #5793 by JTP
Replied by JTP on topic GDB core file debug help
If that fixes it, i will be happy. Thanks alot.

Has happened twice with that player, everyone else enters just fine. But two crashes with him is two to many.
Last edit: 24 Apr 2016 16:00 by JTP.

Please Log in or Create an account to join the conversation.

More
24 Apr 2016 18:19 - 24 Apr 2016 18:20 #5795 by JTP
Replied by JTP on topic GDB core file debug help
handler.c:void extract_char_final(struct char_data *ch)
Code:
HUNTING(temp) = NULL; /* If "temp" has allocated memory data and our ch is a PC, forget the * extracted character (if he/she is remembered) */ if (!IS_NPC(ch) && GET_POS(ch) == POS_DEAD && MEMORY(temp)) forget(temp, ch); /* forget() is safe to use without a check. */ } char_from_room(ch); if (IS_NPC(ch)) { if (GET_MOB_RNUM(ch) != NOTHING) /* prototyped */ mob_index[GET_MOB_RNUM(ch)].number--; clearMemory(ch);

The only place i fould char_from_room without char_to_room
Last edit: 24 Apr 2016 18:20 by JTP.

Please Log in or Create an account to join the conversation.

Time to create page: 0.241 seconds