[libvoikko] Workaround for a crash in libvoikko

Harri Pitkänen hatapitk at iki.fi
Mon Nov 14 21:34:46 EET 2011

On Monday 14 November 2011, Timo Jyrinki wrote:
> The workaround seems to fix the problem, so I applied that and
> uploaded to Debian.

Thanks for testing this. I have now (hopefully) identified and fixed the real 
bug in trunk:


The bug was not actually in the garbage collector but in a piece of code that 
tried to push a substring on the heap. The substring was defined using two 
pointers that pointed to a location in the Malaga heap.

If the heap happens to be full at that moment, allocating a new value on the 
heap requires compacting it first (which is what the garbage collector does). 
Now those pointers would no longer point to the original string when it was 
time to perform the actual copy-to-heap operation. This in turn lead to some 
random characters being copied there.

I will need to do more testing with this fix and also mail the fix to Björn 
Beutel. The bug is in original Malaga too although the code is a bit different 

The workaround I sent yesterday is still perfectly valid. It should fix 99.99% 
of all crashes that could be caused by this bug. I'm not sure how common those 
crashes were before the fix but probably not horribly common.


More information about the Libvoikko mailing list