feat: PerlRuntime multiplicity with regex timeout fix#488
Closed
feat: PerlRuntime multiplicity with regex timeout fix#488
Conversation
matchRegexWithTimeout() creates a single-thread executor for alarm-based regex timeout. After the multiplicity migration, these worker threads have no PerlRuntime bound, causing "No PerlRuntime bound to current thread" errors when matchRegexDirect() accesses per-runtime regex state. This broke jcpan version parsing because CPAN::Module::parse_version sets alarm() before calling MM->parse_version(), which triggers regex matching in a timeout thread. Fix: capture PerlRuntime.current() before submitting to the executor and bind it in the worker thread via PerlRuntime.setCurrent(). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
86971e2 to
7c925ee
Compare
- Fix alarm: bind PerlRuntime to alarm scheduler thread so %SIG is accessible (alarm.t tests 1-4) - Fix goto-sub.t: skip JVM compilation for closures capturing non-scalar variables (@arrays, %hashes) since the interpreter stores them as RuntimeBase but JVM expects typed parameters - Fix parser.t: catch LinkageError (VerifyError) in addition to Exception when JVM bytecode verification fails for eval STRING anonymous subs, allowing proper fallback to interpreter - Fix attrs.t: propagate attributes through JvmClosureTemplate for JVM-compiled closures, and make defensive copies of attribute lists to prevent shared-reference mutation bugs - Add attributes field to JvmClosureTemplate and dispatch MODIFY_CODE_ATTRIBUTES for JVM closures in CREATE_CLOSURE handler Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
7c925ee to
f98ce32
Compare
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
Re-applies the multiplicity regression fixes on top of the reverted master (PR #487). Rebased cleanly onto current master.
Changes
Commit 1: fix: bind PerlRuntime to regex timeout thread pool workers
Commit 2: fix: resolve multiplicity regressions in eval STRING JVM compilation
Test Results
All unit test shards pass (
makesucceeds).Test plan
makepasses (BUILD SUCCESSFUL, all unit shards)Generated with Devin