> On Tue, Nov 05, 2024 at 09:19:25AM +0100, David Marchand wrote:
> > Hello Andre,
> >
> > Thanks for taking over this series.
> >
> > On Tue, Nov 5, 2024 at 4:18 AM Andre Muezerie
> > <andre...@linux.microsoft.com> wrote:
> > >
> > > From: Konstantin Ananyev <konstantin.anan...@huawei.com>
> > >
> > > 1) ./lib/eal/linux/eal_interrupts.c:1073:16
> > >     : warning: ISO C90 forbids variable length array ‘events’
> > >
> > > eal_intr_handle_interrupts() is called by eal_intr_thread_main()
> > > so it seems ok to simply alloc space for events from heap and reuse the
> > > same buffer through the life of the thread.
> >
> > ASan reports this allocation as a leak because nothing releases it
> > when terminating the interrupt thread.
> >
> > =================================================================
> > ==83289==ERROR: LeakSanitizer: detected memory leaks
> >
> > Direct leak of 12300 byte(s) in 1 object(s) allocated from:
> >     #0 0x55903c9a54b6 in __interceptor_realloc
> > (/home/runner/work/dpdk/dpdk/build/app/dpdk-test+0x2744b6) (BuildId:
> > e8a4f6c67f5c6afc20efb5f168c0df885d4c6493)
> >     #1 0x7f0011ee8873 in eal_intr_thread_main
> > /home/runner/work/dpdk/dpdk/build/../lib/eal/linux/eal_interrupts.c:1174:8
> >     #2 0x7f0010694ac2 in start_thread nptl/./nptl/pthread_create.c:442:8
> >
> > SUMMARY: AddressSanitizer: 12300 byte(s) leaked in 1 allocation(s).
> > ------------------------------------------------------------------------------
> >
> > It will need some rework.

My bad, forgot that interrupt thread never exits normally.
As I saw Andre already updated a patch with revering back to alloca(),
which I suppose is ok.
Though I wonder would pthread_cleanup_push() and keeping realloc()
be a good alternative here?

Reply via email to