-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Panic at FD_SET #1401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We don't use libc derectly, but use nix-0.11.0 such as let mut fd_set = select::FdSet::new();
let socket_fd = fd;
fd_set.insert(socket_fd); Panic at |
@killme2008 could you compile with let mut fd_set = select::FdSet::new();
let socket_fd = fd;
dbg!(fd_set);
dbg!(socket_fd);
fd_set.insert(socket_fd); ? cc @asomers |
This is probably a bug in your application. |
@asomers does nix expose a "safe" wrapper over these APIs ? |
No need. libc's exported |
Ok, then I'm going to leave this open here. While I agree with you that the bug is in user code, I think we should be providing a better error message in this situation, e.g., by asserting at the beginning of the function that the indices must be in bounds, and explaining what those bounds are, at least in debug mode via a |
For anyone looking to help, these functions libc/src/unix/linux_like/mod.rs Lines 1541 to 1586 in 5431bdb
.get(...).unwrap_or_else(|| panic!(...)) rather than [...] indexing.
|
Just for clarification, the functions prefixed with |
The |
FD_SET
.The text was updated successfully, but these errors were encountered: