diff --git a/Dockerfile b/Dockerfile index 0f67df2..5a103f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN zig build --fetch-only 2>/dev/null || true # then copy source and build COPY src/ src/ # ReleaseFast (not ReleaseSafe): Io.Uring fiber context-switch GPFs under ReleaseSafe -# due to a zig 0.16-dev optimizer+safety interaction bug. See repro_evented.zig. +# due to a zig 0.16-dev optimizer+safety interaction bug. See scripts/repro_evented.zig. RUN zig build -Doptimize=ReleaseFast -Dcpu=baseline -Dtarget=x86_64-linux-gnu FROM --platform=linux/amd64 debian:bookworm-slim diff --git a/NOTES.md b/docs/notes.md similarity index 100% rename from NOTES.md rename to docs/notes.md diff --git a/docs/stdlib-patches.md b/docs/stdlib-patches.md index d742f1b..fa45210 100644 --- a/docs/stdlib-patches.md +++ b/docs/stdlib-patches.md @@ -99,7 +99,7 @@ RUN zig build -Doptimize=ReleaseFast ... under `ReleaseSafe`, the optimizer's inlining interacts badly with Uring's fiber context-switch machinery. the result is a general protection fault during normal fiber yield/resume. `ReleaseFast` and `Debug` both work. -`repro_evented.zig` in the repo root reproduces this — three simple fiber +`scripts/repro_evented.zig` reproduces this — three simple fiber tests (no-sleep, yield, sleep) that pass under Debug and ReleaseFast but GPF under ReleaseSafe. @@ -160,7 +160,7 @@ fiber dereferences `Thread.current()` — a threadlocal only set on Uring- managed threads. on Evented fibers it's NULL → SIGSEGV or heap corruption. this caused three separate crashes during the migration (crashes 1, 6, 8 in -NOTES.md). the fix pattern is always the same: components that use Threaded +docs/notes.md). the fix pattern is always the same: components that use Threaded resources (mutexes initialized with `pool_io`, pg.Pool) must run on plain `std.Thread`, not as Evented `io.concurrent()` fibers. diff --git a/repro_evented.zig b/scripts/repro_evented.zig similarity index 100% rename from repro_evented.zig rename to scripts/repro_evented.zig diff --git a/src/main.zig b/src/main.zig index 81636bb..8418e32 100644 --- a/src/main.zig +++ b/src/main.zig @@ -54,7 +54,7 @@ pub const default_stack_size = 8 * 1024 * 1024; // is NOT patched; subscribers resolve hostnames through pool_io (Threaded) instead. // // Known issue: Io.Uring GPFs under ReleaseSafe (optimizer + safety interaction). -// Build with ReleaseFast. See repro_evented.zig for minimal reproduction. +// Build with ReleaseFast. See scripts/repro_evented.zig for minimal reproduction. const Backend = Io.Evented; var backend: Backend = undefined;