Open
Conversation
Isolates fdtables/DashMap behavior in Lind-WASM from grate-specific logic (pipes, sockets, IPC). Intercepts open/close/dup/dup2/fork/exec with pure fdtables bookkeeping + forwarding. 11 C tests covering single-cage ops, rapid cycling, and cross-fork fd inheritance.
- Grate: removed all println output (only prints on errors) - Added 12 new tests (23 total) focused on fork/exec stress: - rapid fork+close (50 iterations) - child fd churn (open/dup/write/close loops after fork) - concurrent parent+child fd ops - fork chain (2 levels), deep fork chain (4 levels) - dup2 storm (in-process and post-fork) - fork bomb (20 sequential forks) - child closes all 15 inherited fds - multiple children from one parent (5 concurrent) - rapid double-fork (child immediately forks again, 10x) - concurrent opens from parent and child simultaneously
Runs before all other tests. Parent and child each write 500 times concurrently. Grate counts writes with three methods: - std::sync::Mutex - AtomicU64::fetch_add - unsynchronised load+store (control) Read from magic fd 99 reports all three counters. If mutex < 1000: Mutex doesn't work cross-thread. If atomic < 1000: atomics don't work cross-thread. If unsync == 1000: no real concurrency (single-threaded dispatch).
Init the child cage's fdtable with fds 0-2 in the preexec hook instead of lazily in each handler. Fork copies parent fdtable to child directly without checking existence first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary