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 }}
Repository navigation
_align_ = 0 segfaults when used with empty filed list (_fields_ = []) #132673
@ZeroIntensity would you like to create a PR for that? It will be a different one completely (C vs Python implementation). Since I can't reproduce - it would be hard for me to test this.
Activity
sobolevn commentedon Apr 18, 2025
This is a really funny bug, thank you :)
I found what's wrong.
pythongh-132673: Fix `ctypes.Structure` with `_align_=0`
gh-132673: Fix `ctypes.Structure` with `_align_=0` (#132676)
sobolevn commentedon Apr 18, 2025
I can't reproduce this failure on the latest
3.13.Try this:
git checkout 3.13./configure --with-pydebug && make./pythonFor me this happens:
So, looks like it was fixed already on 3.13 and I fixed it on 3.14
karas84 commentedon Apr 18, 2025
Just tried on Linux:
Note that I'm using GCC while you are using CLANG, maybe that's the difference (or maybe win vs linux)?
ZeroIntensity commentedon Apr 18, 2025
I can reproduce this on a 3.13.3 release build. We need a 3.13 backport.
sobolevn commentedon Apr 18, 2025
@ZeroIntensity would you like to create a PR for that? It will be a different one completely (C vs Python implementation). Since I can't reproduce - it would be hard for me to test this.
[3.13] gh-132673: Fix a crash with zero-alignment in `ctypes.Structur…
ZeroIntensity commentedon Apr 19, 2025
Thanks @karas84 for the report!
karas84 commentedon Apr 20, 2025
My pleasure!