Uploaded image for project: 'vpp'
  1. vpp
  2. VPP-1006

memif: crash on slave mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Open
    • Icon: Medium Medium
    • None
    • None
    • Devices
    • None

      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)

            sluong steven luong
            sluong steven luong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: