When compiling a table with includes that are more than 6 levels deep the JVM crashes with SIGBUS
According to the internets SIGBUS is generally related to memory problems, so the first thought is of course to blame liblouis and to assume that it is writing over some JVM stack frames.
Options
- liblouis is somehow corrupting the memory
- The Java bindings have a problem
- some other problem
Analysis
liblouis is corrupting memory
So @bertfrees ported the test case to C, see https://github.com/liblouis/liblouis/blob/test_deep_include/tests/deep_include.c. When running Valgrind there is a memory leak around the usage of the DefaultTableResolver. Electric Fence does not indicate any problems whatsoever.
The problem persists on the JVM when using a liblouis where the memory leak is fixed
Java bindings have a problem
It is not clear where there could be a problem here. The test case simply invokes get_Table through a very simple API straight down to C.
Other problem
Some findings from a google search indicate that the problem could be within the JVM and the use of mmaped files
On a Linux machine the problem doesn't occur
When compiling a table with includes that are more than 6 levels deep the JVM crashes with
SIGBUSAccording to the internets SIGBUS is generally related to memory problems, so the first thought is of course to blame liblouis and to assume that it is writing over some JVM stack frames.
Options
Analysis
liblouis is corrupting memory
So @bertfrees ported the test case to C, see https://github.com/liblouis/liblouis/blob/test_deep_include/tests/deep_include.c. When running Valgrind there is a memory leak around the usage of the
DefaultTableResolver. Electric Fence does not indicate any problems whatsoever.The problem persists on the JVM when using a liblouis where the memory leak is fixed
Java bindings have a problem
It is not clear where there could be a problem here. The test case simply invokes
get_Tablethrough a very simple API straight down to C.int haveLowerDots = 0(may not mean anything).Other problem
Some findings from a google search indicate that the problem could be within the JVM and the use of mmaped files
On a Linux machine the problem doesn't occur