Getting Seg fault

27 views
Skip to first unread message

raghesh

unread,
Aug 20, 2011, 12:17:18 AM8/20/11
to poll...@googlegroups.com
I just added a variable in ScopInfo.h and I am getting Segmentation
fault. it seems the BasicBlock *BB is corrupted. This behaviour is
there if I delcare any pointer of any type. Could you please check
that you can reproduce it. This is not consistent too. Patch and test
case attached. The following command is given.

opt -load /home/raghesh/project/commit/build/lib/LLVMPolly.so
-polly-codegen memaccess_codegen_offset.ll -S -o
memaccess_codegen_offset.polly.correct.ll

Regards,
--
Raghesh

Segfault.diff
memaccess_codegen_offset.ll

raghesh

unread,
Aug 20, 2011, 1:07:49 AM8/20/11
to poll...@googlegroups.com
Here is the gdb dump

(gdb) b polly::BlockGenerator::copyBB(llvm::BasicBlock*, llvm::DominatorTree*)
Breakpoint 1 at 0x7ffff6bec8e3: file
/home/raghesh/project/commit/llvm/tools/polly/lib/CodeGeneration.cpp,
line 551.
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /usr/local/bin/opt -load


/home/raghesh/project/commit/build/lib/LLVMPolly.so -polly-codegen
memaccess_codegen_offset.ll -S -o
memaccess_codegen_offset.polly.correct.ll

[Thread debugging using libthread_db enabled]

Breakpoint 1, polly::BlockGenerator::copyBB (this=0x7fffffffd6f0,
BB=0x5a5a5a5a5a5a5a5a, DT=0x1274c60)
at /home/raghesh/project/commit/llvm/tools/polly/lib/CodeGeneration.cpp:551
551 Function *F = Builder.GetInsertBlock()->getParent();
(gdb) n
552 LLVMContext &Context = F->getContext();
(gdb)
555 F);
(gdb)

Program received signal SIGSEGV, Segmentation fault.
0x0000000000c998ce in llvm::Value::getName (this=0x5a5a5a5a5a5a5a5a)
at /home/raghesh/project/commit/llvm/lib/VMCore/Value.cpp:155
155 if (!Name) return StringRef("", 0);
(gdb)

--
Raghesh

Tobias Grosser

unread,
Aug 20, 2011, 7:28:23 AM8/20/11
to poll...@googlegroups.com, raghesh

Hey raghesh,

this seems to work for me (at least with the most recent version of
Polly). Can you check if my recent changes have fixed this issue. If
not, can you run this with valgrind?

Install valgrind and run

valgrind opt -load ...

Do you have any other changes as the patch you posted here?

Cheers
Tobi

Reply all
Reply to author
Forward
0 new messages