From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2491FA00BE; Thu, 9 Jun 2022 17:24:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15064427EC; Thu, 9 Jun 2022 17:24:37 +0200 (CEST) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 1ADA640220 for ; Thu, 9 Jun 2022 17:24:36 +0200 (CEST) Received: by mail-pj1-f45.google.com with SMTP id w13-20020a17090a780d00b001e8961b355dso9753972pjk.5 for ; Thu, 09 Jun 2022 08:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mTI4czJ0QlDuH799Goas96rRwNiVb/3KUBJ82xsduh0=; b=PpyMpe/mVmBV4RZLmi3ymwxH8VxcqkqDB8urSEdlw8WRznh4e15Rz/BflAaBoBdmfP IAQHMksHJSz3/itqK2E7EvaRblyqlQy6fA1FhMKwt/A8Nog7IWmjjz2PBcWqx2VbHozY CdBdHq4K406ofXC71u9DGWmi21qz2tYmWGx5dM6mmy/gzdC1f6mWaH0c6lBT5+Wbn/s8 fn9u1HYvAE3blYJ3pPmKb2AkgsHz8AGNP6Y8At8WluEoePIVhwWHOfRpU4raKjDNwpmI +YJs6yVzubeqX39NAJFZBF82aQLGNnGNcgG5sQ2azfwxRXwsK4tGnaiOE5hCajA+nQvL p+vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mTI4czJ0QlDuH799Goas96rRwNiVb/3KUBJ82xsduh0=; b=ft32okBWcFVK9QrAWny75LRthibxLuswm8dWK1G0ajNs3QaSyOX8OP1KRRvKEwto1D 9yeZcceAo7Z3Zv7DV7o3TuPKZ//09TKTAjGZ1sLDmi3RxUfnpazjJBxDcjPKISziQ1ms 54KlPmDKUP6Z9DjAZnAsNR/ixYcQ9QEThpeUor+jX7cT9Dvvr7m5+eW0Q9PAPM7yMAyH jr74yt9PJCqottLYXvk74Ozlycuw60yC7KIL2keng2Q7uRj4dUUKBfbWaZq7EER1/arZ mfVLorGWD/8du2jFOg6U/7y4fCqC5qGqH3ueY9thgnq4D8+bcCvMQC721V+TnmUq2AtE eDZg== X-Gm-Message-State: AOAM533TtLgVLWfieKAg1m8kjTAfx5AW/J2HuFbYk+KMW5MiCtfUt8Xs jpfBG4uNB2Uk9mHLy4JVzFbBXQ5FAGgDMQ== X-Google-Smtp-Source: ABdhPJy5l74rdynaCbMj08nhT8oVrVnVO44+zopC3g6dEB08qEx8lEXCqhDTa5wSifQL+88V/AEgRg== X-Received: by 2002:a17:90a:a096:b0:1df:58d7:5b20 with SMTP id r22-20020a17090aa09600b001df58d75b20mr3947193pjp.212.1654788275132; Thu, 09 Jun 2022 08:24:35 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id z20-20020a634c14000000b003fd8438db7bsm10252869pga.58.2022.06.09.08.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 08:24:34 -0700 (PDT) Date: Thu, 9 Jun 2022 08:24:32 -0700 From: Stephen Hemminger To: "halsey.pian@longsys.com" Cc: "dev@dpdk.org" Subject: Re: =?UTF-8?B?44CQcnRlX21hbGxvYw==?= & =?UTF-8?B?ZnJlZeOAkXRoZQ==?= issue of crashing at malloc_elem_free Message-ID: <20220609082432.40f631d3@hermes.local> In-Reply-To: <95F5C09B652250489A8640C2D0DF5BD0BF991F7A@lsex.goodwill-ic.com> References: <95F5C09B652250489A8640C2D0DF5BD0BF991F7A@lsex.goodwill-ic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 9 Jun 2022 09:17:33 +0000 "halsey.pian@longsys.com" wrote: > Dear All, > > I am suffering an crash issue recently. My app based on SPDK/DPDK uses rte_malloc_socket and rte_free to use hugepage feature in multi-threads and async programming environment. > > Unfortunately, It would crashed sometimes, and I found that it usually crashed caused by the element's size = 0 in function malloc_elem_free at line 570 in file malloc_elem.c during calling rte_free, the call stack is as the attachment. > > I am not sure if I miss some information related async and multi-thread programing using DPDK rte_malloc module. > > BTW, it works fine when I switch to kernel's malloc/free. Does it work if you enable address sanitizer and use regular glibc malloc/free? What about with valgrind? You can also build DPDK with RTE_MALLOC_DEBUG which adds more checks for clobbering. I suspect your code is writing outside the allocated space or has a use after free.