Diptorup Deb via llvm-dev
2017-Sep-19 03:20 UTC
[llvm-dev] Help with segfault in llvm_shutdown with LLVM 5.0 Release build
Hi, We are upgrading an LLVM 4.0-based opt module to LLVM 5.0. After the upgrade our module works when built with an LLVM Debug build, but with an LLVM Release build we are encountering the following error. This happens after our passes have successfully run. I believe this has to do with the way our passes are registered. Would greatly appreciate some pointers, as to where to look. Program received signal SIGSEGV, Segmentation fault. #0 0x00007ffff6926c20 in ?? () #1 0x00005555561c333b in llvm::object_deleter<llvm::SmallVector<std::pair<llvm::PassManagerBuilder::ExtensionPointTy, std::function<void (llvm::PassManagerBuilder const&, llvm::legacy::PassManagerBase&)> >, 8u> >::call(void*) () #2 0x000055555658492d in llvm::ManagedStaticBase::destroy() const () #3 0x00005555565849e5 in llvm::llvm_shutdown() () #4 0x000055555589e0a2 in main () Best, Dipto
Brian Cain via llvm-dev
2017-Sep-19 03:25 UTC
[llvm-dev] Help with segfault in llvm_shutdown with LLVM 5.0 Release build
On Mon, Sep 18, 2017 at 10:20 PM, Diptorup Deb via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > > We are upgrading an LLVM 4.0-based opt module to LLVM 5.0. After the > upgrade our module works when built with an LLVM Debug build, but > with an LLVM Release build we are encountering the following error. > > This happens after our passes have successfully run. I believe this has to > do with the way our passes are registered. Would greatly appreciate some > pointers, as to where to look. >Does building with ASan help you localize the failure any better? -- -Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170918/a0f8df72/attachment.html>
Friedman, Eli via llvm-dev
2017-Sep-19 17:49 UTC
[llvm-dev] Help with segfault in llvm_shutdown with LLVM 5.0 Release build
On 9/18/2017 8:20 PM, Diptorup Deb via llvm-dev wrote:> Hi, > > We are upgrading an LLVM 4.0-based opt module to LLVM 5.0. After the > upgrade our module works when built with an LLVM Debug build, but > with an LLVM Release build we are encountering the following error. > > This happens after our passes have successfully run. I believe this > has to do with the way our passes are registered. Would greatly > appreciate some pointers, as to where to look. > > Program received signal SIGSEGV, Segmentation fault. > #0 0x00007ffff6926c20 in ?? () > #1 0x00005555561c333b in > llvm::object_deleter<llvm::SmallVector<std::pair<llvm::PassManagerBuilder::ExtensionPointTy, > std::function<void (llvm::PassManagerBuilder const&, > llvm::legacy::PassManagerBase&)> >, 8u> >::call(void*) () > #2 0x000055555658492d in llvm::ManagedStaticBase::destroy() const () > #3 0x00005555565849e5 in llvm::llvm_shutdown() () > #4 0x000055555589e0a2 in main () >See https://reviews.llvm.org/D33515 for context. I thought we fixed the problem, but it looks like you found some other way to trigger it. -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Diptorup Deb via llvm-dev
2017-Sep-20 01:14 UTC
[llvm-dev] Help with segfault in llvm_shutdown with LLVM 5.0 Release build
On 09/19/2017 01:49 PM, Friedman, Eli wrote:> See https://reviews.llvm.org/D33515 for context. I thought we fixed the > problem, but it looks like you found some other way to trigger it.Thanks for the reference. I realized after sending the last email that I missed two details. First, our module is an out-of-tree pass. Second, we are using add_library(Canary MODULE Canary.cpp). Using the CMakeLists.txt from the patch you referred to as a reference I tried couple of changes in our CMakeLists.txt. A) Changed the add_library command to SHARED_LIB B) Added target_link_libraries(CanaryPass LLVMipo) Now I am getting the following error: opt: CommandLine Error: Option 'enable-partial-inlining' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options ----- Additionally, in case it is useful in identifying the issue. My development environment has two LLVM 5.0 installs, a Debug and a Release mode respectively. The problem happens when I build the module with the Release mode clang, while also using the Release mode install path as my LLVM_ROOT. If I use the Debug mode install path as the LLVM_ROOT, then things work fine. Also, I was able to build our module using GCC 6.3 and then load the module into the Release mode's opt, without triggering the segfault. Best, Dipto