Skip to content

Segmentation Fault in fdctl, crashes when port is already in use #4765

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

Open
20urc3 opened this issue Apr 10, 2025 · 1 comment
Open

Segmentation Fault in fdctl, crashes when port is already in use #4765

20urc3 opened this issue Apr 10, 2025 · 1 comment
Assignees

Comments

@20urc3
Copy link

20urc3 commented Apr 10, 2025

Firedancer crashes with a segmentation fault when trying to bind to port 8001 that's already in use, instead of exiting cleanly with an appropriate error message.

Steps to reproduce

  • Have another process using port 8001
  • Run sudo ./build/native/clang/bin/fdctl run --config config.toml

Expected behavior

A clear error message indicating the port is already in use, with a graceful exit.

Actual behavior

thread '<unnamed>' panicked at gossip/src/cluster_info.rs:3086:21:
gossip_addr bind_to port 8001: Address already in use (os error 98)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at library/core/src/panicking.rs:221:5:
panic in a function that cannot unwind
stack backtrace:
   0:     0x563eb5bfa605 - <unknown>
   1:     0x563eb5c4788b - <unknown>
   2:     0x563eb5befa9f - <unknown>
   3:     0x563eb5bfcdf1 - <unknown>
   4:     0x563eb5bfcacc - <unknown>
   5:     0x563eb5bfd511 - <unknown>
   6:     0x563eb5bfd343 - <unknown>
   7:     0x563eb5bfaac9 - <unknown>
   8:     0x563eb5bfd004 - <unknown>
   9:     0x563eb327e685 - <unknown>
  10:     0x563eb327e712 - <unknown>
  11:     0x563eb327e936 - <unknown>
  12:     0x563eb361c641 - <unknown>
  13:     0x563eb337a866 - <unknown>
  14:     0x563eb337b38e - <unknown>
WARNING 04-10 06:30:45.325079 12     f12  1    /home/s0urc3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jsonrpc-ipc-server-18.0.0/src/server.rs(166): Removed existing file '/home/firedancer/.firedancer/fd1/ledger/admin.rpc'.
WARNING 04-10 06:30:45.329901 9      f12  0    metrics/src/metrics.rs(324): datapoint: os-config net.core.optmem_max=20480i
WARNING 04-10 06:30:45.339797 9      f12  0    metrics/src/metrics.rs(324): datapoint: os-config net.core.netdev_max_backlog=1000i
  15:     0x7f3e54d27b00 - __GI___clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
  16:                0x0 - <unknown>
thread caused non-unwinding panic. aborting.
ERR     04-10 06:30:45.358132 116621 f0   pidns src/app/fdctl/run/run.c(411): tile agave:0 exited with signal 11 (SIGSEGV-Segmentation fault)
@20urc3 20urc3 changed the title Bug: Firedancer crashes when port is already in use Segmentation Fault in fdctl, crashes when port is already in use Apr 16, 2025
@ripatel-fd
Copy link
Contributor

Thank you for the report. Hand crashing via a double-panic is the safest thing to do here in an FFI context due to lack of exception support in Rust. @mmcgee-jump Do you have a workaround for this to make the console output more readable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants