Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Mozilla Hacks 8 min read Incident hardMaster

Option Soup: the subtle pitfalls of combining compiler flags

A Firefox 120 beta crash in std::locale::classic() on Ubuntu 18.04 traced back to a downstream build that combined -static-libstdc++ with the linker flag -Bsymbolic-functions. Both the firefox binary and liblgpllibs.so embedded their own libstdc++. -Bsymbolic-functions bound function calls locally while exported variables (_S_once, _S_classic) were still interposed. One module therefore initialized the shared once-flag using pointers to its own private c_locale, leaving the other module's copy uninitialized. The fix was to drop static libstdc++ in favor of dynamic linking with a bundled library via RPATH, and Firefox's configure now detects the setup after the same bug hit NixOS 23.05.

Assumes: ELF shared librariessymbol interposition, PLT and GOTC++ static vs dynamic linking

Related posts

  • Announcing Rust 1.99.1

    Rust Blog mediumAdept

    Rust 1.99.1 is a point release fixing three regressions. LLVM's loop-idiom-wcslen pass could emit calls to `wcslen` on targets lacking it, breaking UEFI builds using `std`, so compiler-builtins now provides a fallback. FFI functions returning `bool` on x86_64 could leave bits 1-7 of the return register unspecified; the return type is again marked for zero-extension as the ABI requires. `rust-lld` on macOS could fail to load libLLVM when invoked without the rustup proxy and now carries an rpath entry for libLLVM.dylib.

  • Bun v1.1.7

    Bun mediumAdept

    Bun v1.1.7 fixes 28 bugs and adds glob patterns in package.json workspaces (via Bun.Glob), asymmetric matcher support in expect.extend's this.equals, and a working bunx --version. Several fixes come with root causes: a SIMD invalid memory access in Zig's std.mem.indexOfScalarPos crashing Windows startup, a misassumed 8-byte alignment of FILE_DIRECTORY_INFORMATION, threadlocal destructors running during std::quick_exit with live Workers, an uninitialized C++ integer corrupting stacktrace line numbers, and a memory leak from unread Bun.serve() request bodies since v1.0.30. Smaller changes include WebSocket close code 1015 on TLS failures, a ServerWebSocket shrink from 32 to 24 bytes, and adding clang-analyzer to CI.

  • Bun v1.0.9

    Bun mediumAdept

    Bun v1.0.9 fixes regressions introduced by the v1.0.8 move from a hand-written Makefile to CMake and Ninja: "Illegal instruction" crashes on older x86 and some arm64 CPUs, and "symbol not found" errors on glibc older than 2.28 that broke Vercel. New CI jobs will test on an older CPU and fail any build that requires too new a glibc. `Bun.spawn`'s `exited` now always returns a number (128 + signal number when a signal kills the process) and no longer hangs in an edge case. Peer dependencies now reuse the version already in the project, as npm does, and a JSX transpiler panic is fixed; it was caused by a scope-creating `key` prop being visited out of parse order.

  • Improving Firefox stability on Linux

    Mozilla Hacks mediumAdept

    Mozilla went from being able to symbolicate under 20% of Linux Firefox crash reports to over 99% by scraping debug information for distro-packaged Firefox builds and their dependencies (GTK, Mesa, fontconfig, SQLite, etc.) from Arch, Debian, Fedora, OpenSUSE and Ubuntu repositories. The scripts convert that debug info into Breakpad symbol files, which the Socorro crash processor uses to turn minidumps into readable stack traces. With those traces the team caught distro-specific regressions such as a Debian fontconfig backport bug within days and sent fixes upstream to Mesa, GTK and glib. The crash analysis tooling was also rewritten in Rust on top of Sentry's crates, making it much faster and lighter on memory.

  • Bun v1.0.36

    Bun mediumAdept

    Bun v1.0.36 fixes 13 bugs and adds Node.js-compatible fs.openAsBlob and fs.opendir. Several fixes explain their low-level cause. File descriptor leaks to child processes are now prevented with the close_range syscall on Linux and posix_spawn on macOS. A Bun.spawn redirection bug came from dup2 being a no-op when source and destination descriptors match, so Bun now clears O_CLOEXEC instead. Non-blocking TTY reads reopen the terminal via ttyname_r, and bun build --target bun now emits latin1 rather than utf-8. Other fixes cover stdin/stdout hangs, an http2 crash, Bun shell races, bun install bin linking and .env loading in bun run.

The quest for software engineering knowledge.

Look:
Layout: