zephyr/arch
Alberto Escolar Piedras c044b2e916 posix arch: Fix very rare segfault on program termination
In some very rare cases (< 1/1000 runs), in very loaded machines,
a race in the glibc pthread_cancel() seems to be triggered.

In this the cancelled thread cleanup overtakes the pthread_cancel()
code, and frees the pthread structure before pthread_cancel()
has finished, resulting in a dereference into already
free'd memory, and therefore a segfault.
Calling pthread_cancel() during cleanup is not required beyond
preventing a valgrind memory leak report (all threads will be
stopped immediately on exit).
Therefore we stop doing this, to avoid this very rare crashes.

This issue was reproduced in Ubuntu 22.04, with its default
gcc 11.3.0 and glibc 2.35.
The issue may also have been seen very rarely in Zephyr's CI.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-27 17:02:36 +02:00
..
arc kernel: spinlock: LOCKED -> K_SPINLOCK 2023-07-10 09:27:21 +02:00
arm arch: arm: cortex_m: fault: Improve handling of fault escalation on armv6-m 2023-07-13 09:22:46 +02:00
arm64 soc: arm64: Add agilex5 soc folder and its configurations 2023-07-25 16:58:01 +00:00
common arch/common: Fix moving location counter backwards when using LLD 2023-07-14 12:08:02 +02:00
mips include: types: remove ulong_t 2022-09-06 18:16:33 +02:00
nios2 arch: nios2: Remove unused absolute symbols 2023-04-18 10:51:28 -04:00
posix posix arch: Fix very rare segfault on program termination 2023-07-27 17:02:36 +02:00
riscv soc: riscv: Add ability to use custom sys_io functions 2023-07-26 09:43:59 +02:00
sparc arch: sparc: Remove unused absolute symbols 2023-04-18 10:51:28 -04:00
x86 arch/x86: add more arch dcache functions 2023-07-11 11:33:16 -04:00
xtensa soc: xtensa,riscv: esp32xx: refactor folder structure 2023-07-25 18:12:33 +02:00
CMakeLists.txt cmake: fix include directories to work with out-of-tree arch 2020-08-05 08:06:07 -04:00
Kconfig Kconfig: Tidy up dependants of NATIVE_APPLICATION 2023-07-05 07:01:19 -04:00