From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by dpdk.org (Postfix) with ESMTP id 1906658D8 for ; Mon, 1 Aug 2016 20:02:04 +0200 (CEST) Received: by mail-lf0-f68.google.com with SMTP id 33so8817353lfw.3 for ; Mon, 01 Aug 2016 11:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=VjlI2duxLikN7ovyVfttnU1/RtNmQ3kCahmFQEqmqYk=; b=bYon4NqqQJ1P65neBnSr1rtmfDE4Uzisfk6dey2FAZwGKDN2Le6fL5spsVyyybWP6A +SmYIamZ5OT8iu/Azvym+EDul1LJBKSKUOhkMmtOALG0GR1nWZa02gpESY9f8z2zmZg/ bHodnrUOqgo7+LS0okXGWK/ZE15YBQktlNp6ae6fSVPD6ya/vPC7SB+vywFpRQbzLooO T+iMEFtGGtNGJ0aoYFM3dNdHfC6ziCVg3VoVDWonEZA3xy2XqZhO6n4/yWyOW0Ov8kah 5nBdFOX16OPHn5XKRX577agQd/T/GAbS6EQAwioO2zeP37MmjQ19qyzWk/5suneJ/0nm 044Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VjlI2duxLikN7ovyVfttnU1/RtNmQ3kCahmFQEqmqYk=; b=QTKlnyniwAYKyp/ILqBlOi7X6vK9fGfosu2RSu5rv3Jtpq0lCej11bygVuh7EZTe3o 7dr2ScreaQ4cxZzIwMU8FY/E0DZer7RA5BIeHoAQV96GLhIZMqoiLh5lq23V8RAnsF26 pZHj6/sE1OBYxmx8ujHsrac8cwXv8DUF04ifTe5CfdjB8ifgvEVxE2CqaL3EDJ6+Uqx0 skyTVPGnr+Sy1FzBq5cOEbsmuJA4KmqmdS6crDcNlFrkPR01GYBBcFdqZH0ndYFV7M4X pDf9nMsgw7cKzShheAY4jK4sf29zz8BD3+0pSRLV6Id3F9tsTIBsdM/vOnwxFTCmVeJB /M5Q== X-Gm-Message-State: AEkooutvDm8+m2/NC9Fjz4JfSQeKFvcM5/MD2FyqAwGMTtRC86afvpCtCGp7+1SAfRoja8pLqU5C5Mi1+d6/Xg== X-Received: by 10.25.20.226 with SMTP id 95mr16317514lfu.194.1470074523106; Mon, 01 Aug 2016 11:02:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.29.2 with HTTP; Mon, 1 Aug 2016 11:02:02 -0700 (PDT) From: txcy uio Date: Mon, 1 Aug 2016 11:02:02 -0700 Message-ID: To: users@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] segmentation fault: malloc_elem_alloc()-> LIST_REMOVE() [FreeBSD 10.3, dpdk-16.04) X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 18:02:04 -0000 Hello all, While running as a secondary process I received the segmentation fault as below on FreeBSD 10.3 and dpdk 16.04: Program received signal SIGSEGV, Segmentation fault - [Switching to Thread 801c06400 (LWP 100363/test_client)] 0x0000000000416dcf in malloc_elem_alloc (elem=0x838e57000, size=64, align=, bound=) at dpdk-16.04/lib/librte_eal/common/malloc_elem.c:196 196 LIST_REMOVE(elem, free_list); Current language: auto; currently minimal (gdb) bt #0 0x0000000000416dcf in malloc_elem_alloc (elem=0x838e57000, size=64, align=, bound=) at dpdk-16.04/lib/librte_eal/common/malloc_elem.c:196 #1 0x00000000004174a7 in malloc_heap_alloc (heap=0x800698a1c, type=, size=64, flags=, align=, bound=0) at dpdk-16.04/lib/librte_eal/common/malloc_heap.c:168 #2 0x0000000000416416 in rte_malloc_socket (type=0x41fdf8 "RING_TAILQ_ENTRY", size=24, align=, socket_arg=Error accessing memory address 0xffffffffffffffff: Bad address. ) at dpdk-16.04/lib/librte_eal/common/rte_malloc.c:91 #3 0x00000000004164d4 in rte_zmalloc (type=0x838e57000 "\034jj", size=24, align=0) at dpdk-16.04/lib/librte_eal/common/rte_malloc.c:126 #4 0x0000000000419044 in rte_ring_create (name=0x7fffffffe7e0 "spdk_active_pollers_6", count=4096, socket_id=0, flags=3) at dpdk-16.04/lib/librte_ring/rte_ring.c:177 Segmentation fault happened in line 518 below (sys/queue.h) 510 #define LIST_REMOVE(elm, field) do { \ 511 QMD_SAVELINK(oldnext, (elm)->field.le_next); \ 512 QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ 513 QMD_LIST_CHECK_NEXT(elm, field); \ 514 QMD_LIST_CHECK_PREV(elm, field); \ 515 if (LIST_NEXT((elm), field) != NULL) \ 516 LIST_NEXT((elm), field)->field.le_prev = \ 517 (elm)->field.le_prev; \ 518 *(elm)->field.le_prev = LIST_NEXT((elm), field); \ 519 TRASHIT(*oldnext); \ 520 TRASHIT(*oldprev); \ 521 } while (0) 522 It seems like the le_prev is not a valid address when being accessed from the secondary process however the same address is valid when accessed from the primary process (see below). Any idea what is going on here ? Secondary process : (gdb) p rte_config $1 = {master_lcore = 7, lcore_count = 2, lcore_role = {ROLE_OFF, ROLE_OFF, ROLE_OFF, ROLE_OFF, ROLE_OFF, ROLE_OFF, ROLE_RTE, ROLE_RTE, ROLE_OFF }, process_type = RTE_PROC_SECONDARY, mem_config = 0x800666000} (gdb) p (struct rte_mem_config)*0x800666000 $2 = {magic = 19820526, nchannel = 4, nrank = 0, mlock = {cnt = 0}, qlock = {cnt = 0}, mplock = {cnt = 0}, memzone_cnt = 22, memseg = {{phys_addr = 6442450944, {addr = 0x802000000, addr_64 = 34393292800}, len = 1073741824, hugepage_sz = 1073741824, socket_id = 0, nchannel = 0, nrank = 0}, {phys_addr = 0, {addr = 0x0, addr_64 = 0}, len = 0, hugepage_sz = 0, socket_id = 0, nchannel = 0, nrank = 0} }, memzone = {{ ..... malloc_heaps = {{lock = {locked = 1}, free_head = {{lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x838e57000}, {lh_first = 0x0}, {lh_first = 0x0}, { lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x0}, .. (gdb) p (struct malloc_elem)*0x838e57000 $3 = {heap = 0x8006a6a1c, prev = 0x838dd6fc0, free_list = {le_next = 0x838e59000, le_prev = 0x8006a6a34}, ms = 0x80067401c, state = ELEM_FREE, pad = 0, size = 4032} (gdb) p (struct malloc_elem)*0x838e59000 $4 = {heap = 0x8006a6a1c, prev = 0x838e57fc0, free_list = {le_next = 0x838e5e000, le_prev = 0x8006a6a34}, ms = 0x80067401c, state = ELEM_FREE, pad = 0, size = 4032} *(gdb) p (struct malloc_elem)*0x8006a6a34* *Error accessing memory address 0x8006a6a34: Bad address.* Primary process: (gdb) p rte_config $1 = {master_lcore = 0, lcore_count = 6, lcore_role = {ROLE_RTE, ROLE_RTE, ROLE_RTE, ROLE_RTE, ROLE_RTE, ROLE_RTE, ROLE_OFF }, process_type = RTE_PROC_PRIMARY, mem_config = 0x800674000} (gdb) p (struct rte_mem_config)*0x800674000 $2 = {magic = 19820526, nchannel = 4, nrank = 0, mlock = {cnt = 0}, qlock = {cnt = 0}, mplock = {cnt = 0}, memzone_cnt = 22, memseg = {{phys_addr = 6442450944, {addr = 0x802000000, addr_64 = 34393292800}, len = 1073741824, hugepage_sz = 1073741824, socket_id = 0, nchannel = 0, nrank = 0}, {phys_addr = 0, {addr = 0x0, addr_64 = 0}, len = 0, .... malloc_heaps = {{lock = {locked = 1}, free_head = {{lh_first = 0x0}, {lh_first = 0x0}, {lh_first = 0x838e57000}, ... (gdb) p (struct malloc_elem)*0x838e57000 $3 = {heap = 0x8006a6a1c, prev = 0x838dd6fc0, free_list = {le_next = 0x838e59000, le_prev = 0x8006a6a34}, ms = 0x80067401c, state = ELEM_FREE, pad = 0, size = 4032} *(gdb) p (struct malloc_elem)*0x8006a6a34* *$4 = {heap = 0x838e57000, prev = 0x0, free_list = {le_next = 0x0, le_prev = 0x0}, ms = 0x0, state = ELEM_FREE, pad = 0,* * size = 0}* --Tyc