[LLVMbugs] [Bug 13008] New: clang crashes when compiling Eigen::SelfAdjointEigenSolver

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 1 13:37:55 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13008

             Bug #: 13008
           Summary: clang crashes when compiling
                    Eigen::SelfAdjointEigenSolver
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: kree.colemclaughlin at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I am trying to use clang 3.1 to compile some linear algebra code and I keep
getting a crash in my SVD computation, which uses Eigen's self adjoint
eigenvalue solver. I have attached a simple program below that demonstrates
this crash. This has been tested with Eigen 3.0, 3.0.5, and 3.1.0alpha2. All
show the same crash.

Compiling the following code:

#include <Eigen/Eigen>

int main()
{
  typedef Eigen::Matrix<double,3,3>               Tensor;
  typedef Eigen::Matrix<double,3,1>               Vector;
  typedef Eigen::SelfAdjointEigenSolver<Tensor>   EigenSolver;

  Tensor A;

  A << 1, 2, 3,
       4, 5, 6,
       7, 8, 9;

  Tensor AtA = A.transpose() * A;
  EigenSolver solve( AtA );

  Tensor V;
  Vector sigma;

  V = solve.eigenvectors();
  sigma = solve.eigenvalues();

  return 0;
}

with the command line:

clang++ -v -o llvm_test -I eigen-3.1.0-alpha2 llvm_test.cpp

produces the following error:

clang version 3.1 (branches/release_31)
Target: x86_64-unknown-linux-gnu
Thread model: posix
 "/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/clang-3.1" -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
llvm_test.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-momit-leaf-frame-pointer -v -resource-dir
/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/../lib/clang/3.1 -I
eigen-3.1.0-alpha2 -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward
-internal-isystem /usr/local/include -internal-isystem
/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/../lib/clang/3.1/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/job/HOME/kree/Projects/sandbox/llvm-tests -ferror-limit 19 -fmessage-length
180 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /var/tmp/llvm_test-xk5cDj.o -x c++ llvm_test.cpp
clang -cc1 version 3.1 based upon LLVM 3.1svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 eigen-3.1.0-alpha2
 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6

/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward
 /usr/local/include
 /dd/dept/software/3ps/llvm/private/llvm-3.1/bin/../lib/clang/3.1/include
 /usr/include
End of search list.
clang-3.1:
/dd/dept/software/3ps/llvm/llvm-3.1.src/tools/clang/lib/Sema/SemaOverload.cpp:10123:
clang::ActionResult<clang::Expr *, true>
clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, unsigned int, const
clang::UnresolvedSetImpl &, clang::Expr *, clang::Expr *): Assertion
`Result.isInvalid() && "C++ binary operator overloading is missing
candidates!"' failed.
Stack dump:
0.    Program arguments:
/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/clang-3.1 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
llvm_test.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-momit-leaf-frame-pointer -v -resource-dir
/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/../lib/clang/3.1 -I
eigen-3.1.0-alpha2 -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward
-internal-isystem /usr/local/include -internal-isystem
/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/../lib/clang/3.1/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/job/HOME/kree/Projects/sandbox/llvm-tests -ferror-limit 19 -fmessage-length
180 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /var/tmp/llvm_test-xk5cDj.o -x c++ llvm_test.cpp 
1.    <eof> parser at end of file
2.    eigen-3.1.0-alpha2/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:167:5:
instantiating function definition 'SelfAdjointEigenSolver'
3.    eigen-3.1.0-alpha2/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:206:29:
instantiating function definition 'compute'
4.    eigen-3.1.0-alpha2/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h:394:13:
instantiating function definition 'tridiagonal_qr_step'
5.    eigen-3.1.0-alpha2/Eigen/src/Core/MatrixBase.h:457:10: instantiating
function definition 'applyOnTheRight'
6.    eigen-3.1.0-alpha2/Eigen/src/Jacobi/Jacobi.h:271:6: instantiating
function definition 'apply_rotation_in_the_plane'
clang-3: error: unable to execute command: Aborted
clang-3: error: clang frontend command failed due to signal (use -v to see
invocation)
clang-3: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang-3: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang-3: note: diagnostic msg: /var/tmp/llvm_test-5bjrcd.ii
clang-3: note: diagnostic msg: /var/tmp/llvm_test-5bjrcd.sh

I have attached the diagnostic msg .ii file. The shell script contains this:

 "/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/clang-3.1" -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
llvm_test.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-momit-leaf-frame-pointer -v -resource-dir
/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/../lib/clang/3.1 -I
eigen-3.1.0-alpha2 -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward
-internal-isystem /usr/local/include -internal-isystem
/dd/dept/software/3ps/llvm/private/llvm-3.1/bin/../lib/clang/3.1/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/job/HOME/kree/Projects/sandbox/llvm-tests -ferror-limit 19 -fmessage-length
180 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /var/tmp/llvm_test-xk5cDj.o -x c++ llvm_test.cpp
 "/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -o llvm_test
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/crtbegin.o
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.6
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../.. -L/lib
-L/usr/lib /var/tmp/llvm_test-xk5cDj.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s
-lgcc /usr/lib/gcc/x86_64-redhat-linux/4.4.6/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/crtn.o


I have not yet tried earlier versions of clang to determined if and when this
bug was introduced, or later version to see if it's been solved. Please let me
know if there is any more information that I can provide.

Thanks,
Kree

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list