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

Carter Bullard carter at qosient.com
Sun Feb 10 16:33:50 EST 2008


Hey Eric,
So by the time we're in ArgusGenerateRecordStruct we've corrupted
the time buffer.   Ok, in this process, we're going to have to back  
track
to see where it is getting corrupted, and I'm sorry to say that we may
have to go over some ground we've been over before.  (don't really
understand why you're having problems).

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


If we never call this routine, then it would appear the problem is
back on the argus() side of things.  We'll need to see if ArgusHtoN()
is being called there to see if its causing problems (last routine
to touch the data) and if not, we'll need to look carefully at the
results in ArgusGenerateRecord(), and see if something isn't trashing
it by mistake.

Carter

On Feb 10, 2008, at 2:10 AM, Eric Pancer wrote:

> On Sat, 2008-02-09 at 15:08:23 -0500, Carter Bullard proclaimed...
>
>> So you see the problem!!!!
>> Argus is generating good time numbers and the clients are not
>> unpacking them correctly.
>>
>> So in ra() set another break point in ArgusGenerateRecordStruct(),
>> so we can see what is going wrong.
>
> $ 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 2938
> Breakpoint 1 at 0x1c04e5e1: file argus_client.c, line 2938.
> (gdb) run -S 10.15.223.177
> Starting program: /usr/local/argus/bin/ra -S 10.15.223.177
> [Switching to process 18461, thread 0x7e0c5000]
>
> Breakpoint 1, ArgusGenerateRecordStruct (parser=0x7d9bf01c,
> input=0x7c6e401c,
>    argus=0x8858001c) at argus_client.c:2938
> 2938                         if (subtype & 0x78) {
> (gdb) x/12x dsr
> 0x88580044:     0x03180903      0x00071229      0x0000003c       
> 0x02060110
> 0x88580054:     0x003c0001      0x01000030      0x03000020       
> 0x00000002
> 0x88580064:     0x00000000      0x00000000      0x00000000       
> 0x00000000
> (gdb) n
> 2939                            unsigned int *tptr = (unsigned int  
> *) (dsr +
> 1);
> (gdb) n
> 2940                            unsigned int *tval = NULL;
> (gdb) n
> 2941                            int tlen = 2, sindex = -1, tind = 0;
> (gdb) n
> 2943                            if (!(subtype &  
> (ARGUS_TIME_SRC_START |
> ARGUS_TI
> ME_DST_START)))
> (gdb) n
> 2946                            ctime->hdr = time->hdr;
> (gdb) n
> 2948                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2949                               if (subtype &  
> (ARGUS_TIME_SRC_START <<
> i)) {
> (gdb) n
> 2950                                  tind++;
> (gdb) n
> 2948                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2949                               if (subtype &  
> (ARGUS_TIME_SRC_START <<
> i)) {
> (gdb) n
> 2948                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2949                               if (subtype &  
> (ARGUS_TIME_SRC_START <<
> i)) {
> (gdb) n
> 2948                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2949                               if (subtype &  
> (ARGUS_TIME_SRC_START <<
> i)) {
> (gdb) n
> 2948                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2953                            if (tind != num) {
> (gdb) n
> 2976                            sindex = (subtype &  
> ARGUS_TIME_SRC_START) ?
> 0 :
> 2;
> (gdb) n
> 2978                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2979                               if (subtype &  
> (ARGUS_TIME_SRC_START <<
> i)) {
> (gdb) n
> 2980                                  switch (ARGUS_TIME_SRC_START  
> << i) {
> (gdb) n
> 2982                                        tval = (unsigned int
> *)&ctime->src.start;
> (gdb) n
> 2983                                        break;
> (gdb) n
> 2998                                  if (tval && tlen) {
> (gdb) n
> 2999                                     switch (subtype & 0x07) {
> (gdb) n
> 3003                                           for (y = 0; y < tlen;  
> y++)
> (gdb) n
> 3004                                              *tval++ =  
> (*(unsigned int
> *)tptr++);
> (gdb) n
> 3003                                           for (y = 0; y < tlen;  
> y++)
> (gdb) n
> 3004                                              *tval++ =  
> (*(unsigned int
> *)tptr++);
> (gdb) n
> 3003                                           for (y = 0; y < tlen;  
> y++)
> (gdb) n
> 2978                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2979                               if (subtype &  
> (ARGUS_TIME_SRC_START <<
> i)) {
> (gdb) n
> 2978                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2979                               if (subtype &  
> (ARGUS_TIME_SRC_START <<
> i)) {
> (gdb) n
> 2978                            for (i = 0; i < 4; i++) {
> (gdb) n
> 2979                               if (subtype &  
> (ARGUS_TIME_SRC_START <<
> i)) {
> (gdb) n
> 2978                            for (i = 0; i < 4; i++) {
> (gdb) n
> 3027                            if (ctime->src.start.tv_sec == 0)
> (gdb) n
> 3030                            if (ctime->src.end.tv_sec == 0)
> (gdb) n
> 3031                               ctime->src.end = ctime->src.start;
> (gdb) n
> 3032                            if (ctime->dst.end.tv_sec == 0)
> (gdb) n
> 3033                               ctime->dst.end = ctime->dst.start;
> (gdb) n
> 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 = 463401, tv_usec = 60}, end = {tv_sec = 463401,
>      tv_usec = 60}}, dst = {start = {tv_sec = 0, tv_usec = 0}, end = {
>      tv_sec = 0, tv_usec = 0}}}
>
>
> END OF GDB REPORT
>

Carter Bullard
CEO/President
QoSient, LLC
150 E. 57th Street Suite 12D
New York, New York 10022

+1 212 588-9133 Phone
+1 212 588-9134 Fax




More information about the argus mailing list