The AssertRecognizer used the module from a frames SC without checking it was non...
authorJim Ingham <jingham@apple.com>
Fri, 13 Nov 2020 19:36:17 +0000 (11:36 -0800)
committerJim Ingham <jingham@apple.com>
Fri, 13 Nov 2020 19:41:32 +0000 (11:41 -0800)
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.

lldb/source/Target/AssertFrameRecognizer.cpp

index fe5fa3a..cb67104 100644 (file)
@@ -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();