Skip to content

[sanitizer] Don't ignore Symbolizer errors #67466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 26, 2023
Merged

Conversation

vitalybuka
Copy link
Collaborator

I am not sure why it's done this way, but it's the same
from the first commit, with no explanation.

I am not sure why it's done this way, but it's the same
from the first commit, with no explanation.
@llvmbot
Copy link
Member

llvmbot commented Sep 26, 2023

@llvm/pr-subscribers-compiler-rt-sanitizer

Changes

I am not sure why it's done this way, but it's the same
from the first commit, with no explanation.


Full diff: https://github.com/llvm/llvm-project/pull/67466.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp (+9-4)
diff --git a/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp b/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
index f6dac78337068b5..7ae4c159dfc7c55 100644
--- a/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
+++ b/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp
@@ -77,13 +77,16 @@ bool __sanitizer_symbolize_code(const char *ModuleName, uint64_t ModuleOffset,
       auto ResOrErr = getDefaultSymbolizer()->symbolizeInlinedCode(
           ModuleName,
           {ModuleOffset, llvm::object::SectionedAddress::UndefSection});
-      Printer->print(Request,
-                     ResOrErr ? ResOrErr.get() : llvm::DIInliningInfo());
+      Printer->print(Request, ResOrErr.get());
+      if (!ResOrErr)
+        return false;
     } else {
       auto ResOrErr = getDefaultSymbolizer()->symbolizeCode(
           ModuleName,
           {ModuleOffset, llvm::object::SectionedAddress::UndefSection});
-      Printer->print(Request, ResOrErr ? ResOrErr.get() : llvm::DILineInfo());
+      if (!ResOrErr)
+        return false;
+      Printer->print(Request, ResOrErr.get());
     }
   }
   return __sanitizer::internal_snprintf(Buffer, MaxLength, "%s",
@@ -105,7 +108,9 @@ bool __sanitizer_symbolize_data(const char *ModuleName, uint64_t ModuleOffset,
     auto ResOrErr = getDefaultSymbolizer()->symbolizeData(
         ModuleName,
         {ModuleOffset, llvm::object::SectionedAddress::UndefSection});
-    Printer->print(Request, ResOrErr ? ResOrErr.get() : llvm::DIGlobal());
+    if (!ResOrErr)
+      return false;
+    Printer->print(Request, ResOrErr.get());
   }
   return __sanitizer::internal_snprintf(Buffer, MaxLength, "%s",
                                         Result.c_str()) < MaxLength;

@vitalybuka vitalybuka merged commit c55e5d4 into llvm:main Sep 26, 2023
@vitalybuka vitalybuka deleted the error branch September 26, 2023 20:18
legrosbuffle pushed a commit to legrosbuffle/llvm-project that referenced this pull request Sep 29, 2023
I am not sure why it's done this way, but it's the same
from the first commit, with no explanation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants