Skip to content

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

Closed

Description

@shadchin

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

Activity

  1. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Dec 13, 2024
  2. added
    3.12only security fixes
    3.13only security fixes
    on Dec 13, 2024
  3. mgorny commented on Jan 2, 2025

    @mgorny
    Contributor

    Just hit this in the wild with pikepdf.

  4. added a commit that references this issue on Jan 3, 2025
  5. added 2 commits that reference this issue on Jan 3, 2025
  6. changed the title [-]Segmentation fault in pydebug mode[/-] [+]Crash in `Objects/unicodeobject.c::_copy_characters` when there is nothing to copy[/+] on Jan 3, 2025
  7. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    3.14bugs and security fixes
    and removed on Jan 3, 2025
  8. 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)[/+] on Jan 3, 2025
  9. picnixz commented on Jan 3, 2025

    @picnixz
    Member

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

  10. added 2 commits that reference this issue on Jan 3, 2025
  11. Eclips4 commented on Jan 3, 2025

    @Eclips4
    Member

    Thank you @shadchin for reporting and fixing this!

  12. added a commit that references this issue on Jan 4, 2025
  13. added a commit that references this issue on Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13only security fixes3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions