Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Running pass 'Greedy Register Allocator' leads to Segmentation fault (core dumped) #14393

Open Quuxplusone opened 11 years ago

Quuxplusone commented 11 years ago
Bugzilla Link PR14377
Status NEW
Importance P normal
Reported by Sébastien Boisvert (seb@boisvert.info)
Reported on 2012-11-18 20:21:41 -0800
Last modified on 2012-11-22 20:56:25 -0800
Version 3.1
Hardware PC Linux
CC benny.kra@gmail.com, llvm-bugs@lists.llvm.org, pawel@32bitmicro.com, rafael@espindo.la, seb@boisvert.info
Fixed by commit(s)
Attachments filem_rsh_module-9dvj5i.i (337874 bytes, application/octet-stream)
filem_rsh_module-9dvj5i.sh (1880 bytes, application/x-shellscript)
make-2012-11-22.7.log.bz2 (102193 bytes, application/x-bzip2)
Blocks
Blocked by
See also
Hi,

I want to use LLVM 3.1 (with clang for the frontend) for compiling Open-MPI
1.6.3,
which is a message-passing library. But I get a segmentation fault by the
"Greedy
Register Allocator".
Quuxplusone commented 11 years ago
There is the bug # 11756 that solves a similar problem, but the bugzilla says
"Version 3.0",
and I am using 3.1 so it is likely a different bug that I am dealing with.

   http://llvm.org/bugs/show_bug.cgi?id=11756
Quuxplusone commented 11 years ago
I believe the bug I am reporting is already reported in bug # 11969 when
building
FreeBSD world:

   http://llvm.org/bugs/show_bug.cgi?id=11969
Quuxplusone commented 11 years ago
To reproduce the problem:

Program I am compiling:

  http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.3.tar.bz2

Version of LLVM/Clang: 3.1

How I compiled LLVM:

# \see llvm.org/docs/Packaging.html

../llvm-3.1.src/configure \
--prefix=/software/compilers/llvm/3.1 \
--disable-assertions \
--enable-debug-symbols \
--enable-optimized \
--enable-shared \

make -j 4

make install

Command generated by the Makefile:

$ /software/compilers/llvm/3.1/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -
emit-obj -disable-free -disable-llvm-verifier -main-file-name
filem_rsh_module.c -pic-level 2 -relaxed-aliasing -masm-verbose -mconstructor-
aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.17.50.0.6 -
momit-leaf-frame-pointer -coverage-file .libs/filem_rsh_module.o -resource-dir
/software/compilers/llvm/3.1/bin/../lib/clang/3.1 -dependency-file
.deps/filem_rsh_module.Tpo -sys-header-deps -MP -MT filem_rsh_module.lo -D
HAVE_CONFIG_H -D NDEBUG -D PIC -I . -I ../../../../../openmpi-
1.6.3/orte/mca/filem/rsh -I ../../../../opal/include -I
../../../../orte/include -I ../../../../ompi/include -I
../../../../opal/mca/hwloc/hwloc132/hwloc/include/private/autogen -I
../../../../opal/mca/hwloc/hwloc132/hwloc/include/hwloc/autogen -I
../../../../../openmpi-1.6.3 -I ../../../.. -I ../../../../../openmpi-
1.6.3/opal/include -I ../../../../../openmpi-1.6.3/orte/include -I
../../../../../openmpi!
-1.6.3/om
i/include -I /clumeq/src/Open-MPI/1.6.3/openmpi-
1.6.3/opal/mca/hwloc/hwloc132/hwloc/include -I /clumeq/src/Open-
MPI/1.6.3/openmpi-llvm/opal/mca/hwloc/hwloc132/hwloc/include -I
/usr/include/infiniband -I /usr/include/infiniband -fmodule-cache-path
/var/tmp/clang-module-cache -c-isystem /software/compilers/llvm/3.1/include -
internal-isystem /usr/local/include -internal-isystem
/software/compilers/llvm/3.1/bin/../lib/clang/3.1/include -internal-externc-
isystem /include -internal-externc-isystem /usr/include -O2 -Wall -std=gnu89 -
fdebug-compilation-dir /clumeq/src/Open-MPI/1.6.3/openmpi-
llvm/orte/mca/filem/rsh -ferror-limit 19 -fmessage-length 0 -pthread -
mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -
fobjc-fragile-abi -fdiagnostics-show-option -o .libs/filem_rsh_module.o -x c
../../../../../openmpi-1.6.3/orte/mca/filem/rsh/filem_rsh_module.c
0  libLLVM-3.1.so  0x00002b989f3e80df
1  libLLVM-3.1.so  0x00002b989f3e8827
2  libpthread.so.0 0x000000328280ebe0
3  libLLVM-3.1.so  0x00002b989ec09c36
llvm::ConnectedVNInfoEqClasses::Distribute(llvm::LiveInterval**,
llvm::MachineRegisterInfo&) + 342
4  libLLVM-3.1.so  0x00002b989ec1af75
llvm::LiveRangeEdit::eliminateDeadDefs(llvm::SmallVectorImpl<llvm::MachineInstr*>&,
llvm::ArrayRef<unsigned int>) + 949
5  libLLVM-3.1.so  0x00002b989ebf2142
6  libLLVM-3.1.so  0x00002b989ebf297c
7  libLLVM-3.1.so  0x00002b989ecacb67
8  libLLVM-3.1.so  0x00002b989ec9ed65 llvm::RegAllocBase::allocatePhysRegs() +
181
9  libLLVM-3.1.so  0x00002b989ecad4ce
10 libLLVM-3.1.so  0x00002b989ec4eb10
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 96
11 libLLVM-3.1.so  0x00002b989ede6731
llvm::FPPassManager::runOnFunction(llvm::Function&) + 561
12 libLLVM-3.1.so  0x00002b989ede678d
llvm::FPPassManager::runOnModule(llvm::Module&) + 45
13 libLLVM-3.1.so  0x00002b989ede7b04
llvm::MPPassManager::runOnModule(llvm::Module&) + 516
14 libLLVM-3.1.so  0x00002b989ede7be2 llvm::PassManagerImpl::run(llvm::Module&)
+ 114
15 libLLVM-3.1.so  0x00002b989ede7c7d llvm::PassManager::run(llvm::Module&) + 13
16 clang           0x00000000006a0aab
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 1387
17 clang           0x000000000069e2ca
18 clang           0x000000000081d189 clang::ParseAST(clang::Sema&, bool, bool)
+ 489
19 clang           0x000000000069c513 clang::CodeGenAction::ExecuteAction() + 51
20 clang           0x000000000053530b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 267
21 clang           0x000000000051b0c9
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1209
22 clang           0x0000000000512e58 cc1_main(char const**, char const**, char
const*, void*) + 1416
23 clang           0x000000000051a3df main + 4975
24 libc.so.6       0x0000003281c1d994 __libc_start_main + 244
25 clang           0x00000000005107b9
Stack dump:
0.      Program arguments: /software/compilers/llvm/3.1/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -main-
file-name filem_rsh_module.c -pic-level 2 -relaxed-aliasing -masm-verbose -
mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.17.50.0.6 -momit-leaf-frame-pointer -coverage-file .libs/filem_rsh_module.o -
resource-dir /software/compilers/llvm/3.1/bin/../lib/clang/3.1 -dependency-file
.deps/filem_rsh_module.Tpo -sys-header-deps -MP -MT filem_rsh_module.lo -D
HAVE_CONFIG_H -D NDEBUG -D PIC -I . -I ../../../../../openmpi-
1.6.3/orte/mca/filem/rsh -I ../../../../opal/include -I
../../../../orte/include -I ../../../../ompi/include -I
../../../../opal/mca/hwloc/hwloc132/hwloc/include/private/autogen -I
../../../../opal/mca/hwloc/hwloc132/hwloc/include/hwloc/autogen -I
../../../../../openmpi-1.6.3 -I ../../../.. -I ../../../../../openmpi-
1.6.3/opal/include -I ../../../../../openmpi-1.6.3/orte/include !
-I ../../
./../../openmpi-1.6.3/ompi/include -I /clumeq/src/Open-MPI/1.6.3/openmpi-
1.6.3/opal/mca/hwloc/hwloc132/hwloc/include -I /clumeq/src/Open-
MPI/1.6.3/openmpi-llvm/opal/mca/hwloc/hwloc132/hwloc/include -I
/usr/include/infiniband -I /usr/include/infiniband -fmodule-cache-path
/var/tmp/clang-module-cache -c-isystem /software/compilers/llvm/3.1/include -
internal-isystem /usr/local/include -internal-isystem
/software/compilers/llvm/3.1/bin/../lib/clang/3.1/include -internal-externc-
isystem /include -internal-externc-isystem /usr/include -O2 -Wall -std=gnu89 -
fdebug-compilation-dir /clumeq/src/Open-MPI/1.6.3/openmpi-
llvm/orte/mca/filem/rsh -ferror-limit 19 -fmessage-length 0 -pthread -
mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -
fobjc-fragile-abi -fdiagnostics-show-option -o .libs/filem_rsh_module.o -x c
../../../../../openmpi-1.6.3/orte/mca/filem/rsh/filem_rsh_module.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '../../../../../openmpi-
1.6.3/orte/mca/filem/rsh/filem_rsh_module.c'.
4.      Running pass 'Greedy Register Allocator' on function
'@orte_filem_rsh_start_copy'
Segmentation fault (core dumped)
Quuxplusone commented 11 years ago
Instructions provided by clang after the segmentation fault:

1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '../../../../../openmpi-
1.6.3/orte/mca/filem/rsh/filem_rsh_module.c'.
4.      Running pass 'Greedy Register Allocator' on function
'@orte_filem_rsh_start_copy'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/filem_rsh_module-9dvj5i.i
clang: note: diagnostic msg: /tmp/filem_rsh_module-9dvj5i.sh
Quuxplusone commented 11 years ago

Attached filem_rsh_module-9dvj5i.i (337874 bytes, application/octet-stream): clang: note: diagnostic msg: /tmp/filem_rsh_module-9dvj5i.i

Quuxplusone commented 11 years ago

Attached filem_rsh_module-9dvj5i.sh (1880 bytes, application/x-shellscript): clang: note: diagnostic msg: /tmp/filem_rsh_module-9dvj5i.sh

Quuxplusone commented 11 years ago

Is this still an issue with trunk or 3.2? I can't reproduce the crash.

Quuxplusone commented 11 years ago

Attached make-2012-11-22.7.log.bz2 (102193 bytes, application/x-bzip2): Open-MPI 1.6.3 make log, compiler= clang 3.2-pre-release-git

Quuxplusone commented 11 years ago
With clang from git (2012-11-22), I get a linking error before
filem_rsh_module.c is compiled. I did not have this problem with 3.1.

"clang: error: linker command failed with exit code 1 (use -v to see
invocation)".

See attachment "Open-MPI 1.6.3 make log, compiler= clang 3.2-pre-release-git"

$ clang --version
clang version 3.3 (http://llvm.org/git/clang.git
4d9f4e5bfa701fc870e3c481f93f1fcc52d327bb) (http://llvm.org/git/llvm.git
99ba589434b52e767a34ced826bc24b8be378a7b)
Target: x86_64-unknown-linux-gnu
Thread model: posix