Time Issue on OpenBSD 4.2 with rc.69 (Was: Re: Sparc64 OpenBSD4.1 Compile issue)

Peter Van Epp vanepp at sfu.ca
Mon Feb 11 11:43:04 EST 2008


	From this post on Friday the problem looks to be in the clients
somewhere I think (I didn't get time to try this on i386 OpenBSD on the 
weekend though):

On Fri, Feb 08, 2008 at 05:11:30PM -0600, Eric Pancer wrote:
> Carter -
> 
> Ok, my gdb results are below. 
> 
> On Fri, 2008-02-08 at 11:00:49 -0500, Carter Bullard proclaimed...
> 
> > So the key is on line 2551, in ArgusGenerateRecord().  When it copies  
> > the tv_sec
> > from the flow control block to the packet output buffer, is it getting  
> > the right value.
> > So do this at the break point on line 2551:
> 
> # gdb argus

<snip> (looks to be argus running on an I386 box)

> This GDB was configured as "i386-unknown-openbsd4.2"...
> (gdb) break ArgusProcessPacket
> Breakpoint 1 at 0x1c0070dd: file ArgusModeler.c, line 1138.
> (gdb) run -w /tmp/ff.out
> Starting program: /usr/local/argus/sbin/argus -w /tmp/ff.out
>   ArgusWarning: argus[10629]: 08 Feb 08 17:03:07.315247 started
>   ArgusWarning: argus[10629]: 08 Feb 08 17:03:07.315844
> ArgusGetInterfaceStatus: interface em0 is up
> 
<snip>

> Continuing.
> 
> Breakpoint 4, ArgusGenerateRecord (model=0x8bf3801c, rec=0x8ac1ac38,
>     state=0 '\0', retn=0x888b306c) at ArgusModeler.c:2551
> 2551                                        *dsrptr++ = dtime->src.start.tv_usec;
> (gdb) print sizeof(dtime->src.start)
> $5 = 8
> (gdb) x/2x &dtime->src.start
> 0x8ac1ad08:     0x47acdfab      0x0004d160
> (gdb) print dsrptr
> $6 = (unsigned int *) 0x888b3098
> (gdb) n
> 2552                                        break;
> (gdb) n
> 2546                            for (x = 0; x < 4; x++) {
> (gdb) x/2x 0x8ac1ad08
> 0x8ac1ad08:     0x47acdfab      0x0004d160
> 
> End of # `gdb argus'

	In the dsr the time looks to be right. 0x47acdfab = 1202511787 which
is a good looking date:

./timet.pl 1202511787
Fri Feb  8 15:03:07 Canada/Pacific 2008

> 
> > The next step will be to run ra() under gdb, and stop in the routine
> > ArgusGenerateRecordStruct(), to see what numbers get unpacked
> > into the time structs.
> 
> 
> $ gdb ra
> GNU gdb 6.3
> Copyright 2004 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-openbsd4.2"...
> (gdb) l ArgusGenerateRecordStruct
> 2559
> 2560    struct ArgusRecordStruct ArgusGenerateRecordBuffer;
> 2561
> 2562    struct ArgusRecordStruct *
> 2563    ArgusGenerateRecordStruct (struct ArgusParserStruct *parser, struct
> ArgusInput *input, struct ArgusRecord *argus)
> 2564    {
> 2565       struct ArgusRecordStruct *retn = NULL;
> 2566       unsigned int ArgusReverse = 0, status = 0;
> 2567
> 2568       if (argus == NULL) {
> (gdb) break 3079
> Breakpoint 1 at 0x1c04eae1: file argus_client.c, line 3079.
> (gdb) run -S 10.15.223.177
> Starting program: /usr/local/argus/bin/ra -S 10.15.223.177
> [Switching to process 17026, thread 0x869ac000]
> 
> Breakpoint 1, ArgusGenerateRecordStruct (parser=0x7e26601c,
> input=0x88c4e01c,
>     argus=0x7c20701c) at argus_client.c:3079
> 3079                         retn->dsrs[ARGUS_TIME_INDEX] = (struct
> ArgusDSRHeader*) &retn->canon.time;
> (gdb) print retn->canon.time
> $1 = {hdr = {type = 3 '\003', subtype = 9 '\t', dsr_un = {fl = {data = 792},
>       vl8 = {qual = 24 '\030', len = 3 '\003'}, vl16 = {len = 792}}}, src =
> {
>     start = {tv_sec = 670348, tv_usec = 60}, end = {tv_sec = 670348,
>       tv_usec = 60}}, dst = {start = {tv_sec = 0, tv_usec = 0}, end = {
>       tv_sec = 0, tv_usec = 0}}}
> (gdb) break RaProcessRecord
> Breakpoint 2 at 0x1c002d6b: file ra.c, line 188.
> (gdb) c
> Continuing.

	But by the time ra gets the time it is corrupted (it doesn't even look
to be just truncated because 670348 = 0xa3a8c which isn't even a truncated
version of 0x47acdfab):

./timet.pl 670348
Thu Jan  8 10:12:28 Canada/Pacific 1970

Peter Van Epp / Operations and Technical Support 
Simon Fraser University, Burnaby, B.C. Canada



More information about the argus mailing list