-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
misc_tests fails on 1.7.18 under Windows #860
Comments
Similar failure was reported with |
This happens without valgrind as well, for any libc implementation that is poisoning the memory that has been freed to make exploitation of use-after-free infeasible. |
Use-after-free is implementation specific behaviour and should not be relied upon. How well this works will depend on star alignment and mood of the magic smoke in the CPU. (ie. where in the allocated chunk the ptr actually exists and what malloc/free actually does internally) I don't believe it's feasible to salvage it. And you can't just use realloc() on invalid pointer either. The test should be reverted. FWIW, the test is failing in a VM on openSUSE Leap 15.5 but not with Leap 15.5 in a container with kernel from Tumbleweed. Why? Because undefined behaviour. Finally, this setting of pointer internally to 0 inside of a deleted struct to protect against double-free is questionable because you pass a pointer (not a pointer to pointer) in the delete function and the original one cannot be set to 0. This is actually what probably matters most. Modifying the test a little to delete all allocations and removing the use-after-free bits,
is a double-free and crash. If the API was |
I think it would be a better choice to revert this test. |
This reverts commit 5b502cd. Related to DaveGamble#860
The Meson WrapDB project runs cJSON tests with Windows and VisualStudio. On release 1.7.18,
misc_tests
crashes withSIGinvalid
only on the Windows target (mesonbuild/wrapdb#1520). I would guess it's related to this commit that adds an intentional use-after-free.The text was updated successfully, but these errors were encountered: