Skip to content

fix: select fd_set ABI, poll busy-loop, vdiag switch, condvar lock#38

Merged
Bahtya merged 1 commit into
mainfrom
fix/select-poll-vdiag
May 24, 2026
Merged

fix: select fd_set ABI, poll busy-loop, vdiag switch, condvar lock#38
Bahtya merged 1 commit into
mainfrom
fix/select-poll-vdiag

Conversation

@Bahtya
Copy link
Copy Markdown
Owner

@Bahtya Bahtya commented May 24, 2026

Summary

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 pass
  • cargo clippy — 0 warnings
  • APK end-to-end — 31/31 pass, hermux round-trip 1028→1017ms (-11ms)
  • Cortex-A710/A715/X3 device (MTE enabled) — no crash

Closes #31, closes #32, closes #34, closes #36.

Bahtya

#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
@Bahtya Bahtya merged commit 72cddbd into main May 24, 2026
@Bahtya Bahtya deleted the fix/select-poll-vdiag branch May 24, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant