capsule-rs / capsule-rs/capsule
segfault on running example application
- Dominant language
- Rust
- Stars
- 443
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Hi Capsule Community,
First time contributer here! Just finished reading the contrib guidelines & code-of-conduct, that's how new I am :)
## Describe the bug?
`pktdump` example applications segfaults when starting to rx traffic, `gdb` indiciates that a DPDK `dev->data` structure is `NULL`.
## Steps to reproduce?
1. Following example instructions for pktdump example here: https://github.com/capsule-rs/capsule/tree/410696acb2e033cabb287750b36810753b54a59e/examples/pktdump
2. Wget & extract DPDK 19.11.10 (LTS) tarball here; http://fast.dpdk.org/rel/dpdk-19.11.10.tar.xz
3. Extract, build and install DPDK with `meson` tooling: `meson build_gcc && cd build_gcc && meson configure -Dprefix=/usr && ninja install` (Warning; this will install DPDK 19.11 system-wide).
4. `cd /examples/pktdump` and then execute `cargo run -- -f pktdump.toml` just like in the documentation.
## Expected behavior?
Application runs without segfault
### Capsule version?
git master @ 410696acb2e033cabb287750b36810753b54a59e
### OS?
Linux (Ubuntu/Debian based)
### Docker / VM / Bare?
"Baremetal"
### Stack trace or error log output
```
Thread 1 "pktdump" received signal SIGSEGV, Segmentation fault.
rte_eth_rx_burst (port_id=4, queue_id=0, rx_pkts=0x555555ed6260, nb_pkts=32) at /usr/local/include/rte_ethdev.h:4849
4849 nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
(gdb) p dev->data
$1 = (struct rte_eth_dev_data *) 0x0
(gdb) p dev
'$2 = (struct rte_eth_dev *) 0x7ffff7e5d600
(gdb) p dev
$3 = (struct rte_eth_dev *) 0x7ffff7e5d600
(gdb) p *dev
$4 = {rx_pkt_burst = 0x7ffff686b780 , tx_pkt_burst = 0x7ffff686b3b0 , tx_pkt_prepare = 0x0,
rx_queue_count = 0x17ffb9240, rx_descriptor_done = 0x17e75e6c0, rx_descriptor_status = 0x7ffff68709c0 ,
tx_descriptor_status = 0x555555fdd900, data = 0x0, process_private = 0x0, dev_ops = 0x7ffff7e5d640 ,
device = 0x0, intr_handle = 0x0, link_intr_cbs = {tqh_first = 0x0, tqh_last = 0x0}, post_rx_burst_cbs = {
0x0 }, pre_tx_burst_cbs = {0x0 , 0x1, 0x0, 0x0, 0x0}, state = RTE_ETH_DEV_UNUSED,
security_ctx = 0x0, reserved_64s = {0, 0, 0, 0}, reserved_ptrs = {0x0, 0x0, 0x0, 0x0}}
(gdb) p *dev->data
Cannot access memory at address 0x0
```
Somehow, Capsule/DPDK are not initializing the `dev->data` correctly. I'm pretty familiar with DPDK, and was checking some things in GDB. Tested this with a real HW ethernet NIC, as well as with `net_pcap` software NIC, both have same issue, so I'm convinced this is not a DPDK PMD init bug, perhaps somewhere in the Rust/DPDK bindings/config?
If somebody can try to validate this same build/config, and report back working/not-working that would be very helpful.
Regards, -Harry
Contributor guide
Research direction
Start with the examples/pktdump instructions and reproduce using DPDK 19.11.10 and `cargo run -- -f pktdump.toml`. Inspect the Rust/DPDK initialization and configuration involved before `rte_eth_rx_burst`; done means pktdump starts receiving traffic without a segmentation fault and `dev->data` is initialized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100