aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2017-09-30 10:50:20 -0700
committersteven luong <sluong@cisco.com>2017-10-05 04:07:59 +0000
commit79bfbae54c8ecf4c87b42beee26b71e09e3eb494 (patch)
tree6b860992f63c9e8a48d2443108edf22eedfc3882
parentf3d627dd3c8130146429d3a884e0865b98d6a98d (diff)
memif: crash on slave mode (VPP-1006)
Crash was seen on recent image with this BT on top of the stack (gdb) bt full (mif=0x7fffb6226568) at /vpp/build-data/../src/plugins/memif/memif.c:297 ring = 0x0 <<<<<<<<<< i = 0 j = 0 buffer_offset = 65792 r = 0x7fffb5e59f80 alloc = {flags = 1, name = 0x7fffb449f965 "memif region", size = 4260096, numa_node = 0, addr = 0x7fff41dac000, fd = 11, log2_page_size = 12, n_pages = 1041} err = 0x0 __FUNCTION__ = "memif_init_regions_and_queues" The crash happened at this line. ring = memif_get_ring (mif, MEMIF_RING_S2M, i); ring=>head = ring->tail = 0; <===== Please note that the crash is caused by dereferencing NULL rinng. Put breakpoint into the function. I notice that mif->regions[0].shm is not initialized. (gdb) p mif->regions[0].shm $8 = (void *) 0x0 It looks like we forgot to set shm after clib_mem_vm_ext_alloc(). Add the missing cide and the crash is fixed. Change-Id: Ib722a6c241c77acfa8e33962106b57faa50e1ea7 Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit 9fefa9a697daf0e949ea7a2700ecaf2ba4d1d2cb)
-rw-r--r--src/plugins/memif/memif.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index 6a609a57..a3be49fa 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -290,6 +290,7 @@ memif_init_regions_and_queues (memif_if_t * mif)
return err;
r->fd = alloc.fd;
+ r->shm = alloc.addr;
for (i = 0; i < mif->run.num_s2m_rings; i++)
{