From: David Marchand <david.marchand@redhat.com>
To: fengchengwen <fengchengwen@huawei.com>,
Jerin Jacob <jerinj@marvell.com>,
Andre Muezerie <andremue@linux.microsoft.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>,
Kevin Laatz <kevin.laatz@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [EXTERNAL] Re: [PATCH 1/2] lib/dmadev: eliminate undefined behavior
Date: Thu, 30 Jan 2025 16:00:51 +0100 [thread overview]
Message-ID: <CAJFAV8yFREsLiV=kp4PPDcCA_=rkp1ppqt_mhXanETzfyFHUpQ@mail.gmail.com> (raw)
In-Reply-To: <CAJFAV8z6pQAddX+ajSxwZDMGDXdQu28c06MPwN1-EYA_QiE34Q@mail.gmail.com>
On Fri, Jan 24, 2025 at 12:13 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Tue, Dec 10, 2024 at 1:58 AM fengchengwen <fengchengwen@huawei.com> wrote:
> > > + @Chengwen Feng
> > >
> > > This kind of patten is not used other places like ethdev traces, Why we need this kind of pattern in dmadev?
> > > Looks like, it can be fixed by caller of this function by initializing struct rte_dma_info. So may not need a fixup patch to begin with
> >
> > It's strange that no other library doesn't have this problem.
> >
> > When I first add tracepoints support for dmadev, there is no such macro (just like other library),
> > but the CI report ASAN error.
> >
> > The rootcause is that register:
> > RTE_TRACE_POINT_REGISTER(rte_dma_trace_info_get,
> > lib.dmadev.info_get)
> > it will invoke :
> > __rte_trace_point_register(&__rte_dma_trace_info_get, __rte_dma_trace_info_get_lib.dmadev.info_get,
> > (void (*)(void)rte_dma_trace_info_get) {
> > rte_dma_trace_info_get();
> > }
> >
> > But rte_dma_trace_info_get() it was defined with parameters: int16_t dev_id, struct rte_dma_info *dev_info
> > If we force invoke rte_dma_trace_info_get() without pass any parameter, it may lead to ASAN problem because
> > the parameter's corresponding register was not set (and it's value undefine).
>
> I remember of an issue with tracepoint and *UB*SAN, but I fail to see
> how ASAN is affected (plus I see that the CI runs the tracepoint
> autotests with ASAN).
> Can you clarify?
>
> In any case, this looks like something that should be handled at the
> tracepoint framework level, and not silenced/wrapped around in the
> dmadev library.
Fengcheng, Jerin, André, could you please have a look at this patch:
https://patchwork.dpdk.org/project/dpdk/patch/20250130145849.82003-3-david.marchand@redhat.com/
Thanks!
--
David Marchand
next prev parent reply other threads:[~2025-01-30 15:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 19:27 [PATCH 0/2] enable dmadev lib to be compiled with MSVC Andre Muezerie
2024-12-06 19:27 ` [PATCH 1/2] lib/dmadev: eliminate undefined behavior Andre Muezerie
2024-12-09 12:58 ` Bruce Richardson
2024-12-09 23:21 ` [EXTERNAL] " Jerin Jacob
2024-12-10 0:58 ` fengchengwen
2025-01-24 11:13 ` David Marchand
2025-01-30 15:00 ` David Marchand [this message]
2024-12-06 19:27 ` [PATCH 2/2] lib/dmadev: enable dmadev lib to be compiled with MSVC Andre Muezerie
2024-12-09 1:53 ` [PATCH 0/2] " fengchengwen
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='CAJFAV8yFREsLiV=kp4PPDcCA_=rkp1ppqt_mhXanETzfyFHUpQ@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=andremue@linux.microsoft.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=jerinj@marvell.com \
--cc=kevin.laatz@intel.com \
/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).