aiongg / khiin

Khí-ín Tâi-gí phah jī hoat 起引台語拍字法
MIT License
4 stars 3 forks source link

Fix unknown crashes #1

Open aiongg opened 1 year ago

aiongg commented 1 year ago

There is at least one or potentially a few different crashes that I believe are the result of null pointers. (Edit: or not, see below.) I have not been able to locate the source of them yet. Debugging is a hassle because you need to attach to an app like Notepad, but the IME DLL will then be loaded into whatever application you are using for debugging (e.g. Visual Studio) and subsequently cause another crash.

I've tried to use iterators as much as possible to limit the possibility of going beyond array bounds, but apparently I missed some that have still not been resolved. I believe the problem areas are around BufferMgr.cpp#L561 or potentially in BufferElement.cpp.

aiongg commented 1 year ago

After closer inspection and some discussion, it might be the case that the random crashes have to do with improper handling of DLL module loading/unloading on Windows.

cf: https://github.com/aiongg/khiin/blob/master/windows/tip/DllModule.cpp#L55-L63

See mozc for reference.