GH-127903: Fix a crash on DEBUG builds when calling _copy_characters#127876
GH-127903: Fix a crash on DEBUG builds when calling _copy_characters#127876Eclips4 merged 7 commits intopython:mainfrom
_copy_characters#127876Conversation
|
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
picnixz
left a comment
There was a problem hiding this comment.
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+,
mainwork 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 faultNo need to check
toif we don't write thereObjects/unicodeobject.c::_copy_characterswhen there is nothing to copy (DEBUG build only) #127903