Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in PyMOL source code when compiling with clang #55029

Closed
Wenmj201582 opened this issue Apr 22, 2022 · 5 comments
Closed

Error in PyMOL source code when compiling with clang #55029

Wenmj201582 opened this issue Apr 22, 2022 · 5 comments
Labels
clang:codegen crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@Wenmj201582
Copy link

Wenmj201582 commented Apr 22, 2022

I am using the clang compiler to compile PyMOL software, and its compilation command is :python3 setup.py install
The software versions involved are as follows:
HUAWEI BiSheng Compiler 2.1.0. B010 clang version 12.0.0
Python 3.8.1
pymol-open-source-2.5.0

Errors are reported as follows:

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang++ -std=c++11 -fPIC -D_PYMOL_LIBPNG -D_PYMOL_FREETYPE -DPYMOL_OPENMP -D_PYMOL_VMD_PLUGINS -D_HAVE_LIBXML -D_PYMOL_NO_MSGPACKC -D_PYMOL_NO_MAIN -Iinclude -Icontrib/uiuc/plugins/include -Iov/src -Ilayer0 -Ilayer1 -Ilayer2 -Ilayer3 -Ilayer4 -Ilayer5 -Ibuild/generated -Icontrib/uiuc/plugins/molfile_plugin/src -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/local/python3/include/python3.8 -c -MMD layer2/ObjectMolecule2.cpp -o build/temp.linux-aarch64-3.8/layer2/ObjectMolecule2.o -Werror=return-type -Wunused-variable -Wno-switch -Wno-narrowing -Wno-char-subscripts -O3 -fopenmp
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      layer2/ObjectMolecule2.cpp:3773:38: Generating code for declaration 'ObjectMoleculeConnect(ObjectMolecule *, int &, pymol::vla<BondType> &, struct CoordSet *, int, int, bool)::(anonymous class)::operator()'
4.      layer2/ObjectMolecule2.cpp:3778:47: LLVM IR generation of compound statement ('{}')
5.      layer2/ObjectMolecule2.cpp:3804:9: LLVM IR generation of compound statement ('{}')
 #0 0x0000aaae45f2f140 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x18af140)
 #1 0x0000aaae45f2d074 llvm::sys::RunSignalHandlers() (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x18ad074)
 #2 0x0000aaae45f2e3f0 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x18ae3f0)
 #3 0x0000aaae45ebc334 (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x183c334)
 #4 0x0000fffe55cb07c0 (linux-vdso.so.1+0x7c0)
 #5 0x0000aaae463f7950 (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1d77950)
 #6 0x0000aaae4632baac clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(clang::DeclRefExpr const*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1cabaac)
 #7 0x0000aaae463221c0 clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1ca21c0)
 #8 0x0000aaae46343920 clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool, clang::NestedNameSpecifier*, bool, clang::Expr const*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1cc3920)
 #9 0x0000aaae46342e98 clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(clang::CXXMemberCallExpr const*, clang::CodeGen::ReturnValueSlot) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1cc2e98)
#10 0x0000aaae46337c9c clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1cb7c9c)
#11 0x0000aaae4635d2d4 (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1cdd2d4)
#12 0x0000aaae4634fe08 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1ccfe08)
#13 0x0000aaae4630cd1c clang::CodeGen::CodeGenFunction::EmitScalarInit(clang::Expr const*, clang::ValueDecl const*, clang::CodeGen::LValue, bool) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1c8cd1c)
#14 0x0000aaae463109d0 clang::CodeGen::CodeGenFunction::EmitExprAsInit(clang::Expr const*, clang::ValueDecl const*, clang::CodeGen::LValue, bool) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1c909d0)
#15 0x0000aaae4630e6e8 clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission const&) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1c8e6e8)
#16 0x0000aaae4630b1c8 clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl const&) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1c8b1c8)
#17 0x0000aaae4614bd40 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1acbd40)
#18 0x0000aaae4614b42c clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1acb42c)
#19 0x0000aaae46153dd4 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1ad3dd4)
#20 0x0000aaae46153170 clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1ad3170)
#21 0x0000aaae4614bb68 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1acbb68)
#22 0x0000aaae4614b42c clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1acb42c)
#23 0x0000aaae463f66c8 (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1d766c8)
#24 0x0000aaae463e725c clang::CodeGen::CGOpenMPRuntime::emitInlinedDirective(clang::CodeGen::CodeGenFunction&, llvm::omp::Directive, clang::CodeGen::RegionCodeGenTy const&, bool) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1d6725c)
#25 0x0000aaae463d1d90 clang::CodeGen::CGOpenMPRuntime::emitCriticalRegion(clang::CodeGen::CodeGenFunction&, llvm::StringRef, clang::CodeGen::RegionCodeGenTy const&, clang::SourceLocation, clang::Expr const*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1d51d90)
#26 0x0000aaae4616a9e4 clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective(clang::OMPCriticalDirective const&) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1aea9e4)
#27 0x0000aaae4614b698 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1acb698)
#28 0x0000aaae46153dd4 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1ad3dd4)
#29 0x0000aaae46153170 clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1ad3170)
#30 0x0000aaae4614bb68 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1acbb68)
#31 0x0000aaae4614b42c clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1acb42c)
#32 0x0000aaae46152e78 clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(clang::CXXForRangeStmt const&, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1ad2e78)
#33 0x0000aaae4614b5ac clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1acb5ac)
#34 0x0000aaae46153dd4 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1ad3dd4)
#35 0x0000aaae461978c0 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1b178c0)
#36 0x0000aaae461980dc clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1b180dc)
#37 0x0000aaae461b306c clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1b3306c)
#38 0x0000aaae461acd1c clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1b2cd1c)
#39 0x0000aaae461a2210 clang::CodeGen::CodeGenModule::EmitDeferred() (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1b22210)
#40 0x0000aaae461a0fcc clang::CodeGen::CodeGenModule::Release() (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1b20fcc)
#41 0x0000aaae46addd80 (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x245dd80)
#42 0x0000aaae46adb19c (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x245b19c)
#43 0x0000aaae4739a14c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x2d1a14c)
#44 0x0000aaae465bab80 clang::FrontendAction::Execute() (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1f3ab80)
#45 0x0000aaae4655df4c clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1eddf4c)
#46 0x0000aaae4664cc50 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1fccc50)
#47 0x0000aaae451bd354 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0xb3d354)
#48 0x0000aaae451bbfd0 (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0xb3bfd0)
#49 0x0000aaae46457e04 (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1dd7e04)
#50 0x0000aaae45ebbf9c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x183bf9c)
#51 0x0000aaae4645765c clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, bool*) const (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1dd765c)
#52 0x0000aaae4642d79c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1dad79c)
#53 0x0000aaae4642dcbc clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) const (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1dadcbc)
#54 0x0000aaae46442114 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0x1dc2114)
#55 0x0000aaae451bb4f4 main (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0xb3b4f4)
#56 0x0000fffe557e3f80 __libc_start_main (/usr/lib64/libc.so.6+0x23f80)
#57 0x0000aaae451b917c _start (/opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin/clang-12+0xb3917c)
clang-12: error: clang frontend command failed with exit code 139 (use -v to see invocation)
HUAWEI BiSheng Compiler 2.1.0.B010 clang version 12.0.0 (clang-0749c5924208 flang-d6f2a3bc24a5)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler/BS/bisheng-compiler-2.1.0-aarch64-linux/bin
clang-12: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/ObjectMolecule2-2ff5d5.cpp
clang-12: note: diagnostic msg: /tmp/ObjectMolecule2-2ff5d5.sh
clang-12: note: diagnostic msg:

********************
error: command 'clang++' failed with exit status 139

error-file.zip

@EugeneZelenko EugeneZelenko added clang:codegen crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Apr 22, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 22, 2022

@llvm/issue-subscribers-clang-codegen

@EugeneZelenko
Copy link
Contributor

Could same problem be reproduced with 14 or main?

@Wenmj201582
Copy link
Author

Could same problem be reproduced with 14 or main?

First, I don't understand why PyMOL's compilation error prompt needs to be submitted to llvm. What's the relationship between them?
Second, what do you mean by reproduced with 14 or main? At present, I have tried twice, and this phenomenon is inevitable.

The reproduction step is like this,

  1. Install clang
  2. Install Python 3.8.1 (compiled with clang source code)
  3. Install the basic dependency Library of PyMOL
  4. Source code compilation PyMOL: python3 setup Py install (a bug is prompted here)

@EugeneZelenko
Copy link
Contributor

Version 14 is recently release and currently maintained one and main is current code.

@asl
Copy link
Collaborator

asl commented Apr 23, 2022

@Wenmj201582 Since you are using some vendor-modified clang and not the officially released version, please consider reporting this issue to the compiler vendor (Huawei).

If the problem could be reproduced with the latest released clang from releasesd, please reopen the issue

@asl asl closed this as completed Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

4 participants