A segment fault error in DPDK 17.02

Bug #1774903 reported by Yi-y-yang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
Undecided
Yi-y-yang
Trunk
Fix Committed
High
Yi-y-yang
OpenContrail
New
Undecided
Unassigned

Bug Description

I found a segment fault error in DPDK 17.02 branch, here is my core dump information:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 _mm_storeu_si128 (__B=..., __P=<optimized out>) at /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:702
702 __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B);
(gdb) bt
#0 _mm_storeu_si128 (__B=..., __P=<optimized out>) at /usr/lib/gcc/x86_64-linux-gnu/4.8/include/emmintrin.h:702
#1 rte_memcpy_generic (dst=0x7fadd69faff0, src=0x7fadb8571a52, n=18446744073709543774)
    at build/production/vrouter/dpdk/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:820
#2 0x0000000000539615 in rte_memcpy (n=18446744073709551582, src=<optimized out>, dst=0x7fadd69f91f0)
    at build/production/vrouter/dpdk/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:896
#3 dpdk_pheader_pointer (pkt=0x7fadb856fa80, hdr_len=<optimized out>, buf=0x7fadd69f91f0)
    at vrouter/dpdk/vr_dpdk_host.c:793
#4 0x00000000005778c6 in vr_udp_input (router=0x55f49a0 <router>, pkt=0x7fadb856fa80, fmd=0x7fadd69f9440)
    at vrouter/dp-core/vr_proto_ip.c:373
#5 0x9b45030101010401 in ?? ()
#6 0x6c6b9e851a00ab6c in ?? ()
#7 0x74737271706f6e6d in ?? ()
#8 0x31307a7978777675 in ?? ()
#9 0x0000000000000000 in ?? ()
(gdb)

We had a change for DPDK 17.11, the below change is in contrail-vrouter master (including 5.0 branch)

diff --git a/dpdk/vr_dpdk_host.c b/dpdk/vr_dpdk_host.c
index c4fa21d..d4b5c59 100644
--- a/dpdk/vr_dpdk_host.c
+++ b/dpdk/vr_dpdk_host.c
@@ -246,6 +246,9 @@ dpdk_pktmbuf_data_copy(struct rte_mbuf *dst, struct rte_mbuf *src)
     dst->data_off = src->data_off;
     dst->port = src->port;
     dst->ol_flags = src->ol_flags;
+#if (RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 0))
+ dst->ol_flags &= (~IND_ATTACHED_MBUF);
+#endif
     dst->packet_type = src->packet_type;
     dst->data_len = src->data_len;
     dst->pkt_len = src->pkt_len;

I checked DPDK 17.02, it has defined IND_ATTACHED_MBUF, so it also has the same issue, I have fixed and verified it, will have a gerrit commit after file this bug.

Tags: 5.0 master
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/43488
Submitter: Yi Yang (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/43488
Committed: http://github.com/Juniper/contrail-vrouter/commit/e866729fec6315bb4d62ccc2c3e891f4566644fa
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit e866729fec6315bb4d62ccc2c3e891f4566644fa
Author: Yi Yang <email address hidden>
Date: Mon Jun 4 14:04:09 2018 +0800

Fix a segment fault error for DPDK 17.02

I found a segment fault error when I use DPDK 17.02 branch, here is
segment fault information:

Program terminated with signal SIGSEGV, Segmentation fault.
702 __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B);
(gdb) bt
at build/production/vrouter/dpdk/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:820
at build/production/vrouter/dpdk/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:896
at vrouter/dpdk/vr_dpdk_host.c:793
at vrouter/dp-core/vr_proto_ip.c:373
(gdb)

We encountered it in DPDK 17.11 branch, the issue is rte_mbuf can't be freed
if it is copied or cloned from another rtm_mbuf with IND_ATTACHED_MBUF flag,
it will result in very weird issues.

Change-Id: Iae6d229488225a97ef2f96c52db1dbcaaa32b51a
Closes-Bug: #1774903
Signed-off-by: Yi Yang <email address hidden>

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

Review in progress for https://review.opencontrail.org/44916
Submitter: Jeya ganesh babu (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/44916
Committed: http://github.com/Juniper/contrail-vrouter/commit/aeace07394c03a48e83f6dd9c63aa17660b4bf33
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit aeace07394c03a48e83f6dd9c63aa17660b4bf33
Author: Yi Yang <email address hidden>
Date: Mon Jun 4 14:04:09 2018 +0800

Fix a segment fault error for DPDK 17.02

I found a segment fault error when I use DPDK 17.02 branch, here is
segment fault information:

Program terminated with signal SIGSEGV, Segmentation fault.
702 __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B);
(gdb) bt
at build/production/vrouter/dpdk/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:820
at build/production/vrouter/dpdk/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:896
at vrouter/dpdk/vr_dpdk_host.c:793
at vrouter/dp-core/vr_proto_ip.c:373
(gdb)

We encountered it in DPDK 17.11 branch, the issue is rte_mbuf can't be freed
if it is copied or cloned from another rtm_mbuf with IND_ATTACHED_MBUF flag,
it will result in very weird issues.

Change-Id: Iae6d229488225a97ef2f96c52db1dbcaaa32b51a
Closes-Bug: #1774903
Signed-off-by: Yi Yang <email address hidden>
(cherry picked from commit e866729fec6315bb4d62ccc2c3e891f4566644fa)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.