Re: Timediff Problem

From: StormeRider (silk@ICI.NET)
Date: 01/01/98

Was taking a look at what timediff does as well, and it seems that it's an
essential element of the base processing. Fun fun fun. Computes sleep times
and other nice stuff or something to that effect. Buried neatly in comm.c.
Well, decided to look around more and print out what

>GDB 4.16 (i586-unknown-linux), Copyright 1996 Free Software Foundation,
>Core was generated by `bin/circle -q 4005'.
>Program terminated with signal 11, Segmentation fault.
>Reading symbols from /lib/
>Reading symbols from /lib/
>#0  0x804a75b in timediff (a={tv_sec = -1073744400, tv_usec = 7}, b={
>      tv_sec = 46693, tv_usec = 46693}) at comm.c:910
>910           return null_time;

null_time was ---

(gdb) print null_time
$1 = {tv_sec = 0, tv_usec = 0}

Returning a struct of {0,0} crashes. Great. =) Especially when the timediff
comment says:

 *  new code to calculate time differences, which works on systems
 *  for which tv_usec is unsigned (and thus comparisons for something
 *  being < 0 fail).  Based on code submitted by

 * code to return the time difference between a and b (a-b).
 * always returns a nonnegative value (floors at 0).

If the floor is at 0, then why does it want to crash??? *grin* Going to go
a look at the timediffs from stock pl11 and pl12 and see if they differ at

StormeRider                  ---                 --- telnet://

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST