I just transfered my MUD from a WIN98 run system over to a LINUX run system. The compile worked, and the mud was up and running. But now, whenever anyone logs into it and "saves and quits" the mud, it crashes. Does anyone have some feedback that might be able to help me fix this problem?
Maybe a missing directory. I think some of the fopens in the code don't check for a good status. eg. god directory, backup directory. Check all required directories are there.
Also check you have write permissions on all of them.
Ok. We've worked with the Write Permissions and and we've got it down to this: players can log on and off without crashing the mud, but when an Immortal saves and quits, it loses the segment core. Any more ideas?
There is a directory where it puts immortal stuff (gods or something) check that is there. Look in the source, mud.h I think lists the names of directories used.
#define PLAYER_DIR "../player/" /* Player files */
#define BACKUP_DIR "../player/backup/" /* Backup Player files */
#define GOD_DIR "../gods/" /* God Info Dir */
#define BOARD_DIR "../boards/" /* Board data dir */
#define CLAN_DIR "../clans/" /* Clan data dir */
#define COUNCIL_DIR "../councils/" /* Council data dir */
#define DEITY_DIR "../deity/" /* Deity data dir */
#define BUILD_DIR "../building/" /* Online building save dir */
#define SYSTEM_DIR "../system/" /* Main system files */
#define PROG_DIR "mudprogs/" /* MUDProg files */
#define CORPSE_DIR "../corpses/" /* Corpses */
#ifdef WIN32
#define NULL_FILE "nul" /* To reserve one stream */
#else
#define NULL_FILE "/dev/null" /* To reserve one stream */
#endif
#define CLASS_DIR "../classes/" /* Classes */
#define WATCH_DIR "../watch/" /* Imm watch files --Gorog */
/*
* The watch directory contains a maximum of one file for each immortal
* that contains output from "player watches". The name of each file
* in this directory is the name of the immortal who requested the watch
*/
OK. We've set everything looking in the right directory and files. We've got all the permissions set, but still we're having the problem with Immortals saving and quiting. All other immortal commands work, so maybe there's a problem with the quit command?
OK. I've run the debug, and it directs me into Comm.c. This is what the debugger reads:
#0 0x400c1c8c in chunk_alloc (ar_ptr=0x4016d6a0, nb=368) at malloc.c:2877
#1 0x400c1ae4 in __libc_malloc (bytes=364) at malloc.c:2810
#2 0x400b47f4 in _IO_new_fopen (filename=0x4001dc08 "/etc/hosts", mode=0x4001dc06 "r")
at iofopen.c:50
#3 0x40018ec8 in internal_setent (stayopen=0) at nss_files/files-XXX.c:77
#4 0x40019f8a in _nss_files_gethostbyaddr_r (addr=0xbfffe370, len=4, af=2, result=0x40172ce8,
buffer=0x84498a8 "", buflen=1024, errnop=0x40170ac0, herrnop=0xbfffd338)
at nss_files/files-hosts.c:277
#5 0x4013532b in __gethostbyaddr_r (addr=0xbfffe370, len=4, type=2, resbuf=0x40172ce8,
buffer=0x84498a8 "", buflen=1024, result=0xbfffd334, h_errnop=0xbfffd338)
at ../nss/getXXbyYY_r.c:200
#6 0x401350af in gethostbyaddr (addr=0xbfffe370, len=4, type=2) at ../nss/getXXbyYY.c:145
#7 0x0809dcda in new_descriptor (new_desc=6) at comm.c:940
#8 0x0809d598 in accept_new (ctrl=6) at comm.c:616
#9 0x0809d5de in game_loop () at comm.c:640
#10 0x0809d03c in main (argc=2, argv=0xbffff914) at comm.c:316
#11 0x4006b17d in __libc_start_main (main=0x809ccf0 <main>, argc=2, ubp_av=0xbffff914,
init=0x8048fb0 <_init>, fini=0x8140b00 <_fini>, rtld_fini=0x4000a534 <_dl_fini>,
stack_end=0xbffff90c) at ../sysdeps/generic/libc-start.c:129
Now, it appears that all the lines in comm.c that have errors all have something to do with MXP. Any suggestions?
OK... I took the Comm.c File from the original SMAUG1.4A download I originally got, and I still am suffering from the same crashing problem, and the debugger still points to that file as the problem's source. Any feedback would be awesome..
I came up with an idea of how to get around the problem for right now until a solution is discovered. But I'm still not very good with linux yet, so how would I go about writing a batch file in linux that would turn the mud back on when it crashes??
Well... I'm not sure about the batch file in linux but if you know alittle about the system I'm included my dos batch file below that might help some...
Hope it helps.
if EXIST c:\cygwin\home\myname\smaug\dist\area\shutdown.txt DEL shutdown.txt
:loop
c:\cygwin\home\myname\smaug\dist\area\smaug.exe
if EXIST c:\cygwin\home\myname\smaug\dist\area\shutdown.txt goto end
wait 15
goto loop
Since my solution didn't work, and since the crash was in memory allocation, it would suggest corrupted memory, which could be almost anywhere.
Strange it only happens under Linux though.
Here is one idea, if you haven't done it already. Sometimes these crashes can occur if you change a .h file (eg. mud.h) but don't recompile everything.
That didn't work Nick. So me and my team has decided to just start fresh and work on the code the way I did orignally, and see what caused the problem: snippet by snippet, inch of code by inch of code. I'll post my results if and when I find out whatever caused the problem.
-Alexander, starting fresh and glad he has plently of free time.