fix: select fd_set ABI, poll busy-loop, vdiag switch, condvar lock#38
Merged
Conversation
#32 #34 #36) - #31: Replace incorrect u32[32] fd_set casts with libc::FD_ISSET/FD_SET (correct u64[16] on aarch64). Add fd >= FD_SETSIZE bounds check. - #32: Fix poll(timeout=-1) infinite busy-loop. IoWait stores deadline, yield_for_io accepts timeout, wake_io_ready expires timed-out coroutines. - #34: vdiag! macro now gated by VPROC_DIAG env var (AtomicBool). Zero write() syscalls when unset. - #36: Replace 1000×10ms usleep spin-lock in JNI createSubprocess with pthread_cond_timedwait (500ms deadline). 31/31 APK tests pass, hermux round-trip 1028→1017ms. Bahtya
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
u32[32]fd_set casts withlibc::FD_ISSET/libc::FD_SET(correctu64[16]on aarch64). Addfd >= FD_SETSIZEbounds check. Add compile-timesize_of::<fd_set>() == 128assertion.poll(timeout=-1)infinite busy-loop.IoWaitnow storesdeadline: Option<Instant>,yield_for_ioaccepts timeout,wake_io_readyexpires timed-out coroutines.vdiag!macro gated byVPROC_DIAGenv var viaAtomicBool. Zerowrite()syscalls when unset (was 68 per ELF load).usleepspin-lock in JNIcreateSubprocesswithpthread_cond_timedwait(500ms deadline).Deferred: #33 (wake_io_ready O(n²) — negligible at 20-50 coroutines), #35 (real_fn macro — pure refactor, 78 call sites, bundle later).
Test plan
cargo test— all passcargo clippy— 0 warningsCloses #31, closes #32, closes #34, closes #36.
Bahtya