Closed llvmbot closed 3 months ago
We are getting a similar backtrace. Using a modified version of clang, we traced the problem to mmap not filling the memory past the end of file with zeroes. Our files are on a proprietary networked file system, so there is probably a bug in the implementation of mmap in that file system.
Hello. I am experiencing a similar bug with Clang 8.0.0.
I am adding two backtraces as attachments to this bug. The two backtraces have different function call stacks, which also differ from the function call stack in the backtrace attached to this bug on 2018-11-28.
I'm seeing a SEGFAULT that looks to match this backtrace. It is intermittent, around 1% of compiles, but completely repeatable because I am running at a large scale with around two thousand compiler invocations per "test".
My use case is complicated because clang is invoked by the Portable Compute Language (pocl) library for OpenCL.
I'm using: clang+llvm-7.0.0-x86_64-linux-sles12.3 and the November 12th master branch of POCL.
I could try again with an instrumented or debug build of clang+llvm if that would help illuminate the root issue. Please let me know what would be helpful.
Also reported to the POCL mailing list, but the backtrace and this related Bug lead me to think the root issue is in clang.
SEGFAULT Backtrace
WmResidentPatchProcessor::WmResidentPatchProcessor(WmComputeProgram*, boost::shared_ptr<WmComputeAssignment const>, std::vector<boost::shared_ptr<WmSubDomain const>, std::allocator<boost::shared_ptr<WmSubDomain const> > > const&, WmComputeMachine&)@wmresidentpatchprocessor.cc:358
POclBuildProgram@clBuildProgram.c:37
compile_and_link_program@pocl_build.c:624
pocl_llvm_build_program@pocl_llvm_build.cc:489
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)@0x2aaaabebfd07
clang::FrontendAction::Execute()@0x2aaaabf1c106
clang::PrintPreprocessedAction::ExecuteAction()@0x2aaaabf22328
clang::DoPrintPreprocessedInput(clang::Preprocessor&, llvm::raw_ostream*, clang::PreprocessorOutputOptions const&)@0x2aaaabf51226
clang::Preprocessor::EnterMainSourceFile()@0x2aaaacc1cabc
clang::Preprocessor::EnterSourceFile(clang::FileID, clang::DirectoryLookup const*, clang::SourceLocation)@0x2aaaacbf7407
(anonymous namespace)::PrintPPOutputPPCallbacks::FileChanged(clang::SourceLocation, clang::PPCallbacks::FileChangeReason, clang::SrcMgr::CharacteristicKind, clang::FileID)@0x2aaaabf5212d
clang::SourceManager::getPresumedLoc(clang::SourceLocation, bool) const@0x2aaaacc4e00e
clang::SourceManager::getLineNumber(clang::FileID, unsigned int, bool*) const@0x2aaaacc4e43a
ComputeLineNumbers(clang::DiagnosticsEngine&, clang::SrcMgr::ContentCache*, llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&, clang::SourceManager const&, bool&)@0x2aaaacc4e683
Note: this may not be a reliable crasher... at least, I ran the "run script" a few times (in my /tmp directory), and it seems to run without printing any crash/error output.
Closing this as there is no reproducer attached and it's been a while. Feel free to reopen
@llvm/issue-subscribers-clang-frontend
Author: None (llvmbot)
Extended Description
Just hit a clang segfault, with locally-built recent-SVN-trunk clang revision 346691. Backtrace attached - if I'm understanding it correctly, it looks like the segfault was in ComputeLineNumbers.