bpo-34543: Fix SystemErrors and segfaults with uninitialized Structs#14777
bpo-34543: Fix SystemErrors and segfaults with uninitialized Structs#14777ZackerySpytz wants to merge 1 commit into
Conversation
|
This patch uses a |
Sorry, something went wrong.
There was a problem hiding this comment.
In order to test the changes, I attempted to recreate the segfault in the most current commit to cpython master and in your remote branch bpo-34543-struct-crashes.
For the version used for testing the latest cpython, I used the function test_segfault() on the second round in order to perform the test multiple times consecutively. The issue tracker reported similar problems with replication. The first round caused a TypeError, and the second one caused the segfault.
After performing test_segfault() 3 times consecutively in the PR's branch, ValueError was raised each time with the same message. As far as I can tell, this resolves the segfault issue and provides a significant improvement by raising a consistent exception each time.
Nicely done @ZackerySpytz, approved.
Sorry, something went wrong.
|
Also, this should probably be backported to previous versions. The code sample I used was the same from 3.7 with no noticeable difference in behavior prior to this patch: https://bugs.python.org/msg324498. |
Sorry, something went wrong.
|
Wouldn't it make more sense to ensure that the invalid objects can't be created in the first place, by doing the initialization in |
Sorry, something went wrong.



https://bugs.python.org/issue34543