Skip to content
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

segfault when compiled with dpdk but run without dpdk #46

Closed
rstory opened this issue Jul 12, 2017 · 3 comments
Closed

segfault when compiled with dpdk but run without dpdk #46

rstory opened this issue Jul 12, 2017 · 3 comments

Comments

@rstory
Copy link

rstory commented Jul 12, 2017

using this click config:

// test3.click
// This simple test demonstrates how RoundRobinSched works as a round robin
// scheduler.
// Run with 'click test3.click'
rr :: RoundRobinSched;
TimedSource(0.2) -> Queue(20) -> Print(q1) -> [0]rr;
TimedSource(0.5) -> Queue(20) -> Print(q2) -> [1]rr;
rr -> TimedSink(0.1);

and fastclick configured like so:

./configure \
  --prefix=/usr/local \
  --enable-multithread \
  --disable-linuxmodule \
  --enable-intel-cpu \
  --disable-batch \
  --enable-user-multithread \
  --verbose \
  --disable-dynamic-linking \
  --enable-poll \
  --enable-bound-port-transfer \
  --with-netmap=no \
  --enable-zerocopy \
  --enable-dpdk \
  --enable-dpdk-pool \
  --disable-dpdk-packet \
  RTE_SDK=/usr/local/share/dpdk RTE_TARGET=x86_64-native-linuxapp-gcc \
  CFLAGS='-g -O3 -I/usr/local/include/dpdk' \
  CXXFLAGS='-g -O3 -I/usr/local/include/dpdk -std=gnu++11' \
  --enable-local

from git commit 419abd7 (Wed Jul 5 10:59:15 2017 +0200).

and run click test3.click:
I get a segfault:

Program received signal SIGSEGV, Segmentation fault.
0x00000000007ab1c9 in DPDKDevice::get_mpool (socket_id=4294967295) at ../lib/dpdkdevice.cc:128
128         return _pktmbuf_pools[socket_id];
(gdb) bt
#0  0x00000000007ab1c9 in DPDKDevice::get_mpool (socket_id=4294967295) at ../lib/dpdkdevice.cc:128
#1  0x000000000075b936 in DPDKDevice::get_pkt (numa_node=<optimized out>)
    at ../include/click/dpdkdevice.hh:217
#2  DPDKDevice::get_pkt () at ../include/click/dpdkdevice.hh:229
#3  Packet::alloc_data (tailroom=0, length=2176, headroom=0, this=0xe15940) at ../lib/packet.cc:605
#4  WritablePacket::pool_data_allocate () at ../lib/packet.cc:401
#5  0x000000000075c1fd in WritablePacket::pool_allocate (tailroom=0, length=69, headroom=128)
    at ../lib/packet.cc:418
#6  Packet::make (headroom=128, data=0xe15dcc, length=69, tailroom=tailroom@entry=0) at ../lib/packet.cc:717
#7  0x00000000004397a6 in TimedSource::configure (this=0xe11b00, conf=..., errh=0x7fffffffe2e0)
    at ../elements/standard/timedsource.cc:51
#8  0x0000000000798935 in Router::initialize (this=this@entry=0xe15ac0, errh=errh@entry=0xe0da90)
    at ../lib/router.cc:1158
#9  0x000000000074eed9 in parse_configuration (text=..., text_is_expr=text_is_expr@entry=false,
    hotswap=hotswap@entry=false, errh=errh@entry=0xe0da90) at click.cc:400
#10 0x0000000000466b9b in main (argc=<optimized out>, argv=<optimized out>) at click.cc:730

if I configure without any dpdk arguments:

./configure \
  --prefix=/usr/local \
  --enable-multithread \
  --disable-linuxmodule \
  --enable-intel-cpu \
  --disable-batch \
  --enable-user-multithread \
  --verbose \
  --disable-dynamic-linking \
  --enable-poll \
  --enable-bound-port-transfer \
  --with-netmap=no \
  --enable-zerocopy \
  CFLAGS='-g -O3 ' \
  CXXFLAGS='-g -O3 -std=gnu++11' \
  --enable-local

It works great:

dl3n-1 $ click test3.click
q1:   69 | 52616e64 6f6d2062 756c6c73 68697420 696e2061 20706163
q1:   69 | 52616e64 6f6d2062 756c6c73 68697420 696e2061 20706163
@tbarbette
Copy link
Owner

Hi,
Indeed --enable-dpdk-pool will crash if no DPDK element is in the graph. I should initialize at least one memory pool no matter if there are devices or any DPDK element. For now, it's doing it only if a DPDKDevie or EnsureDPDKBuffer element is there.

The lightest temp solution for now would be to add a Idle -> EnsureDPDKBuffer -> Discard; as this will not require any physical device.

@rstory
Copy link
Author

rstory commented Jul 14, 2017

Yep, that works great. Thanks!

tbarbette pushed a commit that referenced this issue Apr 4, 2018
Packet::make needs DPDK in that case

Solves #46
@tbarbette
Copy link
Owner

Finally solved by the last commit ...

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

No branches or pull requests

2 participants