Kinda a wierd issue. I installed a hotboot snippet ported to SWR by Greven, and everything seems to be working fine. Until a point. I use the command hotboot and the hotboot goes through cleanly, but upon having someone save and quit out of the mud I get this:
Mon Sep 13 23:47:58 2004 :: Initializing socket
Mon Sep 13 23:47:58 2004 :: Rise in Power ready on port 3000.
Mon Sep 13 23:47:58 2004 :: Initiating hotboot recovery.
Mon Sep 13 23:47:58 2004 :: Loading player data for: Toy (6K)
Mon Sep 13 23:47:58 2004 :: Loading player data for: Chains (1K)
Mon Sep 13 23:47:58 2004 :: Updating area entry for Chains
Mon Sep 13 23:47:58 2004 :: Hotboot recovery complete.
Mon Sep 13 23:48:04 2004 :: Chains has quit.
accept_new: select: poll: Bad file descriptor
and then crashes, so I looked into the error. It's in Comm.c, void accept_new, lines 402-406.
After the hotboot completes, attach gdb to it and quit out your character, see where it crashes, and let us know?
The poll error isn't what is crashing it, but its probably a related issue. I imagine it isn't removing the descriptor for the quit character from the linked list, polling a closed socket, and then trying to access something else in the descriptor_data struct, causing the crash. But I can't figure that out without a gdb backtrace.
Actually, yes, the poll error is what's killing the program:
Look at the log entry:
accept_new: select: poll: Bad file descriptor
Look at where this appears in the code:
perror( "accept_new: select: poll" );
exit( 1 );
So, the select is failing, the perror log is written then immediately thereafter the program quits.
But, the problem is certainly one of polling an invalid descriptor. I'm just not sure why it would have one, if this code has been shown to work elsewhere.
Program received signal SIGSEGV, Segmentation fault.
0x7c809f62 in KERNEL32!IsBadWritePtr () from /cygdrive/c/WINDOWS/system32/kernel32.dll
I'm not very good with gdb yet, and I'm gonna play around with it a little bit to see how to attach the gdb after the hotboot. It's sorta odd that I can't turn the code on in gdb, but it runs fine with the .exe file. No errors occur until after the hotboot *shrugs*
$ ps
PID PPID PGID WINPID TTY UID STIME COMMAND
3080 1 3080 3080 con 1005 19:52:34 /home/KK and Li Li/releasev101rip/area/
swrip
2464 1 2464 2464 con 1005 20:09:38 /usr/bin/bash
2608 2464 2608 3676 con 1005 20:12:40 /usr/bin/ps
So I tried
gdb swrip.exe 3080
I set the breakpoint for do_hotboot, and when I hit run I got this:
$ gdb swrip.exe 3080
GNU gdb 2003-09-20-cvs (cygwin-special)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
Attaching to program `/home/KK and Li Li/releasev101rip/area/swrip.exe', process 3080
[Switching to thread 3080.0x664]
(gdb) break do_hotboot
Breakpoint 1 at 0x53ed80: file hotboot.c, line 552.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n)
If I hit no, nothing happens, just a program not restarted message. If I hit yes, I got through the entire loadup till the initializing sockets part with the same problem:
Tue Sep 14 14:05:29 2004 :: Initializing socket
Program received signal SIGSEGV, Segmentation fault.
0x7c809f62 in KERNEL32!IsBadWritePtr () from /cygdrive/c/WINDOWS/system32/kernel32.dll
Well, I'm glad I've spent the past 3 years working on altering a stock SMAUG download. Earlier I attempted to edit omni_complex by using rdelete on one of the rooms.
rdelete 105
And the mud became what I like to call a SUPER NOVA. I've reinstalled the stock area files, recompiled cleanly, and done everything I can to track down the problem, but no good. .EXE files loads to space.are and crashes. I think I'll stop experimenting with SWRIP and just go back to my old code.
Of course, my next challenge should be fun. Wanna turn stock SMAUG into a level-less system and class system much like SWR.
rdelete is extremely buggy, in both SWR and RiP... I've never been able to get it to crash on demand, so I've never been able to debug it. Ah well.
I highly advise you to read Gammon's guide to gdb. Its incredibly helpful, and should get you to a point where you can figure out issues like this.
I don't think SWR's level/class system is what you are looking for if you are looking for levelless... It would be better to design one from scratch...
Especially since SWR is an awful, awful codebase. SWRIP is just a little less awful, according to my totally unbiased opinion.
Well, my stubborness kicked in this morning. So I decided to try something. I ripped the delete_room function outta SWRIP, replaced it with a copy from the smaug I've been working on, fixed the call in mud.h and watched...
Needless to say rdelete works now.
I guess I need to try to recover everything I lost yesturday on this project...