Reject negative descriptors in single-descriptor readiness helpers
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- linux, rust
- Ambito
- compilers, networking
Direzione di ricerca
Il problema si trova in std/net/poll.wave, specificamente nelle funzioni net_wait_readable, net_wait_writable e net_wait_connected. Inizia esaminando la gestione di poll di Linux in quel file. Aggiungi una validazione per rifiutare i descrittori di file negativi (restituire -9). Assicurati che un timeout infinito non causi un'attesa indefinita. Scrivi un test di regressione utilizzando lo script di riproduzione fornito e verifica che il comportamento normale e le voci disabilitate in net_poll siano preservati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
On Linux, net_wait_readable, net_wait_writable, and net_wait_connected in std/net/poll.wave return a timeout result for a negative descriptor instead of a bad-descriptor error. Linux poll ignores negative entries. Source inspection therefore also indicates an indefinite-wait risk with an infinite timeout; the executed reproduction below uses a zero timeout.
Reproduction
Save as repro.wave:
import("std::net::poll")::{net_wait_readable};
fun main() -> i32 {
if (net_wait_readable(-1, 0) == -9) { return 0; }
return 1;
}
From the repository root, stage the matching std and run:
audit_home="$(mktemp -d)"
mkdir -p "$audit_home/.wave/lib/wave"
cp -R std "$audit_home/.wave/lib/wave/std"
HOME="$audit_home" target/release/wavec build repro.wave -O0 --run
HOME="$audit_home" target/release/wavec build repro.wave -O2 --run
Tested at 01955d715dda275de993948037091140bb859174 on Fedora Linux 43, x86_64, with LLVM 21.1.8, at both -O0 and -O2.
Expected: the helper returns -9 and the program exits 0. Actual: it returns 0 and the program exits 1, with no output. The other two helpers behave the same way. An invalid positive descriptor (2147483647) correctly returns -9 in all three helpers.
Scope
Validate negative POSIX descriptors at the single-descriptor helper boundary. Preserve the disabled-entry behavior of generic net_poll on POSIX targets. Windows uses Winsock socket handles rather than POSIX descriptors; do not infer its validation or error mapping from this Linux reproduction. Platform error classification in #508 is separate.
Completion criteria
- All three helpers return
-9immediately for negative descriptors on Linux, including with an infinite timeout; bound the regression process with an external timeout. - Add regressions for negative and invalid positive descriptors.
- Preserve normal readable, writable, and timeout behavior, and disabled entries in POSIX
net_poll.
Difficulty: easy.
- Lingua principale
- Rust
- Stelle
- 53
- Fork
- 16
- Merge medio
- 3h 38m
- PR unite (30g)
- 48
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wavefnd/Wave
-
enhancement good first issue needs testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
enhancement good first issue needs testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug ci good first issue needs testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug ci good first issue needs testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug good first issue os compatibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Tutte le issue di wavefnd/Wave
Issue simili
-
bug github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
registrystack/registry-stack#1393 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rocky-data/rocky#2181 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. Apertabot:ai-assisted component:indexer QA-roadmap status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
midnightntwrk/midnight-indexer#1557 ·