Bug #2417

i386-only failure involving nmalloc (ZALLOC_SLAB_MAGIC assert)

Added by marino about 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:09/01/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

The yamcha tools build on both platforms. However, they only work on x86_64.
When the yamcha tool pkemine tries to generate a file for cabocha on i386, it core dumps:

#0 _slabfree (ptr=<optimized out>, flags=<optimized out>, rbigp=0x0)
at /usr/src/lib/libc/../libc/stdlib/nmalloc.c:1165
1165 MASSERT(z->z_Magic == ZALLOC_SLAB_MAGIC);

The 4-frame backtrace is here:
http://leaf.dragonflybsd.org/~marino/yamcha/gdb.txt

The i386 pkemine executable is here:
http://leaf.dragonflybsd.org/~marino/yamcha/pkemine

A packed coredump is here:
http://leaf.dragonflybsd.org/~marino/yamcha/pkemine.core.txz

The two platforms have different malloc implementations. Why is i386's implementation dumping why x86_64's is happy?

History

#1 Updated by marino about 2 years ago

I forgot, here's the pkemine source file:
http://leaf.dragonflybsd.org/~marino/yamcha/pkemine.cpp

#2 Updated by vsrinivas almost 2 years ago

How do you run the pkemine tool such that it causes the assert to be hit?

#3 Updated by marino almost 2 years ago

Try building textproc/cabocha.
It uses the tools from textproc/yamcha during its build. The input files that cause the coredump are coming from that.

#4 Updated by vsrinivas almost 2 years ago

When I try to build textproc/cabocha, I get a build failure as follows:

/usr/pkg/libexec/yamcha/mkmodel -e CRL-IREX-ne.txtmodel CRL-IREX-ne.model
Reading TEXT model: CRL-IREX-ne.txtmodel
..................................................................................
Writing BINARY model: CRL-IREX-ne.model
Making Double-Array: 100% |*******************************************|
Making TRIE : 100% |*******************************************|
Done!
rm -f CRL-IREX-ne.txtmodel
/usr/bin/gzcat IPA-chunker.txtmodel.gz | cat > IPA-chunker.txtmodel
/usr/pkg/libexec/yamcha/mkmodel -e IPA-chunker.txtmodel IPA-chunker.model
Reading TEXT model: IPA-chunker.txtmodel
........................
Writing BINARY model: IPA-chunker.model
Making Double-Array: 100% |*******************************************|
Use of uninitialized value $PKE::tsize in addition (+) at /usr/pkg/libexec/yamcha/PKE.pm line 160.
Use of uninitialized value $hlist[4] in pack at /usr/pkg/libexec/yamcha/mkmodel line 182.
No such file or directory: IPA-chunker.model.trie
gmake[2]: *** [IPA-chunker.model] Error 2
gmake[2]: Leaving directory `/usr/pkgsrc/textproc/cabocha/work/cabocha-0.53/model'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/pkgsrc/textproc/cabocha/work/cabocha-0.53'
gmake: *** [all] Error 2
*** Error code 2

Can you give me example files or a command line for pkemine that cause it to crash?

#5 Updated by marino almost 2 years ago

No, I don't have a command example.
The error you posted is what I get. The missing *.trie file is caused by a pkemine segfault; the file is never created.

However, if one dissects the Makefile, one could determine what command and what input pkemine is being given. I haven't done it. I was hoping the core dump would be sufficient.

#6 Updated by marino almost 2 years ago

  • Status changed from New to Closed

NOT-A-BUG

Two yamcha utilities had bugs in them:
pkemine (tried to free std:cin)
mktrie (tried to free a freed object, also char casting bug)

After fixing these bugs, textproc/cabocha builds fine with rebuild yamcha tools.

fixed in pkgsrc:
http://mail-index.netbsd.org/pkgsrc-changes/2012/10/03/msg079088.html

Also available in: Atom PDF