Skip to content

fix(signal): terminate without raising SIGABRT - #132

Open
syrusakbary wants to merge 1 commit into
mainfrom
codex/fix-signal-default-recursion
Open

syrusakbary wants to merge 1 commit into
mainfrom
codex/fix-signal-default-recursion

Conversation

@syrusakbary

Copy link
Copy Markdown

Summary

  • terminate default-handled signals directly with the conventional 128 + signal status
  • keep normal signal termination silent, matching POSIX/native process behavior
  • add WASIX signal coverage for SA_SIGINFO, SA_RESETHAND, and default SIGTERM

Root cause

WASIX libc implemented every default terminating signal by calling abort(). That raises SIGABRT while the original signal is still being dispatched. A runtime that immediately delivers the nested signal can therefore re-enter the default signal path and repeatedly call abort(), producing an abort cascade instead of terminating once.

The terminating default action does not need the abort path or core-signal semantics. _Exit(128 + sig) terminates once and exposes the conventional shell status without writing diagnostics to stderr.

Verification

  • built the complete wasm32 exnref/EH sysroot with ./build32-exnref-eh.sh
  • exercised SA_SIGINFO, SA_RESETHAND, and default SIGTERM through the Wasmer JavaScript SDK: exit statuses 0, 138, and 143; no termination or abort diagnostics
  • rebuilt Edge.js against the sysroot and ran 10 Next-style worker shutdown probes: all completed in 1–4 ms with no signal diagnostics
  • ran a browser Next.js 16.3 production build through Edge.js, including Collecting build traces, verified .next/BUILD_ID, and served the production preview successfully

@Arshia001 Arshia001 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests for wasix-libc fixes and new features are added in the Wasmer repo, under wasix/tests/wasm_tests. Otherwise LGTM.

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.

2 participants