<html>
    <head>
      <base href="https://bugs.dpdk.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8" class="bz_new_table">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - dumpcap crashes with segmentation fault when capturing from af_packet"
   href="https://bugs.dpdk.org/show_bug.cgi?id=1786">1786</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>dumpcap crashes with segmentation fault when capturing from af_packet
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DPDK
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ethdev
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dev@dpdk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kerem.aksu@i2i-systems.com
          </td>
        </tr>

        <tr>
          <th>Target Milestone</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div class="bz_comment_block">
          <pre class="bz_comment_text">dumpcap crashes when capturing traffic from af_packet ethernet device.

$ ./dpdk-dumpcap -i 0
Capturing on 'net_af_packet0'
File: /tmp/dpdk-dumpcap_0_net_af_packet0_20250912103908.pcapng

Thread 1 "dpdk-dumpcap" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e46d78 in strlcpy () from /lib/x86_64-linux-gnu/libbsd.so.0


#0  0x00007ffff7e46d78 in strlcpy () from /lib/x86_64-linux-gnu/libbsd.so.0
#1  0x0000555556406faa in eth_dev_change_flags (if_name=0x560490350da0 <error:
Cannot access memory at address 0x560490350da0>, flags=256, mask=4294967295) at
../drivers/net/af_packet/rte_eth_af_packet.c:592
#2  0x0000555556407080 in eth_dev_promiscuous_enable (dev=0x55555b38d680
<rte_eth_devices>) at ../drivers/net/af_packet/rte_eth_af_packet.c:613
#3  0x0000555556211eb1 in rte_eth_promiscuous_enable (port_id=0) at
../lib/ethdev/rte_ethdev.c:2680
#4  0x0000555555629a49 in enable_pdump (r=0x15b438040, mp=0x15ba3c900) at
../app/dumpcap/main.c:688
#5  0x000055555562af5b in main (argc=3, argv=0x7fffffffe448) at
../app/dumpcap/main.c:818

dumpcap tries to enable promiscuous mode on the host device but it cannot
access device name and crashes.

I think problem caused by a strdup(3) within rte_eth_af_packet.c:744 struct
pmd_internals * (internals)->if_name is allocated with strdup(3) which is not
accessible from secondary process (in this context dumpcap). 

Allocating this field with rte_malloc probably will fix the issue.
          </pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
      <div itemscope itemtype="http://schema.org/EmailMessage">
        <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
          
          <link itemprop="url" href="https://bugs.dpdk.org/show_bug.cgi?id=1786">
          <meta itemprop="name" content="View bug">
        </div>
        <meta itemprop="description" content="Bugzilla bug update notification">
      </div>
    </body>
</html>