You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
The following code invokes the NativeLibrary sample shared library in Python on Windows using CFFI. It exits with code -1073741819. Note that "checks pass" is printed and the crash happens on shutdown / library unloading or similar.
Simply copy this into a test.py file in the project folder and run python test.py. Check the exit code with echo %errorlevel% if using command prompt/Anaconda prompt.
When running this under WinDbg I can see that the crash happens here:
I reported this as well at the CFFI issue tracker as it may be a bug on their end, even though it's quite odd as I've used CFFI before for other things and the example couldn't get any more trivial.
Also reproes if one adds a FreeLibrary call to the SharedLibrary test in the repo.
Likely because we have a FlsAlloc call in the runtime without a matching FlsFree. We'll need to shut down the runtime before the library is unloaded, otherwise we leave a dangling callback pointer. This probably includes things like shutting down the finalizer thread and probably a bunch of other things.
Activity
letmaik commentedon Feb 11, 2019
Interestingly I don't get the crash when using
ctypes:letmaik commentedon Feb 11, 2019
I reported this as well at the CFFI issue tracker as it may be a bug on their end, even though it's quite odd as I've used CFFI before for other things and the example couldn't get any more trivial.
MichalStrehovsky commentedon Feb 12, 2019
Also reproes if one adds a
FreeLibrarycall to theSharedLibrarytest in the repo.Likely because we have a
FlsAlloccall in the runtime without a matchingFlsFree. We'll need to shut down the runtime before the library is unloaded, otherwise we leave a dangling callback pointer. This probably includes things like shutting down the finalizer thread and probably a bunch of other things.Pin CoreRT OS modules in memory
letmaik commentedon Feb 14, 2019
Verified, all fine now. Thanks for the quick fix :)