rust-pcap / pcap

Rust language pcap library
Apache License 2.0
620 stars 142 forks source link

Segmentation faults when running examples #254

Closed Wojtek242 closed 2 years ago

Wojtek242 commented 2 years ago
$ sudo cargo run --example easylisten
  Downloaded bitflags v1.2.1
  Downloaded 1 crate (16.7 KB) in 0.72s
   Compiling bitflags v1.2.1
   Compiling pcap v0.9.2 (/home/wojtek/Workspace/pcap)
    Finished dev [unoptimized + debuginfo] target(s) in 1.40s
     Running `target/debug/examples/easylisten`
Using device wlp4s0
[1]    238107 segmentation fault  sudo cargo run --example easylisten
Wojtek242 commented 2 years ago

Running the example at different commits revealed that 327bb1a is the faulty one.

Stargateur commented 2 years ago

we should also test example in the CI, nice catch BTW

Wojtek242 commented 2 years ago

We should just test more as our code coverage is only 35-40% :-). The problem with testing these in CI is that they need to bind to an interface so one should explore how to do that. It 100% can be done in a docker container with veth pairs, but I haven't gotten around to it just yet as it's a lot of work.