Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Compiling the server
➜ Time is crashing mud... :P
|
Time is crashing mud... :P
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
| Posted by
| Creeper386
USA (62 posts) Bio
|
| Date
| Wed 31 Oct 2001 01:49 AM (UTC) |
| Message
| Alright I have a problem... I got the Smaug 1.4a for Unix/Cygwin with the MXP added in. After changes to it that I have found on another site. Changes that are for compiling Smaug on an older Cygwin(Can be found at http://www.rafemand.com/infocenter/csmaug.htm) and it compiled with little problems. Now when I run everything seems to be fine. Only problem I have found so far is that using the time command crashes the mud. Now not being a very skilled coder I'm not sure how to fix this.
If I can get help with this that'd be greatful. If noone can help me with this it still be helpful if someone can help me take out the time command so it won't crash the mud.
Creep | | Top |
|
| Posted by
| Creeper386
USA (62 posts) Bio
|
| Date
| Reply #1 on Wed 31 Oct 2001 05:03 AM (UTC) |
| Message
| Alright the good thing is I figured out some things on my own... Well with some help from some files on this site :P. I have currently disabled the time command so I no longer need to know how to do that. Who would think it would be as easy as commenting it out in three places on in act_info.c and two places in table.c... Alright probably all of you who have coded muds... Anyways I still need to know it its possible to get the time to work with a cygwin compile running on a WinME system.
Creep
By the way thanks for this site here. Very benificial. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #2 on Thu 01 Nov 2001 04:01 AM (UTC) |
| Message
| The "time" command works OK for me under Cygwin. What you could try is to run under gdb (GNU debugger) and see why it is crashing.
Try starting the mud up like this:
gdb smaug.exe
Then "run" the program, and see what happens when it crashes.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Creeper386
USA (62 posts) Bio
|
| Date
| Reply #3 on Thu 01 Nov 2001 04:17 AM (UTC) |
| Message
| When using...
gdb smaug.exe
the run
then log in and use the time command in the Bash window I get...
Program received signal SIGSEGV, Segmentation fault.
0x61055899 in _size_of_stack_reserve__ ()
Now. Not sure what it means my guess is something isn't being recieved correctly... Hehe. SHRUG.
But don't know where or why it is doing it.
I am using an old version of Cygwin as my connection isn't even over 50K. I'm using Cygwin-B20 which a good suggestion is upgrade I know but at less then 50k it takes an hour to get nowhere...
Creep | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Sun 04 Nov 2001 07:27 AM (UTC) |
| Message
| | When you get that message in gdb try typing "bt" (backtrace) which should show you what routine has called what. That should help to narrow down where the problem is occuring. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Creeper386
USA (62 posts) Bio
|
| Date
| Reply #5 on Mon 05 Nov 2001 04:45 AM (UTC) |
| Message
| (gdb) bt
#0 0x61055899 in _size_of_stack_reserve__ ()
Cannot access memory at address 0x2000000.
Is that more helpful?
I have no clue.
Creep | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #6 on Mon 05 Nov 2001 08:09 PM (UTC) |
| Message
| | Sounds like a serious corruption somewhere. Did you get any warnings during the compile that might be relevant? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Creeper386
USA (62 posts) Bio
|
| Date
| Reply #7 on Wed 07 Nov 2001 02:17 AM (UTC) |
| Message
| In the following files I get bracer errors, and one int format error or something similar. Nothing that seems relevant that I can see.
act_obj.C
build.c
db.c
handler.c
interp.c
magic.c
save.c
shops.c
Creep
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #8 on Thu 08 Nov 2001 01:04 AM (UTC) |
| Message
| In the file act_info.c is the code to do the time command, like this:
void do_time( CHAR_DATA *ch, char *argument )
{
extern char str_boot_time[];
extern char reboot_time[];
char *suf;
int day;
day = time_info.day + 1;
if ( day > 4 && day < 20 ) suf = "th";
else if ( day % 10 == 1 ) suf = "st";
else if ( day % 10 == 2 ) suf = "nd";
else if ( day % 10 == 3 ) suf = "rd";
else suf = "th";
set_char_color( AT_YELLOW, ch );
ch_printf( ch,
"It is %d o'clock %s, Day of %s, %d%s the Month of %s.\n\r"
"The mud started up at: %s\r"
"The system time (E.S.T.): %s\r"
"Next Reboot is set for: %s\r",
(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
time_info.hour >= 12 ? "pm" : "am",
day_name[day % 7],
day, suf,
month_name[time_info.month],
str_boot_time,
(char *) ctime( ¤t_time ),
reboot_time
);
return;
}
I would try commenting out bits of it to see what part is causing the crash.
The most likely part if the ch_printf statement, which unfortunately is quite long and complex (in bold above). You could comment out the whole thing, and if that stops the crash, comment out bits of it so that you can see which part is causing the crash. For example:
ch_printf( ch,
"It is %d o'clock %s, Day of %s, %d%s the Month of %s.\n\r"
"The mud started up at: %s\r"
/* "The system time (E.S.T.): %s\r" */
"Next Reboot is set for: %s\r",
(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
time_info.hour >= 12 ? "pm" : "am",
day_name[day % 7],
day, suf,
month_name[time_info.month],
str_boot_time,
/* (char *) ctime( ¤t_time ), */
reboot_time
);
You would need to comment out the line that displays the time (ie. the one with the %s) and the one that calculates it (the "ctime" line). In the example above I have commented out the system time - in bold. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Creeper386
USA (62 posts) Bio
|
| Date
| Reply #9 on Thu 08 Nov 2001 11:05 PM (UTC) |
| Message
| Well I figured out which part of the code is crashing the mud, but I still need help fixing it. Though you have helped alot now I got some basic debugging skills. :)
Something in the following bolded code is what is crashing the mude when time command is used. With the code how it is when time command is used it dispays boot_time, current_time, and reboot_time and doesn't crash.
ch_printf( ch,
/*"It is %d o'clock %s, Day of %s, %d%s the Month of %s.\n\r"*/
"The mud started up at: %s\r"
"The system time (E.S.T.): %s\r"
"Next Reboot is set for: %s\r",
/*(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
time_info.hour >= 12 ? "pm" : "am",
day_name[day % 7],
day, suf,
month_name[time_info.month],*/
str_boot_time,
(char *) ctime( ¤t_time ),
reboot_time
); | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #10 on Fri 09 Nov 2001 02:26 AM (UTC) |
| Message
| I suppose that would crash if the time_info data was completely wrong, eg. if 'day' was out of range.
Try seeing what values it has by doing something like this:
ch_printf( ch,
"Hour = %d, Day = %d, Month = %d, Year = %d\n\r",
time_info.hour,
time_info.day,
time_info.month,
time_info.year);
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Creeper386
USA (62 posts) Bio
|
| Date
| Reply #11 on Fri 09 Nov 2001 03:02 AM (UTC) |
| Message
| Well when I added that in(though had to take out a ')' in order for it to compile) I got this in time.
Hour = 4259584, Day = -21, Month = -29, Year = -5
Now don't know how that works... but thats what I got. At least with this code...
ch_printf( ch,
/*"It is %d o'clock %s, Day of %s, %d%s the Month of %s.\n\r"*/
"Hour = %d, Day = %d, Month = %d, Year = %d\n\r",
"The mud started up at: %s\r"
"The system time (E.S.T.): %s\r"
"Next Reboot is set for: %s\r",
/*(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
time_info.hour >= 12 ? "pm" : "am",
day_name[day % 7],
day, suf,
month_name[time_info.month],*/
time_info.hour,
time_info.day,
time_info.month,
time_info.year,
str_boot_time,
(char *) ctime( ¤t_time ),
reboot_time
);
But with just your code from the previous post I got...
Hour = -17, Day = -29, Month = -5, Year = -650 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #12 on Fri 09 Nov 2001 03:54 AM (UTC) |
| Message
| It seems pretty clear that current_time is wrong, possibly uninitialised, which is why the display crashes. It seems to be calculated in a number of places (eg. comm.c) like this:
gettimeofday( &last_time, NULL );
current_time = (time_t) last_time.tv_sec;
Why it is wrong is hard to say. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Creeper386
USA (62 posts) Bio
|
| Date
| Reply #13 on Thu 15 Nov 2001 11:50 PM (UTC) |
| Message
| Is the code set up to read the Windows time? I was told windows uses time differently then what smaug is normally set up to run.
Also again I'm using Cygwin B20 so would that do anything?
Creep
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #14 on Fri 16 Nov 2001 03:26 AM (UTC) |
| Message
| | I can't really account for this. The "time" command works OK for me under Windows NT, using Cygwin. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
64,041 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top