<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Segfault with absl::StatusOr"
   href="https://bugs.llvm.org/show_bug.cgi?id=52048">52048</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segfault with absl::StatusOr
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>12.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>adam@wowsignal.io
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>LLDB consistently segfaults when calling status() on absl::StatusOr in my
codebase, but I have been unable to come with a minimal repro case. The code is
in a private Github repo, but I'm happy to give access to whomever and provide
specific repro instructions and commit ref.

Here's the output:

(lldb) target create "build-debug/src/timeline_test"
Current executable set to
'/Users/adam/SpacePhysics/physics/build-debug/src/timeline_test' (x86_64).
(lldb) r
Process 3352 launched:
'/Users/adam/SpacePhysics/physics/build-debug/src/timeline_test' (x86_64)
Running main() from
/Users/adam/SpacePhysics/physics/build-debug/_deps/googletest-src/googletest/src/gtest_main.cc
[==========] Running 9 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 5 tests from TimelineTest
[ RUN      ] TimelineTest.FallingSphere
[       OK ] TimelineTest.FallingSphere (1040 ms)
[ RUN      ] TimelineTest.AccelerateRewindAccelerate
[       OK ] TimelineTest.AccelerateRewindAccelerate (2 ms)
[ RUN      ] TimelineTest.TimeTravel
Assertion failed: (reset_event.ok()), function Simulate, file
/Users/adam/SpacePhysics/physics/src/timeline.cc, line 159.
Process 3352 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
    frame #4: 0x000000010004e7dd
timeline_test`vstr::Timeline::Simulate(this=0x00007ffeefbfec68) at
timeline.cc:159:3
   156    events_.Overlap(head_, input_buffer_);
   157    auto reset_event =
   158        ShouldResetTimeline(absl::MakeSpan(input_buffer_),
key_frame_period_);
-> 159    assert(reset_event.ok());
   160  
   161    if (reset_event.value() != nullptr) {
   162      head_frame_ = key_frames_[reset_event.value()->time_travel.frame_no
/
Target 0: (timeline_test) stopped.
(lldb) p reset_event.status()
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments:
/Applications/Xcode.app/Contents/Developer/usr/bin/lldb
build-debug/src/timeline_test 
0  lldb                     0x0000000108801de5
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  lldb                     0x00000001088014e5 llvm::sys::RunSignalHandlers() +
85
2  lldb                     0x0000000108802646 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff20575d7d _sigtramp + 29
4  libsystem_platform.dylib 0x000000010fc48e00 _sigtramp + 18446603344533074080
5  LLDB                     0x000000010caf3b7c
clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const + 3052
6  LLDB                     0x000000010cafa570 (anonymous
namespace)::EmptySubobjectMap::ComputeEmptySubobjectSizes() + 400
7  LLDB                     0x000000010caf34f6
clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const + 1382
8  LLDB                     0x000000010cafa570 (anonymous
namespace)::EmptySubobjectMap::ComputeEmptySubobjectSizes() + 400
9  LLDB                     0x000000010caf34f6
clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const + 1382
10 LLDB                     0x000000010b2547e1
clang::CodeGen::CodeGenTypes::ComputeRecordLayout(clang::RecordDecl const*,
llvm::StructType*) + 97
11 LLDB                     0x000000010b308be4
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*) +
660
12 LLDB                     0x000000010b30758d
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 205
13 LLDB                     0x000000010b307459
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType, bool) + 121
14 LLDB                     0x000000010b307a56
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 1430
15 LLDB                     0x000000010b37c4f7 (anonymous
namespace)::X86_64ABIInfo::classifyArgumentType(clang::QualType, unsigned int,
unsigned int&, unsigned int&, bool) const + 375
16 LLDB                     0x000000010b379a6a (anonymous
namespace)::X86_64ABIInfo::computeInfo(clang::CodeGen::CGFunctionInfo&) const +
1578
17 LLDB                     0x000000010b070ef3
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>,
bool, bool, llvm::ArrayRef<clang::CanQual<clang::Type> >,
clang::FunctionType::ExtInfo,
llvm::ArrayRef<clang::FunctionType::ExtParameterInfo>,
clang::CodeGen::RequiredArgs) + 771
18 LLDB                     0x000000010b0713d2
arrangeLLVMFunctionInfo(clang::CodeGen::CodeGenTypes&, bool,
llvm::SmallVectorImpl<clang::CanQual<clang::Type> >&,
clang::CanQual<clang::FunctionProtoType>) + 658
19 LLDB                     0x000000010b0714a9
clang::CodeGen::CodeGenTypes::arrangeCXXMethodType(clang::CXXRecordDecl const*,
clang::FunctionProtoType const*, clang::CXXMethodDecl const*) + 153
20 LLDB                     0x000000010b071687
clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(clang::CXXMethodDecl
const*) + 391
21 LLDB                     0x000000010b2c6f8f
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 47
22 LLDB                     0x000000010b2c13bf
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) + 463
23 LLDB                     0x000000010b2c9e87
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 1831
24 LLDB                     0x000000010b345faf (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 127
25 LLDB                     0x00000001091c7464
lldb_private::ASTResultSynthesizer::HandleTopLevelDecl(clang::DeclGroupRef) +
148
26 LLDB                     0x000000010bdf42a3 clang::ParseAST(clang::Sema&,
bool, bool) + 531
27 LLDB                     0x00000001091ef761
lldb_private::ClangExpressionParser::ParseInternal(lldb_private::DiagnosticManager&,
clang::CodeCompleteConsumer*, unsigned int, unsigned int) + 2209
28 LLDB                     0x0000000109203526
lldb_private::ClangUserExpression::TryParse(lldb_private::DiagnosticManager&,
lldb_private::ExecutionContextScope*, lldb_private::ExecutionContext&,
lldb_private::ExecutionPolicy, bool, bool) + 422
29 LLDB                     0x0000000109203d47
lldb_private::ClangUserExpression::Parse(lldb_private::DiagnosticManager&,
lldb_private::ExecutionContext&, lldb_private::ExecutionPolicy, bool, bool) +
1207
30 LLDB                     0x0000000108bda8db
lldb_private::UserExpression::Evaluate(lldb_private::ExecutionContext&,
lldb_private::EvaluateExpressionOptions const&, llvm::StringRef,
llvm::StringRef, std::__1::shared_ptr<lldb_private::ValueObject>&,
lldb_private::Status&, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >*,
lldb_private::ValueObject*) + 2427
31 LLDB                     0x0000000108cdb3ec
lldb_private::Target::EvaluateExpression(llvm::StringRef,
lldb_private::ExecutionContextScope*,
std::__1::shared_ptr<lldb_private::ValueObject>&,
lldb_private::EvaluateExpressionOptions const&, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >*,
lldb_private::ValueObject*) + 636
32 LLDB                     0x000000010915b605
lldb_private::CommandObjectExpression::EvaluateExpression(llvm::StringRef,
lldb_private::Stream&, lldb_private::Stream&,
lldb_private::CommandReturnObject&) + 549
33 LLDB                     0x000000010915c5a0
lldb_private::CommandObjectExpression::DoExecute(llvm::StringRef,
lldb_private::CommandReturnObject&) + 1552
34 LLDB                     0x0000000108c16672
lldb_private::CommandObjectRaw::Execute(char const*,
lldb_private::CommandReturnObject&) + 418
35 LLDB                     0x0000000108c0cb81
lldb_private::CommandInterpreter::HandleCommand(char const*,
lldb_private::LazyBool, lldb_private::CommandReturnObject&,
lldb_private::ExecutionContext*, bool, bool) + 2753
36 LLDB                     0x0000000108c10eac
lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >&) + 620
37 LLDB                     0x0000000108b4e4a2
lldb_private::IOHandlerEditline::Run() + 338
38 LLDB                     0x0000000108b3448f
lldb_private::Debugger::RunIOHandlers() + 143
39 LLDB                     0x0000000108c1214e
lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&)
+ 158
40 LLDB                     0x00000001088f3076
lldb::SBDebugger::RunCommandInterpreter(bool, bool) + 214
41 lldb                     0x00000001087e9969 Driver::MainLoop() + 2857
42 lldb                     0x00000001087eb2ce main + 1982
43 libdyld.dylib            0x00007fff2054c621 start + 1
zsh: segmentation fault  lldb build-debug/src/timeline_test</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>