[PATCH v4] lib/eal: fix segfaults due to thread exit order

Zeng, ZhichaoX zhichaox.zeng at intel.com
Fri Jun 24 03:42:12 CEST 2022


Hi David, Harman
    Please review this patch at your convenience, it's been about a month since the v1 version.
    Thanks!

Best regards
Zhichao

> -----Original Message-----
> From: Zeng, ZhichaoX <zhichaox.zeng at intel.com> 
> Sent: Wednesday, June 15, 2022 2:02 PM
> To: dev at dpdk.org
> Cc: stable at dpdk.org; Yang, Qiming <qiming.yang at intel.com>; david.marchand at redhat.com; stephen at networkplumber.org; mb at smartsharesystems.com; Zeng, ZhichaoX <zhichaox.zeng at intel.com>; Richardson, Bruce > <bruce.richardson at intel.com>; Harman Kalra <hkalra at marvell.com>
> Subject: [PATCH v4] lib/eal: fix segfaults due to thread exit order
>
> From: Zhichao Zeng <zhichaox.zeng at intel.com>
>
> The eal-intr-thread is not closed before memory cleanup in the process of exiting. There is a small probability that when the eal-intr-thread is about to use some pointers, the memory were just cleaned, which cause the > segment fault error caught by ASan.
>
> This patch close the eal-intr-thread before memory cleanup when exiting to avoid segment fault. And add some atomic operations to avoid executing rte_eal_cleanup in the child process spawned by fork() in some test > cases, e.g. debug_autotest of dpdk-test.
>
> Cc: stable at dpdk.org
>
> ---
> v2:
> add the same API for FreeBSD
> ---
> v3:
> fix rte_eal_cleanup crash in debug_autotest
> ---
> v4:
> shorten the prompt message and optimize the commit log
>
> Suggested-by: David Marchand <david.marchand at redhat.com>
> Signed-off-by: Zhichao Zeng <zhichaox.zeng at intel.com>


More information about the stable mailing list