Skip to content
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

[freebsd] panic in bpf/unix.rs when when using FD_SET #69

Closed
dignifiedquire opened this issue May 21, 2024 · 1 comment · Fixed by #71
Closed

[freebsd] panic in bpf/unix.rs when when using FD_SET #69

dignifiedquire opened this issue May 21, 2024 · 1 comment · Fixed by #71

Comments

@dignifiedquire
Copy link
Contributor

While trying to get iroh working on FreeBSD, I ran into this panic during our tests

Backtrace

thread 'node::tests::test_shutdown' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/bsd/mod.rs:569:9:
index out of bounds: the len is 16 but the index is 16
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_bounds_check
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:209:5
   3: libc::unix::bsd::FD_SET
             at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.153/src/unix/bsd/mod.rs:569:9
   4: netdev::bpf::unix::channel
             at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/netdev-0.25.0/src/bpf/unix.rs:199:9
   5: netdev::socket::unix::channel
             at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/netdev-0.25.0/src/socket/unix.rs:55:5
   6: netdev::gateway::unix::get_default_gateway
             at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/netdev-0.25.0/src/gateway/unix.rs:20:11
   7: netdev::interface::unix::interfaces
             at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/netdev-0.25.0/src/interface/unix.rs:96:27
   8: netdev::interface::get_interfaces
             at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/netdev-0.25.0/src/interface/mod.rs:190:5
   9: iroh_net::net::interfaces::State::new::{{closure}}
             at /root/iroh/iroh-net/src/net/interfaces.rs:225:22
  10: iroh_net::net::netmon::actor::Actor::new::{{closure}}
             at /root/iroh/iroh-net/src/net/netmon/actor.rs:83:44
  11: iroh_net::net::netmon::Monitor::new::{{closure}}
             at /root/iroh/iroh-net/src/net/netmon.rs:46:34

I haven't been able to reduce the issue, but I can reproduce reliably on the FreeBSD VM I have access to using

cargo test on this branch: n0-computer/iroh#2311

github-merge-queue bot pushed a commit to n0-computer/iroh that referenced this issue May 24, 2024
Adds support for `iroh`  on `NetBSD`, `FreeBSD` and `OpenBSD`.

## Status

- NetBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- FreeBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- OpenBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted


## Caveats

- Build only in CI for now

## Related Issues

- shellrow/netdev#69
- n0-computer/quinn#9

## References

-
https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh
- rust-lang/libc#3711

Closes #2306

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
github-merge-queue bot pushed a commit to n0-computer/iroh that referenced this issue May 24, 2024
Adds support for `iroh`  on `NetBSD`, `FreeBSD` and `OpenBSD`.

## Status

- NetBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- FreeBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- OpenBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted


## Caveats

- Build only in CI for now

## Related Issues

- shellrow/netdev#69
- n0-computer/quinn#9

## References

-
https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh
- rust-lang/libc#3711

Closes #2306

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
@shellrow
Copy link
Owner

Thank you for reporting.
Currently, *BSD operating systems are not officially supported. As such, we had an experimental implementation for *BSD systems. However, with the recent changes, we have switched to an approach that parses routing tables and ARP tables. This should resolve the issue you reported.

@shellrow shellrow linked a pull request May 27, 2024 that will close this issue
rklaehn pushed a commit to n0-computer/iroh-blobs that referenced this issue Oct 22, 2024
Adds support for `iroh`  on `NetBSD`, `FreeBSD` and `OpenBSD`.

## Status

- NetBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- FreeBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- OpenBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted


## Caveats

- Build only in CI for now

## Related Issues

- shellrow/netdev#69
- n0-computer/quinn#9

## References

-
https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh
- rust-lang/libc#3711

Closes #2306

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
rklaehn pushed a commit to n0-computer/iroh-blobs that referenced this issue Oct 22, 2024
Adds support for `iroh`  on `NetBSD`, `FreeBSD` and `OpenBSD`.

## Status

- NetBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- FreeBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- OpenBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted


## Caveats

- Build only in CI for now

## Related Issues

- shellrow/netdev#69
- n0-computer/quinn#9

## References

-
https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh
- rust-lang/libc#3711

Closes #2306

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
matheus23 pushed a commit to n0-computer/iroh-doctor that referenced this issue Oct 22, 2024
Adds support for `iroh`  on `NetBSD`, `FreeBSD` and `OpenBSD`.

## Status

- NetBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- FreeBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- OpenBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted


## Caveats

- Build only in CI for now

## Related Issues

- shellrow/netdev#69
- n0-computer/quinn#9

## References

-
https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh
- rust-lang/libc#3711

Closes #2306

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
matheus23 pushed a commit to n0-computer/iroh that referenced this issue Nov 14, 2024
Adds support for `iroh`  on `NetBSD`, `FreeBSD` and `OpenBSD`.

## Status

- NetBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- FreeBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted
- OpenBsd
  - [x] Compiles
  - [ ] Tests passing
- [ ] Iroh: mostly passing, failures are only due to
shellrow/netdev#69
    - [x] Quinn
  - [x] Implementation adapted


## Caveats

- Build only in CI for now

## Related Issues

- shellrow/netdev#69
- n0-computer/quinn#9

## References

-
https://github.com/freebsd/freebsd-ports/blob/78ad38f04f51/games/jumpy/files/patch-iroh
- rust-lang/libc#3711

Closes #2306

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants