0
0
mirror of https://github.com/llvm/llvm-project.git synced 2025-04-21 14:17:03 +00:00

[asan] Print diagnostic if unlimited stack size detected ()

This adds a diagnostic message if the stack size is unlimited. This would have simplified the diagnosis of https://github.com/google/sanitizers/issues/856#issuecomment-2747076811; we anticipate this may help diagnose future issues too.
This commit is contained in:
Thurston Dang 2025-03-27 08:55:36 -07:00 committed by GitHub
parent 64178316cf
commit e5ec87f3b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -451,6 +451,18 @@ static bool AsanInitInternal() {
DisableCoreDumperIfNecessary();
#if SANITIZER_POSIX
if (StackSizeIsUnlimited()) {
VPrintf(1,
"WARNING: Unlimited stack size detected. This may affect "
"compatibility with the shadow mappings.\n");
// MSan and TSan re-exec with a fixed size stack. We don't do that because
// it may break the program. InitializeShadowMemory() will, if needed,
// re-exec without ASLR, which solves most shadow mapping compatibility
// issues.
}
#endif // SANITIZER_POSIX
InitializeShadowMemory();
AsanTSDInit(PlatformTSDDtor);