Welcome to the Builder Academy

Question Hedit Crash

More
30 Aug 2014 11:27 - 30 Aug 2014 21:55 #5020 by WhiskyTest
Replied by WhiskyTest on topic Hedit Crash
Hi Rumble!

EDIT: after another reboot it has gone back to crashing again so not sure if any of the below is valid :D

tldr: the crash looks like file permissions are the culprit.

long version:
I tried some more testing after your post. I took the comments out of lines 87-95 as mentioned above and recompiled. It worked! (I had previously been adding new help entries so the MUD had written to the file) I was so excited I decided to try and break it and figure out what was different.

On a hunch I removed 'write' permissions from the help.hlp file and tried again, still working fine. Rebooted the MUD and tried again - crash!
Restored 'write' permissions and rebooted - still crashing.

How I fixed it again was to comment out those lines and reboot the MUD, create and brand new help entry. Shutdown die the MUD, uncommend the code and recompile, restart the MUD and it works fine again.

My conclusion is that the MUD needs to successfully write a new entry to the help.hlp file and then she is good to go.

Same GDB output as posted above, but here is valgrind output in case that sheds more light, strdup() and simple_list() are on my suspicion radar. The load_char() one you can ignore it's just my hacked prompt code playing up :)

Code:
Aug 30 22:50:49 :: Entering game loop. Aug 30 22:50:53 :: Daemon has connected. Aug 30 22:50:54 :: Daemon had no variable file Aug 30 22:50:54 :: Daemon retrieving crash-saved items and entering game. Aug 30 22:50:54 :: Daemon (level 104) has 3 objects (max 30). Aug 30 22:51:02 :: Daemon tried to get help on old ==6754== Invalid read of size 4 ==6754== at 0x4940C8: do_oasis_hedit (hedit.c:87) ==6754== by 0x4A5B3F: command_interpreter (interpreter.c:600) ==6754== by 0x4592C9: game_loop (comm.c:892) ==6754== by 0x459BA1: main (comm.c:535) ==6754== Address 0x5b549e8 is not stack'd, malloc'd or (recently) free'd ==6754== Aug 30 22:51:06 :: OLC: Daemon starts editing help files. Aug 30 22:51:32 :: OLC: Daemon edits help for old. Aug 30 22:51:33 :: 2646 entries, 84672 bytes. Aug 30 22:51:38 :: OLC: Daemon stops editing help files. Aug 30 22:51:58 :: OLC: Daemon starts editing help files. Aug 30 22:52:11 :: OLC: Daemon edits help for old. Aug 30 22:52:12 :: 2646 entries, 84672 bytes. Aug 30 22:52:18 :: OLC: Daemon stops editing help files. Aug 30 22:53:04 :: OLC: Daemon starts editing help files. Aug 30 22:53:38 :: OLC: Daemon edits help for drop. Aug 30 22:53:39 :: 2645 entries, 84640 bytes. Aug 30 22:53:45 :: OLC: Daemon stops editing help files. Aug 30 22:53:49 :: Daemon tried to get help on throw Aug 30 22:53:54 :: OLC: Daemon starts editing help files. Aug 30 22:54:19 :: OLC: Daemon edits help for throw. Aug 30 22:54:20 :: 2646 entries, 84672 bytes. Aug 30 22:54:26 :: OLC: Daemon stops editing help files. Aug 30 22:54:59 :: (GC) Shutdown by Daemon. Aug 30 22:54:59 :: Closing all sockets. Aug 30 22:54:59 :: Closing link to: Daemon. Aug 30 22:54:59 :: Saving current MUD time. Aug 30 22:54:59 :: Normal termination of game. Aug 30 22:54:59 :: Clearing game world. Aug 30 22:54:59 :: Clearing other memory. ==6754== Invalid read of size 8 ==6754== at 0x4A7BCE: next_in_list (lists.c:192) ==6754== by 0x4A7E51: simple_list (lists.c:274) ==6754== by 0x4A7F82: free_list (lists.c:64) ==6754== by 0x459D31: main (comm.c:378) ==6754== Address 0x5877288 is 8 bytes inside a block of size 24 free'd ==6754== at 0x4C273F0: free (vg_replace_malloc.c:446) ==6754== by 0x4A7F7A: free_list (lists.c:65) ==6754== by 0x459D31: main (comm.c:378) ==6754== Aug 30 22:54:59 :: Done. ==6754== ==6754== HEAP SUMMARY: ==6754== in use at exit: 937 bytes in 7 blocks ==6754== total heap usage: 37,123 allocs, 37,116 frees, 5,012,008 bytes allocated ==6754== ==6754== 9 bytes in 2 blocks are definitely lost in loss record 1 of 5 ==6754== at 0x4C279EE: malloc (vg_replace_malloc.c:270) ==6754== by 0x50E7181: strdup (in /lib64/libc-2.12.so) ==6754== by 0x45ECCF: load_help (db.c:2310) ==6754== by 0x4621E5: index_boot (db.c:1059) ==6754== by 0x49368D: hedit_save_to_disk (hedit.c:187) ==6754== by 0x4938DE: hedit_parse (hedit.c:155) ==6754== by 0x4A2EDC: nanny (interpreter.c:1367) ==6754== by 0x4594C7: game_loop (comm.c:886) ==6754== by 0x459BA1: main (comm.c:535) ==6754== ==6754== 13 bytes in 1 blocks are definitely lost in loss record 2 of 5 ==6754== at 0x4C279EE: malloc (vg_replace_malloc.c:270) ==6754== by 0x50E7181: strdup (in /lib64/libc-2.12.so) ==6754== by 0x4D4D18: load_char (players.c:464) ==6754== by 0x4A3B8E: nanny (interpreter.c:1399) ==6754== by 0x4594C7: game_loop (comm.c:886) ==6754== by 0x459BA1: main (comm.c:535) ==6754== ==6754== 323 bytes in 2 blocks are definitely lost in loss record 4 of 5 ==6754== at 0x4C279EE: malloc (vg_replace_malloc.c:270) ==6754== by 0x50E7181: strdup (in /lib64/libc-2.12.so) ==6754== by 0x45EC92: load_help (db.c:2305) ==6754== by 0x4621E5: index_boot (db.c:1059) ==6754== by 0x49368D: hedit_save_to_disk (hedit.c:187) ==6754== by 0x4938DE: hedit_parse (hedit.c:155) ==6754== by 0x4A2EDC: nanny (interpreter.c:1367) ==6754== by 0x4594C7: game_loop (comm.c:886) ==6754== by 0x459BA1: main (comm.c:535) ==6754== ==6754== LEAK SUMMARY: ==6754== definitely lost: 345 bytes in 5 blocks ==6754== indirectly lost: 0 bytes in 0 blocks ==6754== possibly lost: 0 bytes in 0 blocks ==6754== still reachable: 592 bytes in 2 blocks ==6754== suppressed: 0 bytes in 0 blocks ==6754== Reachable blocks (those to which a pointer was found) are not shown. ==6754== To see them, rerun with: --leak-check=full --show-reachable=yes ==6754== ==6754== For counts of detected and suppressed errors, rerun with: -v ==6754== Use --track-origins=yes to see where uninitialised values come from ==6754== ERROR SUMMARY: 39 errors from 17 contexts (suppressed: 6 from 6) [root@centos6-7x64 UnEarthed]#
Last edit: 30 Aug 2014 21:55 by WhiskyTest. Reason: Crashed again

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

Time to create page: 0.221 seconds