{"record":{"id":"58f153a407154068","repo":"cloudflare/quiche","slug":"send-to-gso-should-not-be-called-on-non-linux-pl","errorCode":null,"errorMessage":"send_to_gso() should not be called on non-linux platforms","messagePattern":"send_to_gso\\(\\) should not be called on non-linux platforms","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/src/sendto.rs","lineNumber":90,"sourceCode":"    match sendmsg(\n        sockfd,\n        &iov,\n        &[cmsg_gso, cmsg_txtime],\n        MsgFlags::empty(),\n        Some(&dst),\n    ) {\n        Ok(v) => Ok(v),\n        Err(e) => Err(e.into()),\n    }\n}\n\n/// For non-Linux platforms.\n#[cfg(not(target_os = \"linux\"))]\nfn send_to_gso_pacing(\n    _socket: &mio::net::UdpSocket, _buf: &[u8], _send_info: &quiche::SendInfo,\n    _segment_size: usize,\n) -> io::Result<usize> {\n    panic!(\"send_to_gso() should not be called on non-linux platforms\");\n}\n\n/// A wrapper function of send_to().\n///\n/// When GSO and SO_TXTIME are enabled, send packets using send_to_gso().\n/// Otherwise, send packets using socket.send_to().\npub fn send_to(\n    socket: &mio::net::UdpSocket, buf: &[u8], send_info: &quiche::SendInfo,\n    segment_size: usize, pacing: bool, enable_gso: bool,\n) -> io::Result<usize> {\n    if pacing && enable_gso {\n        match send_to_gso_pacing(socket, buf, send_info, segment_size) {\n            Ok(v) => {\n                return Ok(v);\n            },\n            Err(e) => {\n                return Err(e);\n            },","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/apps/src/sendto.rs#L72-L108","documentation":"send_to_gso_pacing has a non-Linux stub that exists only to satisfy compilation on other platforms; calling it is a programming error because UDP GSO (UDP_SEGMENT/SO_TXTIME) is Linux-only. The function unconditionally panics if invoked on macOS/Windows/etc.","triggerScenarios":"The send path selects the GSO pacing function on a non-Linux target, e.g. due to a misconfigured feature flag or incorrect cfg gating in the caller, while GSO pacing is requested.","commonSituations":"Building/running tokio-quiche or apps with GSO enabled on macOS/BSD for development; platform-detection code accidentally enabling the Linux path.","solutions":["Run on Linux if GSO pacing is required; it depends on Linux-specific socket options.","Ensure GSO/pacing options are disabled on non-Linux platforms.","Verify the cfg(target_os) gating in apps/src/sendto.rs and its callers.","Fall back to the plain send_to() path when GSO is unavailable."],"exampleFix":"// before\nsend_to_gso_pacing(&socket, &buf, &send_info, segment_size)?; // on macOS\n// after\nif cfg!(target_os = \"linux\") {\n    send_to_gso_pacing(&socket, &buf, &send_info, segment_size)?\n} else {\n    socket.send_to(&buf, &send_info.to)?\n};","handlingStrategy":"validation","validationCode":"fn gso_supported() -> bool { cfg!(target_os = \"linux\") }\nif !gso_supported() { /* use plain socket.send_to() */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only enable GSO/pacing on Linux targets.","Gate GSO config behind cfg(target_os = \"linux\") checks.","Add a CI job that exercises the non-GSO fallback on macOS/BSD."],"tags":["platform","gso","udp","linux-only"],"backgroundTag":"unsupported-platform","analyzedSha":"9f96daa2c22a4468b0036fb0a0a3894eee6498b8","analyzedAt":"2026-09-08T11:27:09.536Z","contentChangedAt":"2026-09-08T11:27:09.536Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}