Skip to content

v0.255.29

Choose a tag to compare

@github-actions github-actions released this 17 May 08:13
· 233 commits to main since this release
diag+bc+gc: restore bc_current_bc across throws + fair safepoint yield

Three follow-ups to v0.255.27's safepoint poll + diag-location
work, surfaced by v0.255.28 CI on a 2-CPU ubuntu-24.04 x86_64.

1. ctx->bc_current_bc could outlive the BC fn it pointed at when a
   throw longjmped past an inner BC frame's normal exit-time
   restore. normalize_exception (now called on every catch with
   the v0.255.27 location attachment) then dereferenced a soon-
   to-be-freed bc_fn_t, surfacing as heap-use-after-free in
   mino_bc_source_lookup under ASan. Two fixes:

   - BC VM's OP_PUSHCATCH setjmp landing now restores
     ctx->bc_current_bc to the current fn's `bc` before
     normalize_exception runs.
   - gc_mark_runtime_globals marks ctx->bc_current_bc as a GC
     interior pointer for every live ctx (main + workers). Covers
     cases the setjmp restore can't (eval_try tree-walker
     landings, host pcall re-entry).

2. The BC safepoint poll's auto-yield path
   (mino_yield_lock + sched_yield + mino_resume_lock) was too
   tight on 2-CPU runners: POSIX mutex_unlock/lock isn't fair, so
   the yielding thread re-grabbed state_lock ahead of waiters.
   The busy-spin-doesn't-starve-siblings test hung on
   ubuntu-24.04 x86_64. Replaced sched_yield with a 100us
   nanosleep (POSIX) / Sleep(0) (Win32) between unlock+lock so
   the OS scheduler has a chance to hand off.

3. tests/async_smoke_test.clj's busy-spin n calculation
   floored at 2 even on 2-thread hosts; now uses
   (max 1 (min 3 (- limit 1))) so it always fits the budget.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>