Skip to content

fix(node): route domain errors from native EventEmitter#4402

Closed
andrewtdiz wants to merge 3 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-events-domain-routing
Closed

fix(node): route domain errors from native EventEmitter#4402
andrewtdiz wants to merge 3 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-events-domain-routing

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Fixes #4395.

Summary:

  • Route new EventEmitter() / new events.EventEmitter() through the native events handle path used by the no-auto events archive.
  • Add external EventEmitter domain hooks so domain.add/remove, ee.domain, and unhandled error emits work across stdlib and native events handles.
  • Reserve low native handle IDs from GC heap pointer scanning so tagged native handles are not traced as heap objects.
  • Avoid cross-allocator temporary buffers in dynamic handle dispatch and Error stack construction paths reached by the fixture.

Validation:

  • PERRY_NO_AUTO_OPTIMIZE=1 target/release/perry compile test-parity/node-suite/domain/members-emitter-errors.ts -o /tmp/perry-domain-members-debug --debug-symbols --no-cache && /tmp/perry-domain-members-debug
  • PERRY_NO_AUTO_OPTIMIZE=1 target/release/perry compile test-parity/node-suite/events/imports/default-import.ts -o /tmp/perry-events-default-import --debug-symbols --no-cache && /tmp/perry-events-default-import
  • PERRY_NO_AUTO_OPTIMIZE=1 target/release/perry compile test-parity/node-suite/events/imports/named-imports.ts -o /tmp/perry-events-named-imports --debug-symbols --no-cache && /tmp/perry-events-named-imports
  • PERRY_NO_AUTO_OPTIMIZE=1 target/release/perry compile test-parity/node-suite/events/imports/namespace-import.ts -o /tmp/perry-events-namespace-import --debug-symbols --no-cache && /tmp/perry-events-namespace-import
  • env CARGO_BUILD_JOBS=1 RUSTC_WRAPPER= cargo check -p perry-ext-events -p perry-runtime -p perry-stdlib
  • env CARGO_BUILD_JOBS=1 RUSTC_WRAPPER= cargo test -p perry-runtime native_handle -- --nocapture
  • env CARGO_BUILD_JOBS=1 RUSTC_WRAPPER= cargo test -p perry-runtime test_write_barrier_non_pointer -- --nocapture
  • rustfmt --edition 2021 --check <touched files>
  • git diff --check

@proggeramlug
Copy link
Copy Markdown
Contributor

Superseded by #4398 ("fix(domain): route emitter errors through domains"), which already merged and closed the same issue #4395. main's domain-error routing (incl. the domain_handle field on event emitters) comes from #4398's accepted implementation, so this PR's alternative approach is now redundant and heavily conflicting. Closing.

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.

node:domain: EventEmitter domain error routing segfaults

2 participants