fix: oneway shm calls, mem-ring unstuck notify and misc review fixes - #199
Open
lirenjie95 wants to merge 33 commits into
Open
lirenjie95 wants to merge 33 commits into
lirenjie95 wants to merge 33 commits into
Conversation
- r2g: emit a real Go handler for no-return #[mem]/#[shm] functions instead of an ack-only stub that silently dropped every request - mem-ring: the Go reader now clears the stuck flag and notifies the unstuck fd on pop, so a writer parked on a full ring flushes its pending items (mirrors the Rust ReadQueue::pop behavior) - asmcall: reserve the Win64 32-byte shadow space around calls in amd64.s so callee arg spills cannot clobber saved registers - macro: reject queue_size = 0 and report malformed or unknown #[rust2go::r2g] attributes with spanned errors instead of silently falling back to defaults - g2r: keep user parameter objects alive across the FFI call and sync the committed generated Go files - mem-ring: drop items still buffered when a queue is dropped and wake parked push_with_awaiter futures when the write queue is dropped - docs: document U+FFFD replacement for non-UTF-8 Go strings and drop char from the supported-type list; clearer codegen error for char
Keep the unsupported-type panic within rustfmt width at all four call sites and derive Debug for the DropCounter used in the new mem-ring drop test (Result::unwrap needs it).
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (96.35%) is below the target coverage (97.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #199 +/- ##
==========================================
- Coverage 97.02% 96.35% -0.67%
==========================================
Files 24 23 -1
Lines 4098 4530 +432
==========================================
+ Hits 3976 4365 +389
- Misses 122 165 +43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
If a writer was descheduled between the failed push and mark_stuck, a reader could drain the whole ring and go to sleep without ever seeing the stuck flag, leaving the parked item and the flusher asleep on both fds. Re-check the ring after marking stuck on both the Rust and Go push entry points and deliver directly when space has appeared, mirroring the re-check the background flushers already do.
…ings The Rust working/unstuck handlers discarded the notification read result, so once the peer closed its socket they woke immediately and forever (a hot spin); the Go side already exits in this case. Awaiter now reports the closed peer and both handlers exit, with the unstuck handler waking parked push_with_awaiter futures whose items can no longer be delivered. Queue::new(0) and Go NewQueue with BufferLen 0 produced permanently-full rings; reject them up front.
- r2g: box oneway #[mem]/#[shm] parameters into the slab like the async
path does and free them when the DROP ack arrives, so Go never reads
freed request memory; document the unsafe contract for reference
parameters
- g2r: replace the dyn Any round-trip for response storage with a typed
c_{trait}_{fn}_drop entry per function, so the payload destructors run
and the allocation is freed with the correct layout
- future: require Exec: Send/Sync in the manual Send/Sync impls of
ResponseFuture instead of asserting them without bounds
- asmcall: normalize the stack alignment in the CallFuncP* trampolines
(Go only guarantees 8-byte alignment; SysV/Win64 want 16 at the call)
- codegen robustness: reject cyclic struct definitions, reject u128/i128
with a clear error, reject mem parameters whose names collide with the
generated ring-handler locals, and support zero-parameter trait
functions (ToRef/FromRef for the unit type)
- r2g sync-return slot is now passed as *mut derived from &mut
- sync the committed generated Go files with the new emitters
… in the cycle test
…onal reserved set
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.
Uh oh!
There was an error while loading. Please reload this page.