Skip to content

compiler: separate library for runtime #1

compiler: separate library for runtime

compiler: separate library for runtime #1

Workflow file for this run

name: darwin diag (das-fmt crash)
# TEMPORARY: build das-fmt on macOS with LTO (the failing config) and dump
# everything we need to diagnose the "mutex lock failed: Invalid argument"
# crash without an interactive SSH session: a full lldb backtrace at the C++
# throw, plus nm/otool of the init symbols (did the global ctor survive the
# link?). Delete once the crash is understood/fixed.
on:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
darwin_diag:
runs-on: macos-15-xlarge
permissions:
contents: read
steps:
- name: "SCM Checkout"
uses: actions/checkout@v4
- name: "Install deps"
run: brew install bison openssl z3
- name: "Install CMake and Ninja"
uses: lukka/get-cmake@latest
- name: "Build das-fmt (Release, LTO on, no LLVM/modules)"
run: |
set -eux
export PATH="$(brew --prefix bison)/bin:$PATH"
export LDFLAGS="-L$(brew --prefix bison)/lib -L$(brew --prefix openssl)/lib"
export CPPFLAGS="-I$(brew --prefix openssl)/include"
CC=clang CXX=clang++ cmake --no-warn-unused-cli -B./build \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DDAS_LLVM_DISABLED=ON \
-G Ninja
cmake --build ./build --config Release --target das-fmt
- name: "Diag: nm / otool — did the global ctor survive the link?"
continue-on-error: true
run: |
BIN=bin/das-fmt
echo "===== file ====="; file "$BIN"
echo
echo "===== __mod_init_func load command ====="
otool -l "$BIN" | grep -i -A4 mod_init || echo "(no __mod_init_func section — initializers stripped?)"
echo
echo "===== __mod_init_func contents (initializer pointers) ====="
{ otool -v -s __DATA_CONST __mod_init_func "$BIN"; otool -v -s __DATA __mod_init_func "$BIN"; } 2>/dev/null | head -100 || true
echo
echo "===== nm: g_DebugAgentMutex / g_DebugAgents ====="
nm -pa "$BIN" | grep -i "DebugAgent" || echo "(none)"
echo
echo "===== nm: global-ctor init symbols (sub_I / cxx_global_var_init / context) ====="
nm -pa "$BIN" | grep -iE "GLOBAL__sub_I|cxx_global_var_init|context" | head -100 || echo "(none)"
- name: "Diag: run das-fmt + lldb backtrace at the C++ throw"
continue-on-error: true
run: |
echo "===== plain run (stdout+stderr + exit code) ====="
set +e
./bin/das-fmt -v2 utils/mcp/tests/_fixture_gen1.das
echo "exit=$?"
echo
echo "===== lldb: break on C++ throw -> run -> backtrace all ====="
lldb -b \
-o "break set -E c++" \
-o "run" \
-o "thread backtrace all" \
-o "frame variable" \
-o "quit" \
-- ./bin/das-fmt -v2 utils/mcp/tests/_fixture_gen1.das 2>&1 | tail -150
echo "===== diag done ====="