Skip to content

segfault on running example application #142

@harry-van-haaren

Description

@harry-van-haaren

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 @ 410696a

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 <rte_eth_devices+66304>
(gdb) p dev
$3 = (struct rte_eth_dev *) 0x7ffff7e5d600 <rte_eth_devices+66304>
(gdb) p *dev
$4 = {rx_pkt_burst = 0x7ffff686b780 <eth_pcap_rx>, tx_pkt_burst = 0x7ffff686b3b0 <eth_pcap_tx>, tx_pkt_prepare = 0x0,
  rx_queue_count = 0x17ffb9240, rx_descriptor_done = 0x17e75e6c0, rx_descriptor_status = 0x7ffff68709c0 <ops>,
  tx_descriptor_status = 0x555555fdd900, data = 0x0, process_private = 0x0, dev_ops = 0x7ffff7e5d640 <rte_eth_devices+66368>,
  device = 0x0, intr_handle = 0x0, link_intr_cbs = {tqh_first = 0x0, tqh_last = 0x0}, post_rx_burst_cbs = {
    0x0 <repeats 1024 times>}, pre_tx_burst_cbs = {0x0 <repeats 1020 times>, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions