[GH-ISSUE #3045] [Bug]: PleReader initialization failures can wait forever for nonexistent reads #1221

Closed
opened 2026-11-04 01:49:28 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @j-luwierski on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3045

What happened

PleReader::open() can hang in its error cleanup before any read has been submitted. Two CPU-only reproductions on freshly fetched upstream main 477ac13cbe8e582c20484871ce459d20d82df09d:

  1. Make DirectFile::alloc_aligned() return null by wrapping posix_memalign to return ENOMEM. open() sets max_inflight before allocating the slab, then calls close() on failure. The free-slot vector is still empty, so close() waits indefinitely in file.wait(..., -1). The expected cannot allocate read buffers error never returns.
  2. Successfully open a reader, close it, then open the same valid file with a table range extending beyond EOF. close() cleared the free slots but retained the previous max_inflight; the second open reaches the bounds error and hangs in cleanup. Calling open() directly on an already open reader has the same problem because it closes first.

Expected: return false with the existing error, close the file, permit repeated close and a later valid open/read.

Strata version, GPU, OS

Latest upstream main checked directly against Niko1221/Strata: 477ac13c (0.1.45). Linux x86_64, GCC 14.2.0. Synthetic 16 KiB file and real DirectFile I/O; no GPU or model weights.

Engine log

The lifecycle regression was compiled against unchanged upstream source and run with a two-second subprocess timeout:

reads caller exit 0
reads threaded exit 0
reopen caller TIMEOUT after 2 seconds
reopen threaded TIMEOUT after 2 seconds
alloc caller TIMEOUT after 2 seconds
alloc threaded TIMEOUT after 2 seconds

These are deterministic API/error-path reproductions, not a claim that ordinary model loading exhausts memory. The proposed change delays publishing the slot count until initialization completes and resets it on close.

Searched open issues and PRs for PleReader, initialization, allocation and close. Related #2991 concerns colliding temporary files in a different selftest; #2623 concerns prefetch matching. Neither covers this initialization bookkeeping.

Originally created by @j-luwierski on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3045 ### What happened `PleReader::open()` can hang in its error cleanup before any read has been submitted. Two CPU-only reproductions on freshly fetched upstream main `477ac13cbe8e582c20484871ce459d20d82df09d`: 1. Make `DirectFile::alloc_aligned()` return null by wrapping `posix_memalign` to return `ENOMEM`. `open()` sets `max_inflight` before allocating the slab, then calls `close()` on failure. The free-slot vector is still empty, so `close()` waits indefinitely in `file.wait(..., -1)`. The expected `cannot allocate read buffers` error never returns. 2. Successfully open a reader, close it, then open the same valid file with a table range extending beyond EOF. `close()` cleared the free slots but retained the previous `max_inflight`; the second open reaches the bounds error and hangs in cleanup. Calling `open()` directly on an already open reader has the same problem because it closes first. Expected: return false with the existing error, close the file, permit repeated close and a later valid open/read. ### Strata version, GPU, OS Latest upstream main checked directly against Niko1221/Strata: `477ac13c` (0.1.45). Linux x86_64, GCC 14.2.0. Synthetic 16 KiB file and real DirectFile I/O; no GPU or model weights. ### Engine log The lifecycle regression was compiled against unchanged upstream source and run with a two-second subprocess timeout: ```text reads caller exit 0 reads threaded exit 0 reopen caller TIMEOUT after 2 seconds reopen threaded TIMEOUT after 2 seconds alloc caller TIMEOUT after 2 seconds alloc threaded TIMEOUT after 2 seconds ``` These are deterministic API/error-path reproductions, not a claim that ordinary model loading exhausts memory. The proposed change delays publishing the slot count until initialization completes and resets it on close. Searched open issues and PRs for PleReader, initialization, allocation and close. Related #2991 concerns colliding temporary files in a different selftest; #2623 concerns prefetch matching. Neither covers this initialization bookkeeping.
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271438115 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1221
No description provided.