Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Sep 1999 06:10:01 -0700 (PDT)
From:      Ruslan Ermilov <ru@ucb.crimea.ua>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/13992: routed exit after some day of work with signal 6 (core dump)
Message-ID:  <199909281310.GAA07433@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/13992; it has been noted by GNATS.

From: Ruslan Ermilov <ru@ucb.crimea.ua>
To: Riccardo Torrini <riccardo@torrini.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/13992: routed exit after some day of work with signal 6 (core dump)
Date: Tue, 28 Sep 1999 15:56:26 +0300

 --bp/iNruPH9dso1Pn
 Content-Type: text/plain; charset=us-ascii
 
 On Tue, Sep 28, 1999 at 12:52:08PM +0200, Riccardo Torrini wrote:
 > Ruslan Ermilov wrote:
 > 
 > > Great!  Send me this core file as well, and in two minutes after
 > > that you'll know what happened, I'm very close to it.
 > 
 > Here it is.
 > 
 The problem is that gettimeofday(2) returns a garbage for you, and
 the timeout value being passed to select(2) becomes invalid:
 
 : GNU gdb 4.18
 : Copyright 1998 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 "i386-unknown-freebsd"...
 : Core was generated by `routed'.
 : Program terminated with signal 6, Abort trap.
 : #0  0x806d114 in kill ()
 : (gdb) where
 : #0  0x806d114 in kill ()
 : #1  0x806c608 in abort ()
 : #2  0x804c208 in logbad (dump=1, p=0x80718c7 "select: %s")
 :     at /usr/src/sbin/routed/main.c:901
 : #3  0x804b90b in main (argc=0, argv=0xbfbfdbfc)
 :     at /usr/src/sbin/routed/main.c:468
 : #4  0x80480e9 in _start ()
 : (gdb) up 3
 : #3  0x804b90b in main (argc=0, argv=0xbfbfdbfc)
 :     at /usr/src/sbin/routed/main.c:468
 : 468					BADERR(1,"select");
 : (gdb) list
 : 463			trace_flush();
 : 464			ibits = fdbits;
 : 465			n = select(sock_max, &ibits, 0, 0, &wtime);
 : 466			if (n <= 0) {
 : 467				if (n < 0 && errno != EINTR && errno != EAGAIN)
 : 468					BADERR(1,"select");
 : 469				continue;
 : 470			}
 : 471	
 : 472			if (FD_ISSET(rt_sock, &ibits)) {
 : (gdb) print sock_max
 : $1 = 6
 : (gdb) print wtime
 : $2 = {tv_sec = 3, tv_usec = 695150852}
                               ^^^^^^^^^
 			      that's why select(2) returned EINVAL
 : (gdb) print ifinit_timer
 : $3 = {tv_sec = 184988, tv_usec = 841300}
 : (gdb) print now
 : $4 = {tv_sec = 184985, tv_usec = -694309552}
                                    ^^^^^^^^^^
 				   what's up?
 : (gdb) print epoch
 : $5 = {tv_sec = 938326603, tv_usec = 194765}
 : (gdb) print clk
 : $6 = {tv_sec = 938511589, tv_usec = -695114787}
                                       ^^^^^^^^^^
 				      bah, gettimeofday(2) failed!
 : (gdb) print prev_clk
 : $7 = {tv_sec = 938511586, tv_usec = 900334}
 : (gdb) quit
 
 
 Could you please compile and run an attached test program?
 Let it run until it finishes.  If it finishes, it will print an
 incorrect date returned by gettimeofday().
 
 Then please send me the output of this test (if any), as well as
 the output of the following commands:
 
 # cat /var/run/dmesg.boot
 # sysctl kern.timecounter.method machdep.tsc_freq
 
 
 Cheers,
 -- 
 Ruslan Ermilov		Sysadmin and DBA of the
 ru@ucb.crimea.ua	United Commercial Bank,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.247.647	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age
 
 --bp/iNruPH9dso1Pn
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="gettimeofday_test.c"
 
 #include <sys/time.h>
 #include <err.h>
 #include <stdio.h>
 
 void
 main()
 {
     struct timeval tp;
 
     do {
 	if (gettimeofday(&tp, (struct timezone *)NULL) == -1) {
 	    err(1, "gettimeofday");
 	}
 
 	if (tp.tv_usec < 0) {
 	    errx(1, "invalid time returned: %ld:%ld",
 		tp.tv_sec, tp.tv_usec);
 	}
     } while (1);
 
 }
 
 --bp/iNruPH9dso1Pn--
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909281310.GAA07433>