finaliser of a ForeignPtr called while references from unreachable threads exist
|Reported by:||agl||Owned by:|
|Type of failure:||Incorrect result at runtime||Test Case:|
|Related Tickets:||Differential Rev(s):|
I believe that I've managed to distill a crash which has been driving me crazy for a few days into a short enough test case (22 lines) that it might be useful.
In short: the threaded RTS will call the finialiser of a ForeignPtr while an exception handler still holds a reference to it:
% ghc -make fptest.hs cbits.c -threaded [1 of 1] Compiling Main ( fptest.hs, fptest.o ) Linking fptest ... % ./fptest New object getting created: 66f010 Finaliser getting called for 66f010 Use called for 66f010
I'm hoping that this is useful to someone who knows the RTS.
Change History (13)
comment:1 Changed 9 years ago by
|Summary:||GHC threaded RTS will call the finaliser of a ForeignPtr while references still exist → finaliser of a ForeignPtr called while references from unreachable threads exist|
comment:4 Changed 7 years ago by
|Architecture:||x86_64 (amd64) → Unknown/Multiple|
|Operating System:||Linux → Unknown/Multiple|
|Type of failure:||None/Unknown → Incorrect result at runtime|