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
FFI 0.13.0 no longer ignores invalid parameters #788
Comments
@joshcooper Thank you for your great analysis! Obviously the change of |
ffi-1.13.0 switched FFI::Library::LIBC from msvcrt.dll to ucrtbase.dll as part of ffi#779 in commit c674683 . As described in ffi#788 ucrtbase.dll has behavioural changes which shouldn't be released as part of a minor version change of ffi. While the change makes sense for mswin, we revert it for mingw. Fixes ffi#788
Thanks @larskanis, much appreciated! |
The ffi 0.13.0 release on Windows switched to using the universal C runtime instead of msvcrt in https://github.com/ffi/ffi/pull/779/files#diff-db0e38803c251431bdf21ae8936ac3f6L132-R132. Previously, msvcrt ignored invalid parameters, but ucrtbase will abort by default
This can be demonstrated using:
Note that "Done" is never printed:
This isn't a problem with FFI, but the ruby process aborts with
0xc0000409
without any output, which makes debugging the problem difficult. It'd be great to mention the behavior change in the release notes, and perhaps describe how to install an error handler so that the application can decide how to handle the exception: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler?view=vs-2019.The text was updated successfully, but these errors were encountered: