NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/52678: makemandb crashes



The following reply was made to PR bin/52678; it has been noted by GNATS.

From: Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
To: NetBSD GNATS <gnats-bugs%netbsd.org@localhost>
Cc: gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/52678: makemandb crashes
Date: Tue, 31 Oct 2017 09:20:35 +0000

 On Tue, Oct 31, 2017 at 7:45 AM,  <martin%netbsd.org@localhost> wrote:
 >>Number:         52678
 >>Category:       bin
 >>Synopsis:       makemandb crashes
 >>Confidential:   no
 >>Severity:       critical
 >>Priority:       high
 >>Responsible:    bin-bug-people
 >>State:          open
 >>Class:          sw-bug
 >>Submitter-Id:   net
 >>Arrival-Date:   Tue Oct 31 07:45:00 +0000 2017
 >>Originator:     Martin Husemann
 >>Release:        NetBSD 8.99.5
 >>Organization:
 > The NetBSD Foundation, Inc.
 >>Environment:
 > System: NetBSD whoever-brings-the-night.aprisoft.de 8.99.5 NetBSD 8.99.5 =
 (WHOEVER) #183: Sat Oct 28 16:48:01 CEST 2017 martin@seven-days-to-the-wolv=
 es.aprisoft.de:/work/src/sys/arch/sparc64/compile/WHOEVER sparc64
 > Architecture: sparc64
 > Machine: sparc64
 >>Description:
 >
 > Running makemandb (like done at system startup) crashes on sparc64 with
 > a SIGBUS:
 >
 > Program received signal SIGBUS, Bus error.
 > 0x0000000000134690 in porter_stemmer (pnOut=3D0xffffffffffffcc8c,
 >     zOut=3D0x42876f60 "x\234+/NJ=C3=8D\311\001", nIn=3D<optimized out>,
 >     zIn=3D<optimized out>)
 >     at /work/src/usr.sbin/makemandb/custom_apropos_tokenizer.c:625
 > 625     /work/src/usr.sbin/makemandb/custom_apropos_tokenizer.c: No such =
 file or directory.
 > (gdb) bt
 > #0  0x0000000000134690 in porter_stemmer (pnOut=3D0xffffffffffffcc8c,
 >     zOut=3D0x42876f60 "x\234+/NJ=C3=8D\311\001", nIn=3D<optimized out>,
 >     zIn=3D<optimized out>)
 >     at /work/src/usr.sbin/makemandb/custom_apropos_tokenizer.c:625
 > #1  do_stem (pnOut=3D0xffffffffffffcc8c, zOut=3D0x42876f60 "x\234+/NJ=C3=
 =8D\311\001",
 >     nIn=3D<optimized out>, zIn=3D<optimized out>)
 >     at /work/src/usr.sbin/makemandb/custom_apropos_tokenizer.c:654
 > #2  aproposPorterNext (pCursor=3D0x4284af00, pzToken=3D0xffffffffffffcc90=
 ,
 >     pnBytes=3D0xffffffffffffcc8c, piStartOffset=3D0xffffffffffffcc80,
 >     piEndOffset=3D0xffffffffffffcc84, piPosition=3D0xffffffffffffcc88)
 >     at /work/src/usr.sbin/makemandb/custom_apropos_tokenizer.c:719
 > #3  0x000000004053442c in fts3PendingTermsAdd (p=3Dp@entry=3D0x4250a408,
 >     iLangid=3DiLangid@entry=3D0, zText=3D<optimized out>, iCol=3DiCol@ent=
 ry=3D1,
 >     pnWord=3DpnWord@entry=3D0x4287c0c4)
 >     at /work/src/external/public-domain/sqlite/lib/../dist/sqlite3.c:1556=
 41
 > #4  0x00000000405aac54 in fts3InsertTerms (aSz=3D<optimized out>,
 >     apVal=3D<optimized out>, iLangid=3D<optimized out>, p=3D<optimized ou=
 t>)
 >     at /work/src/external/public-domain/sqlite/lib/../dist/sqlite3.c:1557=
 45
 > #5  sqlite3Fts3UpdateMethod (pRowid=3D<optimized out>, apVal=3D<optimized=
  out>,
 >     nArg=3D<optimized out>, pVtab=3D0x4250a408)
 >     at /work/src/external/public-domain/sqlite/lib/../dist/sqlite3.c:2938=
 4
 >
 > the size_t pointer *pnOut is misaligned. It comes from line 719:
 >
 >  int stemStatus =3D do_stem(&z[iStartOffset], n, c->zToken, (size_t *) pn=
 Bytes);
 >
 > and pnBytes only is an int pointer. Either make pnBytes a size_t * as wel=
 l,
 
 We cannot change the type of the function argument since it is the
 interface expected by SQLite.
 
 > or call with a temporary size_t and assign:
 >
 >   size_t temp =3D *pnBytes;
 >   int stemStatus =3D do_stem(&z[iStartOffset], n, c->zToken, &temp);
 >   *pnBytes =3D temp;
 
 This sounds better. Since you have proposed this fix, I am guessing it
 works on Sparc64. :)
 Should I commit it?
 
 
 Regards
 Abhinav
 


Home | Main Index | Thread Index | Old Index