Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Mar 2002 04:12:42 -0500
From:      Mike Tancsa <mike@sentex.net>
To:        stable@freebsd.org
Subject:   Re: pgp problems on stable coredumping with sig 8 ??
Message-ID:  <5.1.0.14.0.20020324034124.04c7bac8@192.168.0.12>
In-Reply-To: <5.1.0.14.0.20020322110901.05b5d6a0@marble.sentex.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

It seems the problem happened somewhere after March 18th as my boxes prior 
to that are OK.  The value of ticksize is coming back as 0.  The subroutine 
which generates it is


static unsigned
ranTickSize(void)
{
         unsigned i = 0, j = 0,  diff, d[N];
         timetype tv0, tv1, tv2;
         /*
          * TODO Get some per-run data to seed the RNG with.
          * pid, ppid, etc.
          */
         gettime(&tv0);
         tv1 = tv0;
         do {
                 gettime(&tv2);
                 diff = (unsigned)tickdiff(tv2, tv1);
                 if (diff > MINTICK) {
                         d[i++] = diff;
                         tv0 = tv2;
                         j = 0;
                 } else if (++j >= 4096) /* Always getting <= MINTICK units */
                         return MINTICK + !MINTICK;
                 tv1 = tv2;
         } while (i < N);

         /* Return average of middle 5 values (rounding up) */
         qsort(d, N, sizeof(d[0]), ranCompare);
         diff = (d[N/2-2]+d[N/2-1]+d[N/2]+d[N/2+1]+d[N/2+2]+4)/5;
#if NOISEDEBUG
         fprintf(stderr, "Tick size is %u\n", diff);
#endif
         return diff;
}

Is now coming back as zero

Is this a PGP bug or a FreeBSD bug ? As I mentioned below, it dies on a 
divide by zero error at

delta = (PGPUInt32)(tickdiff(t, prevt) / ticksize);



         ---Mike


At 11:49 AM 3/22/2002 -0500, Mike Tancsa wrote:

>Not sure where to start with this one, but one of our newer stable boxes 
>seems to barf with pgp versions 5 and 6
>
>It doesnt seem to be hardware specific as I installed it on a different 
>machine (Celeron vs PIV) with the same results
>
>
>OK, vinyl# gdb /usr/local/bin/pgp pgp.core
>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 `pgp'.
>Program terminated with signal 8, Floating point exception.
>Reading symbols from /usr/lib/libstdc++.so.3...done.
>Reading symbols from /usr/lib/libm.so.2...done.
>Reading symbols from /usr/lib/libc_r.so.4...done.
>Reading symbols from /usr/libexec/ld-elf.so.1...done.
>#0  0x80b5c08 in pgpRandomCollectEntropy (rc=0x8214220) at pgpRndUnix.c:323
>323             delta = (PGPUInt32)(tickdiff(t, prevt) / ticksize);
>(gdb) bt
>#0  0x80b5c08 in pgpRandomCollectEntropy (rc=0x8214220) at pgpRndUnix.c:323
>#1  0x811c0b3 in pgpContextGetGlobalPoolRandomContext (context=0x82133a0) 
>at pgpContext.c:495
>#2  0x80b64a1 in pgpSeedGlobalRandomPool (context=0x82133a0) at 
>pgpRndSeed.c:276
>#3  0x811b838 in FinishInitContext (context=0x82133a0) at pgpContext.c:95
>#4  0x811b8ec in pgpNewContextCustomInternal (clientAPIVersion=50339856, 
>custom=0xbfbffb34,
>     newContext=0xbfbffb98) at pgpContext.c:155
>#5  0x811b9eb in pgpNewContextInternal (clientAPIVersion=50339856, 
>newContext=0xbfbffb98) at pgpContext.c:195
>#6  0x811ba18 in PGPNewContext (clientAPIVersion=50339856, 
>newContext=0xbfbffb98) at pgpContext.c:217
>#7  0x804ab2b in main (argc=2, argv=0xbfbffbf0) at main.c:193
>#8  0x804a43d in _start ()
>(gdb)
>
>
>It seems to be
>
>delta = (PGPUInt32)(tickdiff(t, prevt) / ticksize);
>
>Where tickdiff is either
>
>#define tickdiff(s,t) (((s).time-(t).time)*1000 + (s).millitm - (t).millitm)
>
>#define tickdiff(s,t) (((t).it_value.tv_sec-(s).it_value.tv_sec)*1000000 + \
>         (t).it_value.tv_usec - (s).it_value.tv_usec)
>
>#define tickdiff(s,t) 
>(((s).tv_sec-(t).tv_sec)*1000000+(s).tv_usec-(t).tv_usec)
>
>#define tickdiff(s,t) (((s).tv_sec-(t).tv_sec)*1000000000 + \
>         (s).tv_nsec - (t).tv_nsec)
>#define tickdiff(s,t) ((s)-(t))
>
>
>
>
>
>
>--------------------------------------------------------------------
>Mike Tancsa,                                      tel +1 519 651 3400
>Sentex Communications,                            mike@sentex.net
>Providing Internet since 1994                    www.sentex.net
>Cambridge, Ontario Canada                         www.sentex.net/mike
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-stable" in the body of the message

--------------------------------------------------------------------
Mike Tancsa,                          	          tel +1 519 651 3400
Sentex Communications,     			  mike@sentex.net
Providing Internet since 1994                    www.sentex.net
Cambridge, Ontario Canada			  www.sentex.net/mike


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




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