summaryrefslogtreecommitdiff
path: root/core/fs.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 22:59:15 -0300
committerGabriel Schneider <[email protected]>2026-11-20 22:59:15 -0300
commitbf01716960a928b533c99ec9b373e35456ef18ba (patch)
tree09d74ec81e1662c3d20ff399c1f0042cceb9a108 /core/fs.zig
parent4e1432049765be6e793a3834c93c4cd5318e82bc (diff)
parent1ae6addf4590d3b9c1070f6546c29e807d272491 (diff)
downloadpardes-bf01716960a928b533c99ec9b373e35456ef18ba.tar.gz
pardes-bf01716960a928b533c99ec9b373e35456ef18ba.zip
integration: the client's double free fixed, on the typed slot fields: pardes-client-abort (a 9P open record past fs.opens_len is nothing: never read or freed: a replica client's rollback left one with freed pointers and the open's replay freed them again: a client typing while a script held a pty/run aborted with a corrupted heap, since pardes-merge40; the rollback copy walks every type that declares replica: it skipped fs.Namespace and a pane's 9P state) and pardes-merge43; no conflict; gated whole against sketchbook's main (reorg/merge44): tui core-test 875/1033 (158 skipped), shell-test 1075/1078, addon-test 5/5, term-test 17/17, kitty-test 45/45, pane-test 183/184, behaviour-test 275/275 and with --replay, process-test 0 of 145 failed, consumer-test passes; both soaks (--clients 5 and --bytes) diverged 0, unequal 0, unlisted stops 0, corpus through a client 22 scenes the same; daemon.py plain, far, games, window-clients, clients five times, relink, launch, pair, gui; macos (linux and aarch64) and freebsd build; frames 77/77 against tree2, perfab-corpus2x +0.012%, 121 per-operation counts within 0.1% (largest client-key-down +0.075%), gui unit-test 1671/1675 (no failure the base has not)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/fs.zig')
-rw-r--r--core/fs.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/fs.zig b/core/fs.zig
index a64487d6..6b43ba67 100644
--- a/core/fs.zig
+++ b/core/fs.zig
@@ -884,8 +884,10 @@ pub const Namespace = struct {
os_paths: std.ArrayList(OsPath) = .empty,
/// What each open holds between its open and its release.
opens: [tree.open_slots]tree.Open = @splat(.{}),
- /// The records past it are free: a digest and a dump take the opens
- /// this far (an idle session's none).
+ /// The records past it are nothing: a digest, a dump and a replica's
+ /// rollback copy take the opens this far (an idle session's none), and
+ /// nothing reads or frees one past it (a rollback leaves there what
+ /// its epoch freed).
opens_len: u8 = 0,
out: std.ArrayList(u8) = .empty,
listeners: u16 = 0,
@@ -1024,7 +1026,7 @@ pub const Namespace = struct {
st.mounts.deinit(gpa);
for (st.os_paths.items) |entry| gpa.free(entry.path);
st.os_paths.deinit(gpa);
- for (&st.opens) |*o| o.deinit(gpa);
+ for (st.opens[0..st.opens_len]) |*o| o.deinit(gpa);
for (st.pages.items) |*page| page.bytes.deinit(gpa);
st.pages.deinit(gpa);
for (st.closed_lines.items) |*line| line.bytes.deinit(gpa);
@@ -1057,7 +1059,7 @@ pub const Namespace = struct {
/// What the requests of connections gone made, let go: a session
/// revived from a dump has none of the connections that held its opens.
pub fn forget(st: *Namespace, gpa: std.mem.Allocator) void {
- for (&st.opens) |*o| o.deinit(gpa);
+ for (st.opens[0..st.opens_len]) |*o| o.deinit(gpa);
st.opens_len = 0;
st.results_len = 0;
st.batch.bytes.deinit(gpa);