Bug #2417

i386-only failure involving nmalloc (ZALLOC_SLAB_MAGIC assert)

Added by marino over 5 years ago. Updated over 5 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


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:

The i386 pkemine executable is here:

A packed coredump is here:

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


#1 Updated by marino over 5 years ago

I forgot, here's the pkemine source file:

#2 Updated by vsrinivas over 5 years ago

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

#3 Updated by marino over 5 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 over 5 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% |*******************************************|
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/ 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 over 5 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 over 5 years ago

  • Status changed from New to Closed


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:

Also available in: Atom PDF