🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #70422

Re: [INN] Bus error with timecaf_next() ?

#70422
From: Xavier Roche
Date: Thu, 09 Dec 2004 10:25
180 lines
8008 bytes
Jeffrey M. Vinocur wrote:
> issue "backtrace" and see if it can give you any details about
> the crash.

It seems that something went wrong in the timecaf_next()/OpenArticle() 
function (BUS signal) but I can't yet find out what (the mmap'ed regions 
are not available after process dies - but the address seems okay 
AFAIKS). I am re-running another job, this time monitored by debugger 
and I will see exactly what happends (but this will take few days).
The ovdb code doesn't seems to be concerned -- I'll see it the crash 
happends again with tradindexed.


For information, the complete stack trace:

 >0  0x3ff8057d728 in __nxm_thread_kill(...) in /usr/shlib/libpthread.so
#1  0x3ff80576560 in pthread_kill(...) in /usr/shlib/libpthread.so
#2  0x3ff80581ae8 in UnknownProcedure2FromFile99(...) in 
/usr/shlib/libpthread.so
#3  0x3ff807e3aa0 in UnknownProcedure16FromFile0(...) in 
/usr/shlib/libexc.so
#4  0x3ff807e3e90 in exc_raise_signal_exception(...) in /usr/shlib/libexc.so
#5  0x3ff80578040 in UnknownProcedure282FromFile0(...) in 
/usr/shlib/libpthread.so
#6  0x3ff800d5170 in __sigtramp(...) in /usr/shlib/libc.so
#7  0x3ff800ebf8c in memchr(...) in /usr/shlib/libc.so
#8  0x1200437c0 in wire_findbody(article=0xc6e800=(null), length=16256) 
"wire.c":40
#9  0x12001fb20 in 
OpenArticle(path=0x140023d60="/usr/local/news/spool/articles/timecaf-00/a9/41d9.CF", 
artnum=23
, amount=RETR_HEAD) "timecaf/timecaf.c":500
#10 0x120020b70 in timecaf_next(article=0x140067440, amount=RETR_HEAD) 
"timecaf/timecaf.c":792
#11 0x1200147b8 in SMnext(article=0x140067440, amount=RETR_HEAD) 
"interface.c":764
#12 0x12000dcb0 in main(argc=0, argv=0x11fffc038) "makehistory.c":879
#13 0x12000ae18 in __start(...) in /udir/news/bin/makehistory

In inn-2.4.1/lib/wire.c:40 :

char *
wire_findbody(const char *article, size_t length)
{
..
         p = memchr(p, '\r', end - p - 3);
..

(ladebug) dump
 >8  0x1200437c0 in wire_findbody(article=0xc6e800=(null), length=16256) 
"wire.c":40
article=0xc6e800=(null)
end=0xc72780=(null)
length=16256
p=0xc6e800=(null)

The "article" argument points to a mmap'ed region which seems OK AFAIKS 
(no value, mmap'ed region is no more available as the process died):

(ladebug) p article
0xc6e800=(null)
(ladebug) p length
16256

And upper, in inn-2.4.1/storage/timecaf/timecaf.c:500 :

static ARTHANDLE *OpenArticle(const char *path, ARTNUM artnum, const 
RETRTYPE amount) {
..
     if ((p = wire_findbody(private->artdata, private->artlen)) == NULL) {

(ladebug) dump
 >9  0x12001fb20 in 
OpenArticle(path=0x140023d60="/usr/local/news/spool/articles/timecaf-00/a9/41d9.CF", 
artnum=23, amount=RETR_HEAD) "timecaf/timecaf.c":500
amount=RETR_HEAD
art=0x140067440
artnum=23
fd=51
len=16256
p=0x1=(null)
pagesize=8192
path=0x140023d60="/usr/local/news/spool/articles/timecaf-00/a9/41d9.CF"
private=0x140067500

(ladebug) p *private
struct {
   artdata = 0xc6e800=(null);
   mmapbase = 0xc6e000=(null);
   artlen = 16256;
   mmaplen = 18304;
   top = 0x0;
   sec = 0x0;
   ter = 0x0;
   topde = 0x0;
   secde = 0x0;
   terde = 0x0;
   curtoc = 0x0;
   curartnum = 0;
   curheader = struct _CAFHEADER {
     Magic = "CRMT";
     Low = 1;
     NumSlots = 262144;
     High = 33;
     Free = 2048;
     StartDataBlock = 8028672;
     BlockSize = 512;
     FreeZoneTabSize = 1737128;
     FreeZoneIndexSize = 424;
     LastCleaned = 536849136;
     spare = [0] = 0,[1] = 0,[2] = 0;
   };
}

The "artdata" is good AFAIKS, BUT memchr() crashed in the very begining 
of the function: (the * line)

(ladebug) memchr/100i
<opaque> memchr(...): DebugInformationStrippedFromFile156
  [0x3ff800ebf80]        and     r17, 0xff, r17
  [0x3ff800ebf84]        beq     r18, 0x3ff800ec078
  [0x3ff800ebf88]        sll     r17, 0x8, r3
*[0x3ff800ebf8c]        ldq_u   r1, 0(r16)
  [0x3ff800ebf90]        bis     r17, r3, r17
  [0x3ff800ebf94]        sll     r17, 0x10, r3
  [0x3ff800ebf98]        bis     r17, r3, r17
  [0x3ff800ebf9c]        sll     r17, 0x20, r3
  [0x3ff800ebfa0]        subq    r31, r16, r2
  [0x3ff800ebfa4]        and     r2, 0x7, r2
  [0x3ff800ebfa8]        bis     r17, r3, r17
  [0x3ff800ebfac]        bne     r2, 0x3ff800ec028
  [0x3ff800ebfb0]        subq    r18, 0x1, r4
  [0x3ff800ebfb4]        bic     r4, 0x7, r4
  [0x3ff800ebfb8]        subq    r18, r4, r18
  [0x3ff800ebfbc]        beq     r4, 0x3ff800ebfe0
  [0x3ff800ebfc0]        xor     r17, r1, r1
  [0x3ff800ebfc4]        subq    r4, 0x8, r4
  [0x3ff800ebfc8]        cmpbge  r31, r1, r1

As the r16 register points to 13035520 (== 0xC6E800 == article == 
private->artdata)

(ladebug) printregs
$r0  [$v0]  = 0                         $r1  [$t0]  = 0
$r2  [$t1]  = 0                         $r3  [$t2]  = 3328
$r4  [$t3]  = 16256                     $r5  [$t4]  = 0
$r6  [$t5]  = 1                         $r7  [$t6]  = 16256
$r8  [$t7]  = 0                         $r9  [$s0]  = 13051776
$r10 [$s1]  = 13035520                  $r11 [$s2]  = 5369132288
$r12 [$s3]  = 51                        $r13 [$s4]  = 1
$r14 [$s5]  = 2048                      $r15 [$s6]  = 0
$r16 [$a0]  = 13035520                  $r17 [$a1]  = 13
$r18 [$a2]  = 16253                     $r19 [$a3]  = 0
$r20 [$a4]  = 0                         $r21 [$a5]  = 8077312
$r22 [$t8]  = 0                         $r23 [$t9]  = 0
$r24 [$t10] = 0                         $r25 [$t11] = 0
$r26 [$ra]  = 4832114628                $r27 [$t12] = 4395899993984
$r28 [$at]  = 0                         $r29 [$gp]  = 5368794240
$r30 [$sp]  = 4831821232                $r31 [$zero]= 0
$f0         = 9.8813129168249309e-323   $f1         = 4099
$f2         = 0                         $f3         = 0
$f4         = 0                         $f5         = 0
$f6         = 0                         $f7         = 0
$f8         = 0                         $f9         = 0
$f10        = 100                       $f11        = 
9.8813129168249309e-323
$f12        = 3.4584595208887258e-323   $f13        = 100
$f14        = 3.4584595208887258e-323   $f15        = 100
$f16        = 0                         $f17        = 100
$f18        = 0                         $f19        = 100
$f20        = 50                        $f21        = 100
$f22        = 9.8813129168249309e-323   $f23        = 100
$f24        = 0                         $f25        = 50
$f26        = 0                         $f27        = 0
$f28        = 0                         $f29        = 0
$f30        = 0                         $f31        = 0
$pc         = 0x3ff800ebf8c             $ps         = 0x8
$fpcr       = 0x8900000000000000        $uniq       = 0x15087100
$vfp        = 0x11fffbdb0
Technical Details
Message-ID: <cp996m$7bp$1@news.httrack.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.wiretrip.org!proxad.net!213.246.39.15.MISMATCH!async2!news.httrack.net!not-for-mail
References: <cp90co$69d$1@news.httrack.net> <cp96g5$bnk$1@puck.litech.org>

Show Full Headers
Complete Article Headers
Message-ID: <cp996m$7bp$1@news.httrack.net>
Subject: Re: [INN] Bus error with timecaf_next() ?
Date: Thu, 09 Dec 2004 11:25:23 +0100
From: Xavier Roche <xroche@free.fr.NOSPAM.invalid>
References: <cp90co$69d$1@news.httrack.net> <cp96g5$bnk$1@puck.litech.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.wiretrip.org!proxad.net!213.246.39.15.MISMATCH!async2!news.httrack.net!not-for-mail
Newsgroups: news.software.nntp
Organization: Nowhere Corp.
Lines: 180
NNTP-Posting-Host: gw.exalead.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.httrack.net 1102587926 7545 212.234.111.157 (9 Dec 2004 10:25:26
 GMT)
X-Complaints-To: usenet@httrack.com
NNTP-Posting-Date: Thu, 9 Dec 2004 10:25:26 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
X-Accept-Language: fr, en-us, en, ja
In-Reply-To: <cp96g5$bnk$1@puck.litech.org>