dstorage: WALLS_FILES grows on every OpenFile without VICTORY_WALLS_TRACE; a null out-pointer leaks the file handle or queue lane #217

Open
opened 2026-11-26 11:59:04 +00:00 by github-bot · 0 comments
Owner

@⁠kekonn on GitHub · 2026-11-26 11:56 UTC · original

crates/victory-hle/src/modules/dstorage.rs

  • Line 157: WALLS_FILES.lock()…push((file as usize, kept)) runs on every IDStorageFactory::OpenFile, whether or not VICTORY_WALLS_TRACE is set. Its only reader, walls_request (~667-678), returns early when tracing is off. Nothing removes an entry when the file is released. The list therefore gains about 100 bytes per open for the whole run.
  • Line ~677: the lookup takes the first match by address. After a file object's address is reused, the trace names the oldest file opened there.
  • Null out-pointer: open_file (~151-158) creates the host file handle, and create_queue (~218-223) inserts a lane, before put() rejects a null out. Both then leak, because the object's Drop never runs.

When: the growth happens on the default path, one entry per file open. The wrong names appear only with VICTORY_WALLS_TRACE. The leaks need a title that passes a null out.

Proposed fix (~6 lines)

  • Wrap the push in if walls_trace() != 0 { … }.
  • Look up with files.iter().rev().find(…) so the newest entry for an address wins.
  • Return E_INVALIDARG on a null out before creating the file handle or the lane.

Upstream: no open PR touches dstorage.rs.
Status: a fix is being prepared in kekonn/VIctory-7900XTX on branch claude/gifted-clarke-uxuqw8.


Generated by Claude Code

**@⁠kekonn** on GitHub · 2026-11-26 11:56 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/217) `crates/victory-hle/src/modules/dstorage.rs` - **Line 157:** `WALLS_FILES.lock()…push((file as usize, kept))` runs on **every** `IDStorageFactory::OpenFile`, whether or not `VICTORY_WALLS_TRACE` is set. Its only reader, `walls_request` (~667-678), returns early when tracing is off. Nothing removes an entry when the file is released. The list therefore gains about 100 bytes per open for the whole run. - **Line ~677:** the lookup takes the *first* match by address. After a file object's address is reused, the trace names the oldest file opened there. - **Null out-pointer:** `open_file` (~151-158) creates the host file handle, and `create_queue` (~218-223) inserts a lane, before `put()` rejects a null `out`. Both then leak, because the object's `Drop` never runs. **When:** the growth happens on the default path, one entry per file open. The wrong names appear only with `VICTORY_WALLS_TRACE`. The leaks need a title that passes a null `out`. ### Proposed fix (~6 lines) - Wrap the push in `if walls_trace() != 0 { … }`. - Look up with `files.iter().rev().find(…)` so the newest entry for an address wins. - Return `E_INVALIDARG` on a null `out` before creating the file handle or the lane. **Upstream:** no open PR touches `dstorage.rs`. **Status:** a fix is being prepared in kekonn/VIctory-7900XTX on branch `claude/gifted-clarke-uxuqw8`. --- _Generated by [Claude Code](https://claude.ai/code)_
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:59:04 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
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
github/avatarmanz--VIctory-7900XTX#217
No description provided.