
20 Oct
2010
20 Oct
'10
6:44 p.m.
OK, never mind, I found the problem in my C code. some uninitialized variables - mostly they were 0, but sometimes not: I guess when I got mallocForeignPtrBytes that were just freed by the garbage collector. Although the program does a ton of allocations, most start with memcpy of something that the program computed earlier, expect for a handfull of root nodes. But these were allocated early, when there was little garbage, so I got most of them in their zeroed-out initial state, and that's why the error did not show. (At least that's my guess.) This restores my faith in ghc, ffi, and library writers - and shows how much I unlearned C programming (which I guess is generally a good thing - except when you program C). J.W.