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 4F2B0A00C3; Fri, 17 Jun 2022 18:17:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE02340F19; Fri, 17 Jun 2022 18:17:58 +0200 (CEST) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mails.dpdk.org (Postfix) with ESMTP id 07DE140DDD for ; Fri, 17 Jun 2022 18:17:56 +0200 (CEST) Received: by mail-pf1-f170.google.com with SMTP id bo5so4569425pfb.4 for ; Fri, 17 Jun 2022 09:17:56 -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=CRiIoqH8IbCU9P6OPfMq2TTc3PLH2S1GW7w0GBe0ENw=; b=NR7yUWWq4zJZF4eS5i0zmVyLwJJU6veNI1zfSh778sCoIPUyAxDGLDIj/KvNX9GsM3 0dvn7k2uvgyev8TQ7FpYPRRx5NwCp3JVZMm773z+0yY81A8hP18n7CTqRJeq5aTnzMQD cWGI2xF71eXOC9QE5b/xpnkJyniKYFeaXfHfxKSkNgl9QcKOEEfcmPIKKb5E4UsWTE1J Ax9ubpb5A0ESUUF7xBnsOvl+XN9sCC9xPeQW9WzYlJcfMwpjq0I9sBkWKVBCEnZXUP81 0XunaD5VxaKb6UfR8YsuOL9S5lGKcD3pdu9t5VkhuGnXqe+fkjnRTxZkUjGKg+c0C9XT Rm8A== 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=CRiIoqH8IbCU9P6OPfMq2TTc3PLH2S1GW7w0GBe0ENw=; b=fcLxBE/ISaI031cIjtVxRFLqvxVB2Gu1OhxDOhkKErHjCVeAo9T3DdnuNVJtEHAyX3 SWXnFyTrBDvuZPpfIryv0tKW8KcTIR+2K5Nu2haI3W8yLFIWO6L/Iu4+7eJaQaHfypUE KBBRdFnN84AiIdnnvKZv7ust2NDICtnld+1cOIgNBs33WJsQ1aYi/LgUNn167o2Hoy73 6kpOESf8s6jdghH3GHIFEK11qBUJnDBZ2psczqFcQIqAb5E1CNDKwzZx91uN9fSrFQr3 SQby6M0Y6JQffG1xq0Znoa4LNRa46YoWH/LKUENp1KF1sFsu0cK+fOuTz/NLcU5iJrky pDCA== X-Gm-Message-State: AJIora+k0tw0i7gsxCLjhUgG+tlXmGj2xHS3teUHGo9Sn818byaix2Hu zTV348CKAOD139e1VTk59DLEaA== X-Google-Smtp-Source: AGRyM1vFnJo6lxXbK0eXA2sSbdXE1VFzjttdiGK/v5CfMsE1R4onna6Zb1d//wlFop93n+OlGh5Zgg== X-Received: by 2002:a65:6bd6:0:b0:39d:4f85:9ecf with SMTP id e22-20020a656bd6000000b0039d4f859ecfmr9887256pgw.336.1655482675915; Fri, 17 Jun 2022 09:17:55 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id i64-20020a628743000000b0051b930b7bbesm3954477pfe.135.2022.06.17.09.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 09:17:55 -0700 (PDT) Date: Fri, 17 Jun 2022 09:17:51 -0700 From: Stephen Hemminger To: David Marchand Cc: "Juan Pablo L." , "users@dpdk.org" , "Burakov, Anatoly" , Dmitry Kozlyuk , dev , ci@dpdk.org Subject: Re: dpdk address sanitizer Message-ID: <20220617091751.05b64e64@hermes.local> In-Reply-To: References: 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 Fri, 17 Jun 2022 07:45:33 +0200 David Marchand wrote: > Hello, > > On Fri, Jun 17, 2022 at 6:08 AM Juan Pablo L. > wrote: > > > > Hello, I am new to dpdk ... i would like to trace memory usage and detect memory leaks, valgrind as well as address sanitizer (gcc) report some memory loss at application end. For the life of me, i cannot figure it out ... i just write a simple program that has the rte_eal_init + rte_eal_cleanup and i get the following error (also tried helloworld from examples, with same results): > > > > ==3399==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f6ca3efb480 at pc 0x7f6ca7162b61 bp 0x7f6ca3efb450 sp 0x7f6ca3efac00 > > WRITE of size 24 at 0x7f6ca3efb480 thread T-1 > > #0 0x7f6ca7162b60 in __interceptor_sigaltstack.part.0 (/lib64/libasan.so.8+0x61b60) > > #1 0x7f6ca71d9337 in __sanitizer::UnsetAlternateSignalStack() (/lib64/libasan.so.8+0xd8337) > > #2 0x7f6ca71c90f4 in __asan::AsanThread::Destroy() (/lib64/libasan.so.8+0xc80f4) > > #3 0x7f6ca679b000 in __GI___nptl_deallocate_tsd (/lib64/libc.so.6+0x8a000) > > #4 0x7f6ca679dc9d in start_thread (/lib64/libc.so.6+0x8cc9d) > > #5 0x7f6ca68235df in __GI___clone3 (/lib64/libc.so.6+0x1125df) > > > > Address 0x7f6ca3efb480 is a wild pointer inside of access range of size 0x000000000018. > > SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.8+0x61b60) in __interceptor_sigaltstack.part.0 > > Shadow bytes around the buggy address: > > 0x0fee147d7640: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 > > 0x0fee147d7650: 00 00 00 00 00 00 00 00 00 06 f2 f2 f2 f2 00 00 > > 0x0fee147d7660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > 0x0fee147d7670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > 0x0fee147d7680: 00 00 00 00 00 00 00 00 00 00 00 04 f3 f3 f3 f3 > > =>0x0fee147d7690:[f3]f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 > > 0x0fee147d76a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > 0x0fee147d76b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > 0x0fee147d76c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > 0x0fee147d76d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > 0x0fee147d76e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > Shadow byte legend (one shadow byte represents 8 application bytes): > > Addressable: 00 > > Partially addressable: 01 02 03 04 05 06 07 > > Heap left redzone: fa > > Freed heap region: fd > > Stack left redzone: f1 > > Stack mid redzone: f2 > > Stack right redzone: f3 > > Stack after return: f5 > > Stack use after scope: f8 > > Global redzone: f9 > > Global init order: f6 > > Poisoned by user: f7 > > Container overflow: fc > > Array cookie: ac > > Intra object redzone: bb > > ASan internal: fe > > Left alloca redzone: ca > > Right alloca redzone: cb > > ==3399==ABORTING > > > > I am not sure what I m doing wrong but it is very frustrating. On top of that, I try other scenarios and see if I can just "ignore" that and still detect other memory leaks but it does not work. I get memory from rte_malloc and don't free it and I still get the above report only, I do not get any report from the memory I leaked intentionally ... no difference what so ever .... I tried the same with the helloworld example and I get the same results .... > > I experienced the same issue recently on Fedora 36. > I did not investigate. > > I think I waived this warning, by setting > ASAN_OPTIONS="use_sigaltstack=0" in the environment. > HTH. > Looks like the alternate signal stack allocated inside address sanitizer is not big enough.