ReviewOS

home-lang/home

Bun parity: make TLS config interning race-safe

#361
Closed chris opened this 9 days ago ·
9 days ago

Corpus position 4141 (fetch-proxy-tls-intern-race.test.ts) exercises the SSLConfig intern/deref ABA/use-after-free race under concurrent proxy fetch+abort churn.

Scope:

  • model TLS config registry entries with stable generations and checked refcounts
  • ensure a zero-ref destroy cannot delete a newly re-interned generation
  • reject double-release/refcount underflow with structured registry errors and composed stacks
  • execute the subprocess race fixture deterministically with both driver and probe progress
  • add permanent focused coverage and advance the zero-failure frontier.

First failure: fixture result reports driverOk: 0, so the current child path does not exercise a successful driver iteration.

9 days ago

Completed and pushed in ea6dcaa (fix(tls): guard config intern lifetimes).

Implemented:

  • TLS config registry entries with monotonic generations and checked refcounts
  • re-interning creates a distinct generation after retirement
  • zero-ref cleanup deletes only the exact entry/generation being retired
  • stale/double releases fail instead of underflowing or touching a replacement
  • deterministic race fixture with 256 successful driver iterations, 512 probes, and zero retained entries
  • structured TLSConfigRegistryError with stable code, operation, phase, key/generation, cause, and composed stack
  • permanent focused regression

Verification:

  • upstream TLS intern/deref race regression: 1 passed, 0 failed/unsupported
  • focused TLS lifetime regression: pass
  • full zig build: pass

Corpus frontier through position 4141: 482 files, 6,876 passed, 281 todo, 172 allowed-empty, 0 failed, 0 unsupported.

Sign in to comment on this issue.