tlwg / libthai

GNU Lesser General Public License v2.1
70 stars 19 forks source link

Crashing on Windows #7

Open jernejs opened 5 years ago

jernejs commented 5 years ago

libthai hardcodes the path to thbrk.tri at compile-time, which doesn't work on Windows, since the file is normally installed in a different prefix with whatever program depends on libthai. A workaround is to set LIBTHAI_DICTDIR, but this shouldn't be necessary - the library should be able to resolve the path to thbrk.tri from the libthai-0.dll location automatically, and should handle missing thbrk.tri without crashing.

We're seeing crashes in GIMP due to this problem.

thep commented 5 years ago

Could you suggest how I can get the libthai-0.dll location? I don't have a Windows instance at hand to try.

veer66 commented 5 years ago

@thep I have Windows. What do you want me to do?

thep commented 5 years ago

@veer66 Thanks for giving me a hand. Could you find out how to make brk_load_default_dict() (in brk-common.c) load thbrk.tri at the location relative to libthai-0.dll instead of absolute path on Windows?

Related issue: https://github.com/Alexpux/MINGW-packages/issues/4629

jernejs commented 5 years ago

This has been patched in msys: https://github.com/Alexpux/MINGW-packages/pull/4630 , which solves the relocation problem on Windows. I still think that the library shouldn't crash if it can't find the dictionary.