Skip to content

Make c-abi exhaustive and fix C++ operator new handler paths - #2

Merged
tyler274 merged 1 commit into
main3from
rewrite/abi-oracles
Nov 28, 2026
Merged

tyler274 merged 1 commit into
main3from
rewrite/abi-oracles

Conversation

@tyler274

Copy link
Copy Markdown
Owner

Summary

  • nm -D must show all 38 exported symbols (malloc family, libc aliases, Itanium new/delete), and none of the 14 MI_OVERRIDE_LIBC_EXTRAS names (adds strndup, reallocf, __libc_calloc, __libc_memalign, ...). ABI_PROFILE=libc for jemalloc.
  • New preload smoke rust/tests/aliases.c (+ interpose.h), libc-only chaos under LD_PRELOAD, cxx linked and preloaded with throwing/nothrow/array/aligned/sized new and delete.
  • musl: replace the glibc DT_NEEDED libc.so.6 check with a no-glibc check so c-abi runs there.
  • Fix: throwing operator new with no handler now throws bad_alloc (was _exit(1)); nothrow forms no longer let a handler exception escape noexcept.

Testing

Verified locally (Rust 1.99.1): cargo test -p elymalloc-core --release (117/117) and -p elymalloc-harness pass on this branch alone. c-abi passes for rewrite (default, secure), C mimalloc and jemalloc on glibc, and for both rewrite cdylibs on musl. A fake DSO exporting only mi_malloc fails. Note: C mimalloc (built as C) aborts in the new throwing-new case; the oracle tolerates C-only failures.

Require every exported libc alias and Itanium new/delete symbol, deny all
MI_OVERRIDE_LIBC_EXTRAS names, add an ABI_PROFILE for jemalloc, call the
aliases under LD_PRELOAD (aliases.c, libc-only chaos, preloaded cxx), and
run c-abi on musl. Throwing operator new now raises bad_alloc with no
handler instead of _exit, and nothrow forms no longer let a handler's
exception escape noexcept.
@tyler274
tyler274 merged commit 20583df into main3 Nov 28, 2026
5 of 7 checks passed
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