-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On some versions of Windows, importing the uchronia module crashes the python process. #1
Comments
The callback is not immediately called, I suspect? The crash occurs when registering the callback only? Do you get a crash on the same Win11 platform if you make a minimal example: just a Python script, which declares a similar callback with |
Yes it is crashing when registering. |
Added a minimal repro, which fails to reproduce the issue so far. https://github.com/jmp75/py-cffi-callback-repro |
I managed to get a stack trace. It does look like the call to
It may be time to load the libraries with debug symbols, see if we can peer in more details. While simplified on the edges, the minimal example is structurally very similar. This is very puzzling why it runs without issue. |
The R package (which uses GNU gcc to compile its C wrapper code) can still register its callback (and the function compiled with Microsoft vcpp 2019 toolchain) without any issue, on the same machine and the same DLL where the python wrapper fails to do so. Mystifying.
// [[Rcpp::export]]
void RegisterExceptionCallback_Rcpp(XPtr<opaque_pointer_handle> callback)
{
RegisterExceptionCallback(callback->get());
} |
Reported by my colleague Seline.
Repro
On Windows 11 machines (and at least windows server 2022), importing the python module
uchronia
crashes the python process and it exists. I've not observed first hand but Seline mentioned seeing a message "Process finished with exit code -1073741819 (0xC0000005)".Stepping in debug model I can get as far as the call to register a callback function:
[
uchronia_so.RegisterExceptionCallback(_exception_callback_uchronia)
permalink]uchronia-time-series/bindings/python/uchronia/uchronia/wrap/ffi_interop.py
Line 89 in 959a81f
where the callback is declared using an "old style" syntax. Been a while.
Resources
There is a Warning section that Callbacks are provided for the ABI mode or for backward compatibility. Given we are using the ABI mode, not sure whether we can migrate the new-style.
The text was updated successfully, but these errors were encountered: