Repository navigation
contrib.host.python: restore nested map context - #3458
Closed
adilalperenciftci wants to merge 1 commit into
Closed
adilalperenciftci wants to merge 1 commit into
adilalperenciftci wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Preserve the previous shared-map token around nested run_sandboxed_with_map calls and restore it when the inner call returns. Reject an over-depth entry before activating or freezing the new map context. Add an embedded CPython regression covering the inner map, restored outer map, and final token cleanup. Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>
adilalperenciftci
force-pushed
the
fix/python-host-map-context
branch
from
October 30, 2026 06:05
744fa95 to
c1066cc
Compare
nicolas-maman
approved these changes
Oct 30, 2026
Collaborator
|
Thanks @adilalperenciftci! This landed in #3474, which batched nine of your PRs and merged on 2026-10-30 ( On top of your commit, #3474 makes |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I reproduced a nested
python.run_sandboxed_with_mapcall replacing the outer shared-map token. The inner return reset the token to zero, so the outer Python frame could no longer read or write its own map. The depth-limit return also occurred after activating the new token.This is independent of the checker-stack work in #3334; its current head leaves the shared-map token lifecycle unchanged.
Verification
run=0 inner=ok outer=(null) cleared=0run=0 inner=ok outer=outer cleared=0make contrib MODULES=python: 1 built, 0 skippedmake contrib-host-check: Python 5 passing; 0 host-check failuresmake check-changelogmake check-testsmake check-docsmake test: 634 passed, 0 failedSigned-off-by: Adil Alperen Çiftci adilalperenciftci@users.noreply.github.com