Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-71810: Fix _PyLong_AsByteArray() undefined behavior#138873

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 2 commits intopython:mainfromvstinner:int_to_bytes_undef
Sep 14, 2025

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commentedSep 13, 2025
edited by bedevere-appbot
Loading

Don't read p[-1] when p is an empty string: when n==0.

Don't read p[-1] when p is an empty string: when n==0.
@vstinner
Copy link
MemberAuthor

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. 👍

@skirpichevskirpichev added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsSep 14, 2025
@vstinnervstinner merged commit8b5ce31 intopython:mainSep 14, 2025
47 checks passed
@vstinnervstinner deleted the int_to_bytes_undef branchSeptember 14, 2025 09:25
@miss-islington-app
Copy link

Thanks@vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 14, 2025
…H-138873)Don't read p[-1] when p is an empty string: when n==0.(cherry picked from commit8b5ce31)Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 14, 2025
…H-138873)Don't read p[-1] when p is an empty string: when n==0.(cherry picked from commit8b5ce31)Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

GH-138883 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelSep 14, 2025
@bedevere-app
Copy link

GH-138884 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelSep 14, 2025
vstinner added a commit that referenced this pull requestSep 14, 2025
) (#138884)gh-71810: Fix _PyLong_AsByteArray() undefined behavior (GH-138873)Don't read p[-1] when p is an empty string: when n==0.(cherry picked from commit8b5ce31)Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotARM64 MacOS M1 Refleaks NoGIL 3.13 (tier-2) has failed when building commita902058.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1396/builds/1590) and take a look at the build logs.
  4. Check if the failure is related to this commit (a902058) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1396/builds/1590

Failed tests:

  • test.test_multiprocessing_forkserver.test_processes

Failed subtests:

  • test_repr_rlock - test.test_multiprocessing_forkserver.test_processes.WithProcessesTestLock.test_repr_rlock
  • test_repr_rlock - test.test_multiprocessing_spawn.test_processes.WithProcessesTestLock.test_repr_rlock

Test leaking resources:

  • test_processes: memory blocks

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/Users/buildbot/buildarea/3.13.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/test/_test_multiprocessing.py", line1492, intest_repr_rlockself.assertEqual('<RLock(SomeOtherThread, nonzero)>',repr(lock))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:'<RLock(SomeOtherThread, nonzero)>' != '<RLock(None, 0)>'- <RLock(SomeOtherThread, nonzero)>+ <RLock(None, 0)>

vstinner added a commit that referenced this pull requestOct 7, 2025
) (#138883)gh-71810: Fix _PyLong_AsByteArray() undefined behavior (GH-138873)Don't read p[-1] when p is an empty string: when n==0.(cherry picked from commit8b5ce31)Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@skirpichevskirpichevskirpichev approved these changes

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@vstinner@bedevere-bot@skirpichev@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp