[PATCH] [PATCH v5] app/testpmd: fix segfault in secondary process by monitoring primary

Varghese, Vipin Vipin.Varghese at amd.com
Mon Aug 11 12:23:41 CEST 2025


[AMD Official Use Only - AMD Internal Distribution Only]

Hi Stephen,

Snipped

> > Hi Khadem,
> >
> > Snipped
> >
> > >
> > >
> > > Hi Stephen,
> > >
> > > Many thanks for the fix and for the suggestion that the secondary
> > > should exit immediately without attempting any cleanups once it detects the
> primary has exited.
> >
> > Can you please explain why cleanup of secondary resources are not to be done,
> If there is specific memory like external hugepage backed mempool none of the
> callback will be called. Also releasing internal stack memory and heap of secondary
> is not cleaned.

@Khadem Ullah can you please share if secondary application is not able allocate external memory and run.
Can you please confirm running the same?

> >
> > Is there specific reason why you do not want to clean? If yes, can you please
> point to the right direction what is breaking?
>
> What happens is that both primary and secondary process have a list head that
> lists devices (like ethdev).  The ethdev's shared part lives in huge pages.
> When primary exits, it calls the cleanup which frees the list (local part) and the
> shared part.  When secondary calls cleanup, its local part now points to freed data
> in shared huge pages. That leads to all sorts of issues.
>
>
> There is no need for secondary to do any cleanup, all the local memory disappears
> when process exits.

As shared in other email threads, the reason for the patch as far I followed `at segfault of primary secondary crashes, @Khadem Ullah can you please share the details.`

>
> Also, there is no locking between primary and secondary process.




More information about the dev mailing list