FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-127705: better double free message. by markshannon · Pull Request #130785 · python/cpython · GitHub

/ cpython Public

GH-127705: better double free message. - #130785

Merged
markshannon merged 3 commits into
python:mainfrom
faster-cpython:better-double-free-message
Mar 5, 2025
Merged

GH-127705: better double free message.#130785
markshannon merged 3 commits into
python:mainfrom
faster-cpython:better-double-free-message

Conversation

markshannon commented Mar 3, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Adds a Py_STACKREF_CLOSE_DEBUG #definable option to track closed stack refs. This gives us precise locations for the the initial close and subsequent use or close.

For example, there is a use-after-free in BINARY_OP_INPLACE_ADD_UNICODE (which this PR does not fix)

On main the error message is this:

Fatal Python error: _Py_stackref_record_borrow:
   Invalid StackRef with ID 15618638

With this PR it looks like this:

 Fatal Python error: _Py_stackref_record_borrow: 
   Borrow of closed ref ID 15609203 at Python/generated_cases.c.h:59.
   Referred to instance of str at 0x55a2b6c5ff10. 
   Closed at Python/generated_cases.c.h:344

(I've reformatted the messages for clarity, but the content is unchanged):

markshannon merged commit 78d50e9 into python:main Mar 5, 2025
markshannon deleted the better-double-free-message branch March 5, 2025 14:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL