Skip to content

cobalt: the no-exceptions driver and stack probe under the -O3 link - #2

Merged
pinhopro merged 1 commit into
mainfrom
release-link
Nov 15, 2026
Merged

pinhopro merged 1 commit into
mainfrom
release-link

Conversation

@pinhopro

Copy link
Copy Markdown
Contributor

Title: cobalt: the no-exceptions driver and stack probe under the -O3 link

The superproject now links an emscripten program at its compile's level of optimization (webcpporg/webcpp#18): -O3 in a release build, which turns Emscripten's ASSERTIONS off.

Changes

  • test/no_exceptions/driver.py. Native code's abort() prints Aborted(native code called abort()) in a debug link and Aborted() in a release one, followed in release by "Build with -sASSERTIONS for more info." The driver required RuntimeError: Aborted(native code called abort()), so move_off and borrowed_race_off failed in release in the exceptions and borrowed_race lanes. It now requires one of the two Aborted(...) lines, exactly, which Emscripten prints before it throws: no other abort of its runtime has an empty reason, and a trap, or an abort for another reason, prints another line. Checked with the release and debug probes (the old driver fails the release one), and with stand-in programs that trap, or abort with RuntimeError: unreachable, undefined or an assertion as the reason, which the new driver rejects. The driver has no tests of its own.
  • test/Jamfile. cobalt_stack_optimized_link_* linked release with <linkflags>-O3, which release now does itself; the probe keeps its debug and release builds. Measured on 2026-11-15: at most 1,036 bytes in debug and 384 in release with exceptions, 704 and 232 without.

No user-visible change, so no changelog line.

Verification

Local, macOS arm64, Emscripten 6.0.11, Node 26.13.0, each lane from scratch (b2 -a) in its own build directory, with the CI's options, in variant=release and variant=debug, verdict by tools/report/report.py:

  • emscripten (libs/cobalt/test libs/cobalt/example), cobalt, cobalt_asyncify, asyncify, spsc-sequence, spsc-wakeup, migrated-portable, migrated-worker-modules, portable-counterparts, exceptions, borrowed_race: passed, release and debug.
  • browser-network-counterparts, browser-pages, browser-runtime-probes, browser-worker-pages, browser-workers: passed, release and debug, with full Chromium 1248, as the CI gives Cobalt's lanes. (With chrome-headless-shell, browser-network-counterparts fails in both builds on its trusted TLS fetch, which this change does not touch: Beast's driver, which it runs, asks for full Chromium.)
  • b2 -a libs/cobalt/doc: passed.

No CI was run.

Depends on webcpporg/webcpp#18 (merged).

🤖 Generated with Claude Code

The superproject links an emscripten program at its compile's level of
optimization (webcpporg/webcpp#18), -O3 in a release build, which turns
Emscripten's ASSERTIONS off. Native code's abort() then prints
"Aborted()" where a debug link prints "Aborted(native code called
abort())", and the driver of test/no_exceptions, which required the
second, failed move_off and borrowed_race_off in release, in the
exceptions and borrowed_race lanes. It now requires either line,
exactly: no other abort of Emscripten's runtime has an empty reason,
and a trap, or an abort for another reason, prints neither. Checked
against both builds, and against stand-in programs that trap or abort
for another reason, which it rejects.

cobalt_stack_optimized_link_* linked release with <linkflags>-O3, which
release now does itself; the probe keeps its debug and release builds.
@pinhopro
pinhopro merged commit b686622 into main Nov 15, 2026
78 checks passed
@pinhopro
pinhopro deleted the release-link branch November 17, 2026 04:06
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