Repository navigation
[pull] main from oven-sh:main - #11
Merged
Merged
Conversation
…'s handler (#331) * SignalsWin: return EXCEPTION_CONTINUE_SEARCH when no handler claims the fault vectoredHandler() defaulted its result to EXCEPTION_EXECUTE_HANDLER and returned it from a vectored exception handler. That constant is only valid as an __except() filter result; a VEH must return either EXCEPTION_CONTINUE_EXECUTION or EXCEPTION_CONTINUE_SEARCH. Returning 1 is treated as continue-execution by the dispatcher, so an access violation no WTF handler claimed would re-execute the faulting instruction, fault again, and re-enter the handler in an unbounded loop until the stack was gone. Because WTF installs itself first in the VEH chain, handlers registered behind it (ASan's shadow-page committer is the obvious one) never saw exceptions they own. Default to EXCEPTION_CONTINUE_SEARCH so unclaimed faults continue down the chain, matching the Mach (KERN_FAILURE) and POSIX (call old handler) paths for SignalAction::NotHandled. The SignalAction::Handled case still returns EXCEPTION_CONTINUE_EXECUTION as before. * shorten comment * SignalsWin: register the vectored handler behind AddressSanitizer's Under ASAN_ENABLED, register the WTF vectored handler with First=0 instead of First=1. AddressSanitizer's runtime installs its own vectored handler that commits shadow pages lazily and unpoisons the dispatch context before the handlers behind it run. Registered ahead of it, the WTF handler reads the CONTEXT record and the exception-dispatch stack before ASan has unpoisoned them, so every fault produces spurious stack-buffer reports attributed to the WTF handler. Registering behind ASan removes those reports; non-ASan builds keep the existing first-slot registration. --------- Co-authored-by: Dylan Conway <[email protected]>
The 1/3 constant in Heap::updateAllocationLimits() schedules a full collection after an eden GC whenever remainingHeapSize / maxHeapSize falls below it. Since maxHeapSize = growthFactor * live and remainingHeapSize is approximately (growthFactor - 1) * live in steady state, this bounds the effective heap growth factor below at 1 / (1 - ratio) = 1.5. Any growth factor under 1.5 promotes every eden GC to full. Exposing it as Options::minEdenToOldGenerationRatio() (same 1/3 default, no behavior change) lets embedders tune the growth factors below 1.5 without inducing full-GC thrash.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by cubic
Fix Windows vectored exception handling to prevent re-execution loops and ensure
AddressSanitizersees faults first. Also make the eden-to-old generation ratio a tunable JSC option for smoother GC behavior.Bug Fixes
EXCEPTION_CONTINUE_SEARCHto avoid looping on faulting instructions.ASAN_ENABLED, register the vectored handler behindAddressSanitizerto prevent spurious reports.New Features
Options::minEdenToOldGenerationRatio(default1.0 / 3.0) to control when a full GC is scheduled after an eden GC.Written for commit b11589f. Summary will update on new commits.