GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects by zhangyangyu · Pull Request #188 · python/cpython

Conversation

@zhangyangyu

@zhangyangyu zhangyangyu commented Feb 20, 2017

Copy link
Copy Markdown
Member

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@zhangyangyu
bpo-29347: Fix possibly dereferencing undefined pointers when creatin…
7e67474
…g weakref objects (python#128)
@zhangyangyu zhangyangyu added the cherry-pick for 3.5 label Feb 20, 2017
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 20, 2017
@zhangyangyu zhangyangyu mentioned this pull request Feb 20, 2017
bpo-29347: Fix possibly dereferencing undefined pointers when creating weakref objects #128
Merged
@codecov-io

codecov-io commented Feb 20, 2017

Copy link
Copy Markdown

Codecov Report

Merging #188 into 3.5 will decrease coverage by -0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              3.5     #188      +/-   ##
==========================================
- Coverage   82.41%   82.41%   -0.01%     
==========================================
  Files        1404     1404              
  Lines      341433   341433              
==========================================
- Hits       281402   281396       -6     
- Misses      60031    60037       +6
Impacted Files Coverage Δ
Lib/sysconfig.py 47.02% <ø> (-0.55%) ❌
Lib/test/test_weakset.py 96.45% <ø> (-0.28%) ❌
Lib/test/test_random.py 98.2% <ø> (-0.23%) ❌
Lib/test/test_buffer.py 96.53% <ø> (-0.18%) ❌
Lib/test/test_asyncio/test_tasks.py 97.1% <ø> (-0.07%) ❌
Lib/test/test_io.py 96.95% <ø> (-0.04%) ❌
Lib/plistlib.py 90.95% <ø> (+0.17%) ✅
Lib/threading.py 82.26% <ø> (+0.52%) ✅
Lib/test/test_select.py 89.23% <ø> (+1.53%) ✅

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 314a86b...7e67474. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

methane
methane approved these changes Feb 20, 2017
View reviewed changes
@zhangyangyu
zhangyangyu merged commit 7c95a94 into python:3.5 Feb 20, 2017
@zhangyangyu
zhangyangyu deleted the weakref-fix-3.5 branch February 20, 2017 06:33
akruis added a commit to akruis/cpython that referenced this pull request Dec 31, 2018
@akruis
Stackless issue python#188: enable soft switching for sub-iterators a…
533b9e8
…nd coroutines

Improve the finalisation of a soft switched YIELD_FROM instruction.
akruis added a commit to akruis/cpython that referenced this pull request Dec 31, 2018
@akruis
Stackless issue python#188: stackless calls of generator.send() relat…
6ab0ae3
…ed methods

Enable stackless calls of the following methods:
- generator.send() (generator.__next__() was already stackless);
- coroutine.send();
- coroutine_wrapper.__next__() and coroutine_wrapper.send();
- async_generator_asend.__next__() and async_generator_asend.send().

This change needs more tests.
akruis added a commit to akruis/cpython that referenced this pull request Jan 1, 2019
@akruis
Stackless issue python#188: fixes, tests and changelog enty
a248c39
Fix a error handling in the YIELD_FROM finalisation code.
Add tests and changelog.txt
akruis pushed a commit to akruis/cpython that referenced this pull request Jan 12, 2019
Anselm Kruis
Stackless issue python#188: enable soft switching for sub-iterators, …
bb9dc7a
…(async) generators and coroutines

Enable soft switching for iterators/coroutines called by "yield from".
Improve the finalisation of a soft switched YIELD_FROM instruction.
Enable stackless calls of the following methods:
- generator.send() (generator.__next__() was already stackless);
- coroutine.send();
- coroutine_wrapper.__next__() and coroutine_wrapper.send();
- async_generator_asend.__next__() and async_generator_asend.send().
akruis added a commit to akruis/cpython that referenced this pull request Apr 20, 2021
@akruis
Stackless issue python#235: Fix an assertion failure caused by python…
9e4c0cf
…#188

This commit fixes an assert statement, that could fail since python#188.
No functional change.

(cherry picked from commit 5595eec)
akruis added a commit to akruis/cpython that referenced this pull request May 27, 2021
@akruis
Stackless issue python#235: Fix an assertion failure caused by python…
5595eec
…#188

This commit fixes an assert statement, that could fail since python#188.
No functional change.
SonicField added a commit to SonicField/cpython that referenced this pull request Apr 27, 2026
@SonicField
docs: phase4-hir-burndown-spec — operational 100%-state falsifier + §…
9958ef1
…4.A.5 probe

Closes two spec gaps surfaced by pythia python#188 2026-04-27:

(a) §6 python#5 'PhxHirBuilderState 100% of state' acceptance criterion was
not mechanically testable — '100%' undefined, no falsifier. Now adds
explicit grep-rule against builder.cpp filtering out accepted access
patterns (state_.<field>, _cpp/_c bridge defs/calls, comments). Any
other hit = unmigrated C++ direct member access = fail acceptance.

(b) §4.A.5 inserted as a class-state extraction PROBE between Phase
4.A and 4.B. ~30-50 LOC, 1 commit. Pilot-5 dry-run on the simplest
Class A field (kwnames_) to surface silent-drift / mutator-enumeration /
JIT_DCHECK-equality risks BEFORE Phase 4.C burns its 33-53 commits on
the harder containers. §5.A close gate is LOC-trajectory only and
won't catch class-state failure modes; §4.A.5 fills that gap.

Authored 2026-04-27 per pythia python#188 + supervisor 2026-04-27T09:36:01Z.
'A rehearsal in an empty theater predicts only that the lights work.'
SonicField added a commit to SonicField/cpython that referenced this pull request Apr 27, 2026
@SonicField
hir/builder: §4.A.5 probe — migrate kwnames_ to PhxHirBuilderState
c2f255e
Pythia python#188 class-state-extraction PROBE (supervisor 2026-04-27T09:36:01Z
authored §4.A.5; supervisor 09:45:06Z accepted in-session execution;
theologian patch-shape APPROVE 09:49:24Z). Pilot-5 dry-run on the
simplest Class A field — kwnames_, the most-recent KW_NAMES Register*
slot — to surface class-state extraction failure modes (silent drift,
mutator-site enumeration miss, JIT_DCHECK equality drift) BEFORE
Phase 4.C burns 33-53 commits on harder containers.

Migration is single-commit + same-instant deletion:

  Python/jit/hir/builder.h
    Delete the C++ field 'Register* kwnames_{nullptr};'. Update the
    Class A mirror comment (line 693-697) to reflect kwnames_ removal
    + document the §4.A.5 probe entry.

  Python/jit/hir/builder.cpp
    builder.cpp:2538 — sole C++ direct read site rewritten to
    state_.kwnames == nullptr (post-translate KW_NAMES-stash invariant).
    builder.cpp:2928-2935 — extern "C" hir_builder_get/set_kwnames
    bridge bodies redirected to state_.kwnames; the static_cast<void*>
    / static_cast<Register*> drop because state_.kwnames is already
    void* — no implicit conversion.

Mutator-site enumeration: ALL writes go through hir_builder_set_kwnames
(2 callers in builder_emit_c.c:968 + 3878); ALL reads go through
hir_builder_get_kwnames (3 callers in builder_emit_c.c:962 + 3857) +
the 1 direct-read C++ site at builder.cpp:2538. Zero C++ direct write
sites outside the bridge body — audited.

JIT_DCHECK equality (spec §4.A.5 step 3) is moot in the single-commit
migration: the C++ field is deleted in the same commit that redirects
the bridges, so no parallel state can drift. Theologian 09:49:24Z noted
the spec wording was overconservative for the single-commit case.

Falsifier (§6 python#5 grep-rule) result post-migration:
  grep -nE '\\bkwnames_\\b' Python/jit/hir/builder.cpp
  → ZERO HITS. Field name is no longer anywhere in the codebase.

Build + ABBA: scripts/build_phoenix.sh --clean PASS (testkeeper
09:55:03Z). 4-bench ABBA GEO-MEAN 1.28x (matches BLME batch 2 baseline);
gen_simple 0.75x is pre-existing (BLME batch 2 0.74x; push-59 baseline
0.70x; same-session stable, structural causal absence — kwnames_
touches KW-arg dispatch not generator FRAME ops). No >5% drop trigger;
well above 1.0x floor.

Acceptance per spec §4.A.5: ABBA clean + zero functional regressions =
probe PASS = Class A delete approach VALIDATED for Pilot 5 across the
remaining Class A fields (code_ 46 sites, current_func_ ~30,
preloader_ 28, func_, static_method_stack_).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@methane methane methane approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@zhangyangyu @codecov-io @methane @the-knights-who-say-ni
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.