8000 Crash in `Objects/unicodeobject.c::_copy_characters` when there is nothing to copy (DEBUG build only) · Issue #127903 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Crash in Objects/unicodeobject.c::_copy_characters when there is nothing to copy (DEBUG build only) #127903

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

Closed
shadchin opened this issue Dec 13, 2024 · 3 comments
Labels
3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@shadchin
Copy link
Contributor
shadchin commented Dec 13, 2024

Crash report

What happened?

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 there

Fix in #127876

CPython versions tested on:

3.12, 3.13

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.13.1+ (heads/3.13:d51c1444e3, Dec 12 2024, 19:36:26) [GCC 9.4.0]

Linked PRs

@shadchin shadchin added the type-crash A hard crash of the interpreter, possibly with a core dump label Dec 13, 2024
@Eclips4 Eclips4 added 3.12 only security fixes 3.13 bugs and security fixes labels Dec 13, 2024
@picnixz picnixz added the extension-modules C modules in the Modules dir label 8000 Dec 13, 2024
@mgorny
Copy link
Contributor
mgorny commented Jan 2, 2025

Just hit this in the wild with pikepdf.

Eclips4 pushed a commit that referenced this issue Jan 3, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 3, 2025
…icodeobject::_copy_characters`` (pythonGH-127876)

(cherry picked from commit 46cb634)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 3, 2025
…icodeobject::_copy_characters`` (pythonGH-127876)

(cherry picked from commit 46cb634)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
@picnixz picnixz changed the title Segmentation fault in pydebug mode Crash in Objects/unicodeobject.c::_copy_characters when there is nothing to copy Jan 3, 2025
@picnixz picnixz added interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.14 bugs and security fixes and removed extension-modules C modules in the Modules dir labels Jan 3, 2025
@picnixz picnixz changed the title Crash in Objects/unicodeobject.c::_copy_characters when there is nothing to copy Crash in Objects/unicodeobject.c::_copy_characters when there is nothing to copy (DEBUG build only) Jan 3, 2025
@picnixz
Copy link
Member
picnixz commented Jan 3, 2025

Even if main was said to work well, we also fixed the assertion as it could have been by chance that this worked.

Eclips4 pushed a commit that referenced this issue Jan 3, 2025
…nicodeobject::_copy_characters` (GH-127876) (#128458)

gh-127903: Fix a crash on debug builds when calling `Objects/unicodeobject::_copy_characters`` (GH-127876)
(cherry picked from commit 46cb634)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
Eclips4 pushed a commit that referenced this issue Jan 3, 2025
…nicodeobject::_copy_characters` (GH-127876) (#128459)

gh-127903: Fix a crash on debug builds when calling `Objects/unicodeobject::_copy_characters`` (GH-127876)
(cherry picked from commit 46cb634)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
@Eclips4
Copy link
Member
Eclips4 commented Jan 3, 2025

Thank you @shadchin for reporting and fixing this!

@Eclips4 Eclips4 closed this as completed Jan 3, 2025
WolframAlph pushed a commit to WolframAlph/cpython that referenced this issue Jan 4, 2025
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

4 participants
0