Skip to content

Remove memory sweeps through explicit Perl owner slots (#2043) - #1938

Open
fglock wants to merge 1730 commits into
masterfrom
wip/alias-cell-ownership-20261030-185849
Open

fglock wants to merge 1730 commits into
masterfrom
wip/alias-cell-ownership-20261030-185849

Conversation

@fglock

@fglock fglock commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Goal

Remove reachability-based lifecycle decisions from Perl ownership and destruction. The active delivery handoff is issue #2043; #1649 is the historical origin.

Changes

  • Remove reachability walker/root-query state and sweep hooks from Perl lifetime decisions.
  • Balance temporary owners across exception, callback, return, and alias paths; retain imported CVs through namespace cleanup.
  • Preserve broad captures for dynamic eval STRING while releasing unrelated file lexicals for constant source.
  • Release DBI/DBIx handles after failed prepare, do, or connect paths.
  • Mark deferred zero-count lifecycle tokens explicitly, so they cannot decrement a counted owner acquired after the token was queued.
  • Add permanent regressions for imported CV lifetime, eval capture/release, failed DBI operations, DBIx Storage cleanup, interpreter alias frames, and Template::Stash return ownership.
  • Integrate merged PR fix(netssleay): bound RSA key generation sizes #2171 and require RSA generation to use 2048–8192 bits in both Net::SSLeay and Crypt::OpenSSL::RSA. The project RSA round-trip and padding tests remain active at 2048 bits; sub-2048 requests are rejected. The 1024-bit exception existed only to keep a project-authored test fast, not because upstream Net::SSLeay required it.
  • Parse Net::SSLeay key sizes through BigDecimal and reject invalid values before they reach JCE, returning Perl undef for invalid requests.

Validation

  • nice -n 19 timeout 1800 make passed on source commit 1d3e96f2a6 in 8m11 (/tmp/issue2043-1d3e96f2a6-make.log). The PR head ee827a2ad5 adds only checkpoint documentation.
  • nice -n 19 timeout 600 make check-links passed on ee827a2ad5 with 0 link errors (/tmp/issue2043-1d3e96f2a6-check-links.log).
  • Focused JVM and interpreter tests passed: netssleay_phase5_6.t 29/29, netssleay_rsa_key_size_bounds.t 10/10, crypt_openssl_rsa_key_size_policy.t 18/18, and crypt_openssl_rsa_pkcs1_padding.t 1/1. Logs are under /tmp/issue2043-*-1d3.log and /tmp/issue2043-*-9b9.log.
  • System Perl ran the four changed tests: adapter-specific tests skipped as designed and the padding test passed (/tmp/issue2043-rsa-tests-perl-final3.log).
  • Before the fix, the same bounds tests failed on the previous runtime: Net::SSLeay rejected 2/9 assertions and Crypt::OpenSSL::RSA rejected 10/18 (/tmp/issue2043-rsa-bounds-parent.log, /tmp/issue2043-rsa-policy-parent.log).
  • The exact eight-target CPAN run passed PPR, DateTime, Image::ExifTool, Excel::Writer::XLSX, and Template. Catalyst, Mojolicious, and DBIx failures are classified in [Parser] Parse MooseX role block calls as function calls #2168, [CPAN gate] Prevent host fork exhaustion in Mojolicious acceptance #2169, and [DBIx] Preserve caller source locations through nested transaction errors #2170.

Hosted checks passed on PR head ee827a2ad5: CodeQL, Ubuntu, Windows, and dependency submissions are green. The previous CodeQL finding no longer appears in the PR check after the parser conversion. The PR remains open and has no recorded human review decision.

@fglock
fglock force-pushed the wip/alias-cell-ownership-20261030-185849 branch from 95b7c0c to 36bd8dc Compare November 6, 2026 18:42
fglock added a commit that referenced this pull request Nov 6, 2026
Refresh the current ownership checkpoint with the package-rooted blessed
aggregate finding, parent regression evidence, focused result, and next audit.
Record the pending post-commit full no-sweeps gate and current PR #1938 state.

Generated with Codex (https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
fglock added a commit that referenced this pull request Nov 11, 2026
Record that the implementation and checkpoint are now on PR #1938's actual
head branch, and defer its next CI poll until the six-minute interval passes.

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
@fglock
fglock force-pushed the wip/alias-cell-ownership-20261030-185849 branch from cb13674 to cdc75a1 Compare November 11, 2026 18:57
fglock added a commit that referenced this pull request Nov 11, 2026
Refresh the current ownership checkpoint with the package-rooted blessed
aggregate finding, parent regression evidence, focused result, and next audit.
Record the pending post-commit full no-sweeps gate and current PR #1938 state.

Generated with Codex (https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
fglock added a commit that referenced this pull request Nov 11, 2026
Record that the implementation and checkpoint are now on PR #1938's actual
head branch, and defer its next CI poll until the six-minute interval passes.

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
@fglock
fglock force-pushed the wip/alias-cell-ownership-20261030-185849 branch from cdc75a1 to 4af1bde Compare November 11, 2026 19:22
fglock added a commit that referenced this pull request Nov 11, 2026
Refresh the current ownership checkpoint with the package-rooted blessed
aggregate finding, parent regression evidence, focused result, and next audit.
Record the pending post-commit full no-sweeps gate and current PR #1938 state.

Generated with Codex (https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
fglock added a commit that referenced this pull request Nov 11, 2026
Record that the implementation and checkpoint are now on PR #1938's actual
head branch, and defer its next CI poll until the six-minute interval passes.

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
@fglock fglock changed the title WIP: continue explicit owner-slot migration (#1649) WIP: remove memory sweeps through explicit owners (#2043) Nov 12, 2026
@fglock fglock changed the title WIP: remove memory sweeps through explicit owners (#2043) Remove memory sweeps through explicit Perl owner slots (#2043) Nov 15, 2026
@fglock
fglock marked this pull request as ready for review November 15, 2026 02:19
fglock and others added 15 commits November 23, 2026 02:22
Remove the deleted reachability-scan flag from child runtime teardown and
update the comment to describe owner-slot cleanup.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
Apply the exact owner-slot final-release path to untracked referents with
registered weak observers, so compile-time CVs release fieldhash keys
without a reachability sweep.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
Record noncapturing anonymous CVs as owners of their containing optrees on both
backends. Transfer interpreter template owners with the compiled pad tree and
release them with that owner tree. Clear stale weak observers for explicitly
untracked referents so compile-time callback keys release after BEGIN. Add a
Function::Parameters installer regression.

Addresses issue #2043.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
Update the delivery checkpoint with the merge-specific CODE template owner
regression, full make result, focused backend checks, and remaining CPAN gate.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Record per-target results on the full-master candidate and classify Catalyst,
DBIx, and Mojolicious failures against current-master and host evidence.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Preserve the live PR head while integrating the validated current-master
owner-ledger candidate and its regression tests. Existing tests remain
unchanged; generated CPAN reports match current master.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Avoid recursively enumerating nested live aggregates during watcher cleanup.
Add a regression for a direct stash-reference slot and remove Java tests
that depended on retired reachability-sweep internals.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Update the current owner-ledger checkpoint with the local PR reconciliation,
removed stale internal API tests, watcher regression, and exact-source gate.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record the immutable reconciled candidate's CPAN acceptance outcomes and
classify the remaining baseline failures.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Use the existing concurrent untracked-reference owner index when releasing
strong owner slots instead of copying every owner identity into a new set.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record the exact reconciled candidate's acceptance results and allocation evidence.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record the exact reconciled candidate's acceptance results and allocation evidence.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record queue, buffer growth, append, and drain counters from the paired aggregate cleanup workload.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record queue, buffer growth, append, and drain counters from the paired aggregate cleanup workload.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record queue, buffer growth, append, and drain counters from the paired aggregate cleanup workload.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
fglock added a commit that referenced this pull request Nov 24, 2026
Refresh the current ownership checkpoint with the package-rooted blessed
aggregate finding, parent regression evidence, focused result, and next audit.
Record the pending post-commit full no-sweeps gate and current PR #1938 state.

Generated with Codex (https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
fglock and others added 3 commits November 24, 2026 09:47
Remove the unused Test::Exception import from the schema shutdown regression.
CI runs this test without that optional module installed, so the import
prevented its DBIC_CLASS_TEST_ROOT skip from being reached.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record the published PR head, the fixed CI dependency issue, current hosted
verification, CodeQL baseline finding, and the three CPAN follow-up issues.
Replace delivery steps that were completed during publication.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record the passing hosted Linux and Windows builds and the existing master
CodeQL alert that remains outside the PR diff.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
fglock and others added 10 commits November 24, 2026 19:27
Record the integrated PR candidate, successful local gates, and current
publication and review steps for issue #2043.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Place the in-source CodeQL suppression on its own line before the
legacy-compatible RSA generation call so CodeQL recognizes it.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Restore the NetSSLeay source to the merged #2171 implementation after
confirming the PR CodeQL alert remains present on the default branch.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record the post-2171 PR candidate, passing local gate, and remaining
CodeQL alert state in the current issue checkpoint.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Reject RSA generation requests below 2048 bits in both bundled adapters.
Update the active round-trip and padding tests to use the new minimum and
assert that 1024-bit requests are rejected.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Make RSA key-size parsing return only validated values and reject invalid
requests through the undef path before reaching the JCE key generator.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Record the RSA minimum-size decision, CodeQL dataflow investigation, and
current evidence for issue #2043.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Parse RSA key sizes through BigDecimal so generic RuntimeScalar numeric
flows do not reach the JCE sink before range validation. Reject fractional
sizes along with out-of-range values.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Update the owner-ledger checkpoint with the latest RSA policy, local test
results, and CodeQL SARIF diagnosis.

Issue: #2043

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant