-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
GH-127903: Fix a crash on DEBUG builds when calling _copy_characters
#127876
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
Conversation
Hi @shadchin! 🙂 For some reason, it doesn't segfault on the current main, but it does on 3.13+ and 3.12+. |
Done |
Why not add a test? |
Adding a test would be good, but I'm not sure where it should be placed. In |
Misc/NEWS.d/next/Core_and_Builtins/2024-12-13-14-17-24.gh-issue-127903.vemHSl.rst
Outdated
Show resolved
Hide resolved
test_str.py? |
3b965ef
to
8a32548
Compare
@shadchin, please avoid force-pushing (squashing, etc) if your PR is marked as ready for review. |
Misc/NEWS.d/next/Core_and_Builtins/2024-12-13-14-17-24.gh-issue-127903.vemHSl.rst
Outdated
Show resolved
Hide resolved
_copy_characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this, we can also hunt for cases when we pass to = NULL
and how many != 0
and it will be easier to debug in the future.
LGTM.
…icodeobject::_copy_characters`` (pythonGH-127876) (cherry picked from commit 46cb634) Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
…icodeobject::_copy_characters`` (pythonGH-127876) (cherry picked from commit 46cb634) Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
GH-128458 is a backport of this pull request to the 3.13 branch. |
GH-128459 is a backport of this pull request to the 3.12 branch. |
GH-128458 is a backport of this pull request to the 3.13 branch. |
GH-128459 is a backport of this pull request to the 3.12 branch. |
…icodeobject::_copy_characters`` (python#127876)
…icodeobject::_copy_characters`` (python#127876)
Reproduce on Python 3.12.8+ or 3.13.1+,
main
work fine, but there is a problem there too:./configure --with-pydebug make ./python --version Python 3.13.1+ ./python -c 'import datetime as dt; dt.datetime(2013, 11, 10, 14, 20, 59).strftime("%z")' Segmentation fault
No need to check
to
if we don't write thereObjects/unicodeobject.c::_copy_characters
when there is nothing to copy (DEBUG build only) #127903