Skip to content

Commit 56ee6a1

Browse files
authored
[compiler-rt][nsan] Disable coredump creation (#98807)
Disable core dump creation. If NSAN_OPTIONS includes abort_on_error=1, the process may hang as the kernel attempts to create an excessively large core file. Fix #98806
1 parent e6ec7c8 commit 56ee6a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler-rt/lib/nsan/nsan.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,10 @@ int32_t checkFT(const FT value, ShadowFT Shadow, CheckTypeT CheckType,
537537
}
538538

539539
if (flags().halt_on_error) {
540-
Printf("Exiting\n");
540+
if (common_flags()->abort_on_error)
541+
Printf("ABORTING\n");
542+
else
543+
Printf("Exiting\n");
541544
Die();
542545
}
543546
return flags().resume_after_warning ? kResumeFromValue : kContinueWithShadow;
@@ -791,6 +794,8 @@ extern "C" SANITIZER_INTERFACE_ATTRIBUTE void __nsan_init() {
791794
InitializeSuppressions();
792795
InitializePlatformEarly();
793796

797+
DisableCoreDumperIfNecessary();
798+
794799
if (!MmapFixedNoReserve(TypesAddr(), UnusedAddr() - TypesAddr()))
795800
Die();
796801

0 commit comments

Comments
 (0)