[Lldb-commits] [lldb] 5a4b2e1 - The AssertRecognizer used the module from a frames SC without checking it was non-null.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 13 11:42:36 PST 2020


Author: Jim Ingham
Date: 2020-11-13T11:41:32-08:00
New Revision: 5a4b2e1541f399c146a4ef5cf8f6aaf8b258a77b

URL: https://github.com/llvm/llvm-project/commit/5a4b2e1541f399c146a4ef5cf8f6aaf8b258a77b
DIFF: https://github.com/llvm/llvm-project/commit/5a4b2e1541f399c146a4ef5cf8f6aaf8b258a77b.diff

LOG: The AssertRecognizer used the module from a frames SC without checking it was non-null.

I only have a crash report for this.  I could reproduce it with a slightly older
lldb by running an expression that called pthread_kill, but we started making modules
for our expression JIT code, so that no longer triggers the bug.  I can't think of another
good way to test it but the fix is obvious.

Added: 
    

Modified: 
    lldb/source/Target/AssertFrameRecognizer.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Target/AssertFrameRecognizer.cpp b/lldb/source/Target/AssertFrameRecognizer.cpp
index fe5fa3a362f8..cb671040d14f 100644
--- a/lldb/source/Target/AssertFrameRecognizer.cpp
+++ b/lldb/source/Target/AssertFrameRecognizer.cpp
@@ -130,7 +130,8 @@ AssertFrameRecognizer::RecognizeFrame(lldb::StackFrameSP frame_sp) {
     SymbolContext sym_ctx =
         prev_frame_sp->GetSymbolContext(eSymbolContextEverything);
 
-    if (!sym_ctx.module_sp->GetFileSpec().FileEquals(location.module_spec))
+    if (!sym_ctx.module_sp ||
+        !sym_ctx.module_sp->GetFileSpec().FileEquals(location.module_spec))
       continue;
 
     ConstString func_name = sym_ctx.GetFunctionName();


        


More information about the lldb-commits mailing list