https://bugs.llvm.org/show_bug.cgi?id=35552

            Bug ID: 35552
           Summary: [ThinLTO] Incautious error handling
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Bitcode Reader
          Assignee: unassignedb...@nondot.org
          Reporter: paul_robin...@playstation.sony.com
                CC: llvm-bugs@lists.llvm.org

While investigating PR35472, we occasionally got a different error,
"can't create module summary index for buffer: Invalid bitcode signature"
followed by a crash.

ThinLTOCodeGenerator::linkCombinedIndex() nominally returns a
std::unique_ptr<ModuleSummaryIndex>, however if readModuleSummaryIndex()
returns an error (e.g., Invalid bitcode signature), linkCombinedIndex() 
can return nullptr.

ThinLTOCodeGenerator::run() has this code:

  // Sequential linking phase
  auto Index = linkCombinedIndex();
  ...
  Index->collectDefinedGVSummariesPerModule(ModuleToDefinedGVSummaries);

That is, there's no null check, and the nullptr causes the inevitable
segfault.  I figured I'd let the ThinLTO experts decide how they want
to handle this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to