[liblouis-liblouisxml] Re: The crash with liblouisutdml when using lbu_checkTable

  • From: Michael Whapples <mwhapples@xxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Tue, 19 Jun 2012 01:02:23 +0100

Hello,
I have done some tracking down of this bug, it turns out it is actually caused by liblouisutdml calling lou_logFile with a null parameter.

Either lou_logFile needs to handle a null parameter or lbu_checkTable needs to check for null and not make the call.

Michael Whapples
On 18/06/2012 21:39, John J. Boyer wrote:
Hi Michael,

Thanks for testing. I just refreshed my memory. Error messages are
printed by liblouis using a call to lou_logPrint . There is also another
function in the API, lou_logfile , which is used to set the name of the
log file, which can, of course, be a complete path. This function is
intended to set the log file name until the library is reloaded or it is
called with a different name. If a method uses a log file name of null
the log file is not changed. So what I am thinking of doing now is to
modify the initialize method in the Java bindings to set the log file
name. Then other methods don't have to worry about it. of course,
BrailleBlaster will need a method to check whether the log file has been
changed and notify the user.

John

On Mon, Jun 18, 2012 at 05:41:07PM +0100, Michael Whapples wrote:
Hello,
I know John commented that he was getting a crash with liblouisutdml
when using the lbu_checkTable function from Java, and he was suggesting
having the Java bindings only output to a log file as the crash only
occurs when having errors printed to STDERR.

I voiced a concern that it should not be worked around in the Java
bindings but the cause of the crash should be found. John seemed to
think it may be isolated to Java only, however I can show that it may
occur elsewhere.

My test on Windows: Go to the directory containing liblouisutdml.dll and
launch python (in my case python 3.2). Now run the following code:
import ctypes
lbu = ctypes.windll.liblouisutdml
lbu.lbu_checkTable(b"en-us-g1.utb", None, 0)

This will cause a crash. If a log file is given then the crash does not
occur.

This means the crash is not a Java specific issue and so working around
it in bindings is probably not a good idea as when python bindings are
generated a work around will need to be created for those. Also this
isn't really satisfactory as python or Java applications might want to
output errors to STDERR.

Michael Whapples
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com


For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: