Hi. I'll try to have a look in the next couple days. BR
> -----Original Message----- > From: Thomas Monjalon <tho...@monjalon.net> > Sent: Tuesday, May 27, 2025 3:54 PM > To: Rui Ferreira (A) <rui.ferrei...@h-partners.com> > Cc: dev@dpdk.org; sta...@dpdk.org; David Marchand > <david.march...@redhat.com>; Konstantin Ananyev > <konstantin.anan...@huawei.com> > Subject: Re: [PATCH v2] fix eal/linux: unregister alarm callback before free > > Hello, > > Did you see the comment from David about fixing for Windows and FreeBSD > at the same time? > I think you just need to apply the same logic in 3 different places. > If you cannot test all, that's OK to submit the changes without full coverage > testing. > > Thank you > > > 22/05/2025 17:59, Rui Ferreira: > > This was flagged by Address sanitizer as a use after free. The > > intr_handle ptr is shared between the main thread and the interrupt > > thread. The interrupt thread can dereference the ptr after free (from > > the alarm callback). free is called when the main thread cleans up. > > > > The interrupt thread never terminates (eal_intr_thread_main) so use > > rte_intr_callback_unregister_sync during cleanup to ensure the > > callback is removed before freeing the ptr. > > > > To be more defensive clear out the pointer and registration variable > > if we can unregister. > > > > rte_intr_callback_unregister_sync may (optionally) use traces so the > > alarm cleanup must happen before eal_trace_fini to avoid accessing > > freed memory. > > > > Bugzilla ID: 1683 > > > > Signed-off-by: Rui Ferreira <rui.ferrei...@h-partners.com> > > --- > > .mailmap | 1 + > > lib/eal/linux/eal.c | 3 ++- > > lib/eal/linux/eal_alarm.c | 9 ++++++++- > > 3 files changed, 11 insertions(+), 2 deletions(-) > >