DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: 杨佳昊 <yang_jiahao@venusgroup.com.cn>
Cc: dev <dev@dpdk.org>
Subject: Re: confusion about dpdk asan
Date: Thu, 14 Sep 2023 12:42:20 +0200	[thread overview]
Message-ID: <CAJFAV8xug+1r2mTC5UnH0Ud3bHihJLpmV1G+qsZNky+UAuq+HA@mail.gmail.com> (raw)
In-Reply-To: <a635771d7b829a14e162d4b19c422e635c32817f.f0d2fe5e.6b76.4a87.a832.a4fc4b015956@feishu.cn>

On Thu, Sep 14, 2023 at 10:59 AM 杨佳昊 <yang_jiahao@venusgroup.com.cn> wrote:
>
> Thank you for your reply.

Please, let's keep this discussion on the ml.
Anybody can help and this thread may help others having issues with ASan.
Let's try to understand if something is wrong in your setup or if
there is a bug in the doc or example code.


You mentionned initially those versions:
Gcc :9.3.0
Libasan: 4.8.5

Which distribution is it?
It looks close to a Ubuntu 20.04, but latest 20.04 has a more recent
version of gcc (9.4 with libasan 5.x)


> Sorry for not describing it in detail.
> I compile dpdk with cmd:
> meson setup -Db_sanitize=address build -Dmax_numa_nodes=1 -Dexamples=helloworld

Well, this segfault is strange and I am suspecting an issue out of
DPDK (in libasan itself?).
As I mentionned in my first mail, what happens if you compile without
-Db_sanitize=address and run the example?


If you don't reproduce the segfault without ASan, my next request is
to try to run with some debug traces in ASan:
ASAN_OPTIONS=verbosity=1 ./build/examples/dpdk-helloworld etc...

Alternatively, recompile with debug symbols and run the example
through gdb to get a better backtrace.


> I added code as what asan.txt do:
>
> char *p = rte_zmalloc(NULL, 9, 0);
> if (!p) {
>     printf("rte_zmalloc error.\n");
>     return -1;
> }
> p[9] = 'a';
>
> But the result is exactly as described in the previous email.

I tried adding this block on the 21.11 branch, in a Ubuntu 20.04.6 container.
As I mentionned above, this container has a gcc 9.4 version, coming
with a libasan 5 and I get the expected output from ASan.


-- 
David Marchand


  parent reply	other threads:[~2023-09-14 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14  2:20 杨佳昊
2023-09-14  8:25 ` David Marchand
     [not found]   ` <a635771d7b829a14e162d4b19c422e635c32817f.f0d2fe5e.6b76.4a87.a832.a4fc4b015956@feishu.cn>
2023-09-14 10:42     ` David Marchand [this message]
2023-09-18  3:08       ` Stephen Hemminger
2023-09-18  2:53   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJFAV8xug+1r2mTC5UnH0Ud3bHihJLpmV1G+qsZNky+UAuq+HA@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=yang_jiahao@venusgroup.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).