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

Eric Pancer epancer at pobox.com
Mon Feb 11 00:54:47 EST 2008


On Sun, 2008-02-10 at 16:33:50 -0500, Carter Bullard proclaimed...

> So in back tracking, this shouldn't be a little endian machine, but  the
> only code that works on this buffer before the routine you looked at,  is
> ArgusNtoH().  To see if its messing things up in ra():
> 
> So, in gdb()
> (gdb) l ArgusNtoH
> (gdb) break 13669
> (gdb) run
> 
> to see if we ever break here.
> If so, do this:
> 
> (gdb) x/5x dsr
> 
> then slowly step until you reach the 'break', and print again
> (gdb) x/5x dsr

Hiya -

Here we go.........

$ 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 ArgusNtoH
13465   #endif
13466
13467
13468   void
13469   ArgusNtoH (struct ArgusRecord *argus)
13470   {
13471   #if defined(_LITTLE_ENDIAN)
13472      struct ArgusRecordHeader *hdr = &argus->hdr;
13473      struct ArgusDSRHeader *dsr = (struct ArgusDSRHeader *) (hdr + 1);
13474
(gdb) break 13669
Breakpoint 1 at 0x1c0348e4: file argus_util.c, line 13669.
(gdb) run
Starting program: /usr/local/argus/bin/ra
[Switching to process 18619, thread 0x8bcde000]

Breakpoint 1, ArgusNtoH (argus=0x84f2e01c) at argus_util.c:13669
13669                  for (i = 1; i < dsr->argus_dsrvl8.len; i++)
(gdb) x/5x dsr
0x84f2e040:     0x03180903      0x0e480a00      0x4e000000      0x02060110
0x84f2e050:     0x4e000100
(gdb) n
13670                     dtime[i] = ntohl(dtime[i]);
(gdb) n
13669                  for (i = 1; i < dsr->argus_dsrvl8.len; i++)
(gdb) n
13670                     dtime[i] = ntohl(dtime[i]);
(gdb) n
13669                  for (i = 1; i < dsr->argus_dsrvl8.len; i++)
(gdb) n
13965            if (dsr->subtype & ARGUS_LEN_16BITS)
(gdb) n
13968            if ((cnt = (((dsr->type & ARGUS_IMMEDIATE_DATA) ? 1 :
(gdb) n
13971               dsr = (struct ArgusDSRHeader *)((char *)dsr + cnt);
(gdb) n
13513         while ((char *) dsr < ((char *) argus + (hdr->len * 4))) {
(gdb) n
13514            switch (dsr->type & 0x7F) {
(gdb) n
13675                  if (dsr->subtype & ARGUS_METER_PKTS_BYTES) {
(gdb) n
13676                     switch (dsr->argus_dsrvl8.qual & 0x0F) {
(gdb) n
13701                           ((unsigned short *)(dsr + 1))[0] = ntohs(((unsigned short *)(dsr + 1))[0]);
(gdb) n
13702                           ((unsigned short *)(dsr + 1))[1] = ntohs(((unsigned short *)(dsr + 1))[1]);
(gdb) n
13703                           break;
(gdb) x/5x dsr
0x84f2e04c:     0x02060110      0x004e0001      0x05000330      0x02000000
0x84f2e05c:     0x7b4f9929

Thanks,

- Eric



More information about the argus mailing list