[voikko] Vfst-morfologia: Error in `java': malloc(): memory corruption (fast)
Hannu Väisänen
Hannu.Vaisanen at uef.fi
Tue Dec 9 09:35:14 EET 2014
Merkkijono "meikä-r" kaataa Javan ja Libvoikon vfst-version.
Testiohjelma
import java.io.FileReader;
import java.io.BufferedReader;
import java.util.List;
import org.puimula.libvoikko.*;
public class Kaatuu {
public static void main (String[] args)
{
try {
final String HOME = System.getProperty ("user.home");
final String VOIKKO_PATH = HOME + "/vvfst/voikkodict";
final String LIBVOIKKO = HOME + "/vvfst/lib/libvoikko.so";
System.load (LIBVOIKKO);
Voikko voikko = new Voikko ("fi", VOIKKO_PATH);
List<Analysis> list = voikko.analyze ("meikä-r");
}
catch (Throwable t)
{
System.out.println (t.getMessage());
t.printStackTrace (System.out);
Throwable u = t.getCause();
if (u != null) System.out.println (u.getMessage());
}
}
}
================================================
Testiohjelman kääntäminen
$ less kaatuu.sh
#!/bin/bash
CP=.
CP=${CP}:$HOME/.m2/repository/net/java/dev/jna/jna/3.4.0/jna-3.4.0.jar
CP=${CP}:
$HOME/.m2/repository/org/puimula/voikko/libvoikko/3.7/libvoikko-3.7.jar
javac -cp ${CP} Kaatuu.java
java -cp ${CP} Kaatuu
=====================================================
Debuggeri sanoo
$ gdb /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java core
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols
from /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java...(no debugging
symbols found)...done.
[New LWP 32417]
[New LWP 32420]
[New LWP 32423]
[New LWP 32430]
[New LWP 32416]
[New LWP 32432]
[New LWP 32433]
[New LWP 32429]
[New LWP 32428]
[New LWP 32426]
[New LWP 32427]
[New LWP 32425]
[New LWP 32431]
[New LWP 32424]
[New LWP 32419]
[New LWP 32421]
[New LWP 32418]
[New LWP 32422]
warning: Could not load shared library symbols
for /tmp/jna/jna2398652417768712603.tmp.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `java
-cp .:/home/hvaisane/.m2/repository/net/java/dev/jna/jna/3.4.0/jna-3.4.0.j'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007fe997335bb9 in __GI_raise (sig=sig at entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Tiedostoa tai hakemistoa ei
ole.
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb) where
#0 0x00007fe997335bb9 in __GI_raise (sig=sig at entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007fe997338fc8 in __GI_abort () at abort.c:89
#2 0x00007fe997372e14 in __libc_message (do_abort=do_abort at entry=1,
fmt=fmt at entry=0x7fe9974815a8 "*** Error in `%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007fe99737db77 in malloc_printerr (action=<optimized out>,
str=0x7fe997481948 "malloc(): memory corruption (fast)",
ptr=<optimized out>) at malloc.c:4996
#4 0x00007fe997380884 in _int_malloc (av=0x7fe990000020, bytes=24) at
malloc.c:3359
#5 0x00007fe997382230 in __GI___libc_malloc (bytes=24) at malloc.c:2891
#6 0x00007fe996684bce in os::malloc(unsigned long, unsigned short,
unsigned char*) ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#7 0x00007fe996352b9d in Decoder::decode(unsigned char*, char*, int,
int*, char const*) ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#8 0x00007fe996689a6e in os::dll_address_to_function_name(unsigned
char*, char*, int, int*) ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#9 0x00007fe9963d5b3f in frame::print_on_error(outputStream*, char*,
int, bool) const ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#10 0x00007fe99680b2e2 in VMError::report(outputStream*) ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#11 0x00007fe99680cd4c in VMError::report_and_die() ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#12 0x00007fe9966926df in JVM_handle_linux_signal ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#13 <signal handler called>
#14 libvoikko::morphology::createDefaultStructure
(charsMissing=18446744073709497609,
charsMissing at entry=18446744073709551612,
defaultTitleCase=@0x7fe997ac9d27: false,
structure=structure at entry=0x7fe9901b8400 L"=pppppppppp-=", 'q'
<repeats 187 times>..., structurePos=@0x7fe997ac9d28: 54017,
---Type <return> to continue, or q <return> to quit---
isAbbr=true) at morphology/VfstAnalyzer.cpp:149
#15 0x00007fe988561fa7 in parseStructure (wlen=7, fstOutput=<optimized
out>) at morphology/VfstAnalyzer.cpp:265
#16 libvoikko::morphology::VfstAnalyzer::analyze (this=0x7fe9901c3890,
word=<optimized out>, wlen=7)
at morphology/VfstAnalyzer.cpp:705
#17 0x00007fe9885471ed in libvoikko::morphology::voikkoAnalyzeWordUcs4
(options=options at entry=0x7fe9901c8010,
word=word at entry=0x7fe9901c8640 L'q' <repeats 200 times>...) at
morphology/interface.cpp:45
#18 0x00007fe988547364 in libvoikko::morphology::voikkoAnalyzeWordCstr
(options=0x7fe9901c8010, word=<optimized out>)
at morphology/interface.cpp:92
#19 0x00007fe95cc89adc in ffi_call_unix64 ()
from /usr/lib/x86_64-linux-gnu/libffi.so.6
#20 0x00007fe95cc8940c in ffi_call ()
from /usr/lib/x86_64-linux-gnu/libffi.so.6
#21 0x00007fe93ea5c211 in ?? ()
#22 0x00007fe997ac9ef0 in ?? ()
#23 0x00007fe99000a000 in ?? ()
#24 0x00007fe997ac9f50 in ?? ()
#25 0x00007fe997ac9f58 in ?? ()
#26 0x00007fe997aca080 in ?? ()
#27 0x00007fe99000a1d8 in ?? ()
#28 0x00007fe95cc89db0 in ?? ()
from /usr/lib/x86_64-linux-gnu/libffi.so.6
#29 0x00007fe95cc89db0 in ?? ()
from /usr/lib/x86_64-linux-gnu/libffi.so.6
#30 0x00007fe9970fc130 in ?? () from /lib/x86_64-linux-gnu/libdl.so.2
#31 0x00007fe9970fc144 in dlsym_doit (a=0x0) at dlsym.c:50
#32 0x00007fe9901c2480 in ?? ()
#33 0x00007fe9964b8f90 in ?? ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
---Type <return> to continue, or q <return> to quit---
#34 0x00007fe99000a000 in ?? ()
#35 0x00007fe997ac9f50 in ?? ()
#36 0x00007fe9964b841e in jni_GetArrayLength ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#37 0x00007fe93ea5df40 in ?? ()
#38 0x00007fe997aca510 in ?? ()
#39 0x00007fe9964eb8f5 in JVM_IsPrimitiveClass ()
from /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
#40 0x00007fe98d0127f8 in ?? ()
#41 0x0000000000000001 in ?? ()
#42 0x0000000000000000 in ?? ()
More information about the voikko
mailing list