diff mbox

segfault with mmap sockets

Message ID 1421175600-26213-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Jan. 13, 2015, 7 p.m. UTC
Does somebody already works on that? I see that only mmap case crashes with
corrupted ring. If not I will debug that tomorrow.

Program terminated with signal 11, Segmentation fault.
    if_mac=0x2b1409dc7fa0 "") at odp_packet_socket.c:486
486			if (mmap_rx_kernel_ready(ring->rd[frame_num].iov_base)) {
(gdb) bt
    if_mac=0x2b1409dc7fa0 "") at odp_packet_socket.c:486
    at odp_packet_socket.c:500
Backtrace stopped: frame did not save the PC
(gdb) p ring
$1 = (struct ring *) 0x3000000000000000
---
 test/validation/odp_pktio.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox

Patch

diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
index d1eb0d5..d462bfa 100644
--- a/test/validation/odp_pktio.c
+++ b/test/validation/odp_pktio.c
@@ -205,6 +205,7 @@  static odp_pktio_t create_pktio(const char *iface)
 	char pool_name[ODP_BUFFER_POOL_NAME_LEN];
 	odp_buffer_pool_param_t params;
 
+	printf("openning dev %s\n", iface);
 	params.buf_size  = PKT_BUF_SIZE;
 	params.buf_align = 0;
 	params.num_bufs  = PKT_BUF_NUM;
@@ -472,6 +473,19 @@  static void test_odp_pktio_mac(void)
 	return;
 }
 
+static void test_odp_pktio_segtest(void)
+{
+	odp_pktio_t pktio = create_pktio(iface_name[0]);
+	int i;
+
+	CU_ASSERT(pktio != ODP_PKTIO_INVALID);
+
+	CU_ASSERT(create_inq(pktio) == 0);
+
+	for (i = 0; i < 100; i++)
+		 odp_schedule(NULL, ODP_TIME_MSEC);
+}
+
 static void test_odp_pktio_open(void)
 {
 	odp_pktio_t pktio;
@@ -510,7 +524,11 @@  static void test_odp_pktio_inq(void)
 {
 	odp_pktio_t pktio;
 
+	printf("openning dev %s\n", iface_name[0]);
+
 	pktio = create_pktio(iface_name[0]);
+
+
 	CU_ASSERT(pktio != ODP_PKTIO_INVALID);
 
 	CU_ASSERT(create_inq(pktio) == 0);
@@ -582,6 +600,7 @@  CU_TestInfo pktio_tests[] = {
 	{"pktio mtu",		test_odp_pktio_mtu},
 	{"pktio promisc mode",	test_odp_pktio_promisc},
 	{"pktio mac",		test_odp_pktio_mac},
+	{"pktio segtest",	test_odp_pktio_segtest},
 	CU_TEST_INFO_NULL
 };