FFI is a border.
Once you start working with it, you are in C world.
And C world is nasty, hard and cumbersome.
In C world, pointers not correctly alloc���d produce a crash.
In C world, pointers not correctly freed also produce a crash, eventually (and those are harder to fix).
In C world everything pointing to wrong location will produce a crash (and you can point anything to anywhere).
That���s why garbage collectors were invented, after all.
So my only advice here is:
- recheck all your allocs/free, rigorously
- save your image before test
- be sure epicea is working
Finally, I would say the only way to prevent your image to crash is to not execute FFI calls inside it. To do this, you can always use ImageWorker (
http://smalltalkhub.com/#!/~PharoExtras/ImageWorker) to actually execute your tests in a different execution. Yes is slow, but it will be safer.
Esteban