Hard-coded exit in the JNI module

34 views
Skip to first unread message

Nicolas Rinaudo

unread,
Mar 21, 2016, 5:50:52 AM3/21/16
to Unitex-GramLab
I'm interacting with Unitex through its JNI module, which on the whole works rather well.
I have, however, hit something of a brick wall: it seems that, under certain conditions, the underlying native library will kill the current process - which is acceptable when it's a standalone command, but more problematic when the current process is the JVM in which Unitex is being executed.

The scenario I have (which can be reproduced 100% of the time) involves evaluating a graph with something that looks a lot like a cycle (it isn't, but I really can't fault Unitex for thinking it is).
This yields a sequence of

[error] Maximal number of matches per subgraph reached!
[error]   One One <<HERE>>One One One One One One One One One One One ...

Followed by:
Too many errors, giving up!

At this point, the JVM shuts down.

My guess is that when that happens, the underlying Unitex command, rather than exiting "cleanly" by returning a value through main, just calls the C equivalent of System.exit.

Is this a known bug, or something that stands a chance of being fixed at some point?

Cheers,
Nicolas

Gilles Vollant

unread,
Mar 21, 2016, 5:58:21 AM3/21/16
to Nicolas Rinaudo, Unitex-GramLab

Can you made a .ulp log or give us file which reproduce the problem ?

 

Note : this is not “jni” problem but unitex core problem

 

Note 2 : locate have option to stop loop before crash

 

De : unitex-...@googlegroups.com [mailto:unitex-...@googlegroups.com] De la part de Nicolas Rinaudo
Envoyé : lundi 21 mars 2016 10:51
À : Unitex-GramLab
Objet : [Unitex-GramLab] Hard-coded exit in the JNI module

--
You received this message because you are subscribed to the Google Groups "Unitex-GramLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unitex-gramla...@googlegroups.com.
To post to this group, send email to unitex-...@googlegroups.com.
Visit this group at https://groups.google.com/group/unitex-gramlab.
To view this discussion on the web visit https://groups.google.com/d/msgid/unitex-gramlab/f0a47656-8df7-41f1-9637-5d9c557b1cf3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Rinaudo

unread,
Mar 21, 2016, 7:19:20 AM3/21/16
to Unitex-GramLab, nrin...@gmail.com
Of course. I've attached:

- bug-data.tar.gz: graph, dictionaries, alphabet, normalisation rules and corpus used to reproduce the issue
- Bug.scala: Scala code that will attempt to go through the normal evaluation steps - GrfFst2, Normalize, Tokenize, Dico and Locate.
- bug-output.txt: everything that gets printed to stdout when running the corresponding code.

The critical bits are in bug-output.txt:
- the final println is never executed
- the Nonzero exit code returned from runner: 1 message means that the forked VM in which the code was being executed terminated with an exit code of 1, which might code never does.
Bug.scala
bug.tar.gz
bug-output.txt
Reply all
Reply to author
Forward
0 new messages