From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by dpdk.org (Postfix) with ESMTP id 3942F2A5F for ; Wed, 27 Jul 2016 22:00:28 +0200 (CEST) Received: by mail-lf0-f67.google.com with SMTP id l89so2597213lfi.2 for ; Wed, 27 Jul 2016 13:00:28 -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=rNaflX0KPEo6Q+dboqFqmGE7ZhSCx+ijVZM+iGhe/Ws=; b=iDnxRDejOcGFb9xaXwoCv9zpiEqZRdLd0rtMYIlaAWdPCd2jeGE02DT4OTc/a1xb6w Y4dqr5mVgH8715f4vdULqc7BYmoAOYjJUKSqq5na+c30NphIoCincwYiehmRt3uuF7XM 2EvCBvyPcVX0CVQJ8tw5I8iTU1EsjvmvmdWbNnYOoKbUJwmN25/hVP0IXcxYYcMz3w5/ IktvqFb1deWBr1Mz7YirYeQedI4AmZW6AsSkoa385WcYkoaTSxh0/Z+e9AT6To+/2p5o 7bKk/nhkvMoTW8QbxEoj7svZglqOH8nqg9s8QkifpFLaNpogtdihBCudlIinNgykPtuW aZLQ== 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=rNaflX0KPEo6Q+dboqFqmGE7ZhSCx+ijVZM+iGhe/Ws=; b=FlZfTaWF4dhOlaUhDg4ItxN8yflPA/eM+4JI9UGi4XQQHFcdHBksPdhjMR3XHv1HS4 0c7f/z0e3B+TDsBVJ2CAI4nh1ie98dp4Dav7HGjtKNBRl+4a3tRKUJ/AQuOQx75T1Mk3 HPbRKtSmn9ylJZtDYBaDWIbi+IuVScF1O6fl2EiKJiO6njQtNg0f42BNaXGHcZy7FmCp Hksfg7aIGRmYBOG3Kuo5vVbloAGIRHAurHX/5ghewiauFx44rd9P7rsPxkeW4fvurr3+ iMgA2eQITajzW9d3nyaYrjNMbC4M+8zh9KN4BrHuBAZVm2vd2V/pTYaeDngV6GWFWIqt aGrw== X-Gm-Message-State: AEkoouvZ3wbzfLvLGtabJtOa78XBeFyzGO7Q6FJQvPZGQyJvQBmgVCkGGE2ydjI+XpGT37/WvkkfncIdC0d3kQ== X-Received: by 10.25.16.88 with SMTP id f85mr11109836lfi.21.1469649627487; Wed, 27 Jul 2016 13:00:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.29.2 with HTTP; Wed, 27 Jul 2016 13:00:26 -0700 (PDT) From: txcy uio Date: Wed, 27 Jul 2016 13:00:26 -0700 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] segmentation fault: malloc_elem_alloc()-> LIST_REMOVE() [FreeBSD 10.3, dpdk-16.04) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 20:00:28 -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