Skip to Content.
Sympa Menu

svadev - Re: [svadev] safecode: infinite loop with -fmemsafety

svadev AT lists.siebelschool.illinois.edu

Subject: Svadev mailing list

List archive

Re: [svadev] safecode: infinite loop with -fmemsafety


Chronological Thread 
  • From: Matthew Wala <wala1 AT illinois.edu>
  • To: John Criswell <criswell AT illinois.edu>
  • Cc: svadev AT cs.uiuc.edu
  • Subject: Re: [svadev] safecode: infinite loop with -fmemsafety
  • Date: Mon, 11 Jun 2012 22:05:25 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
  • List-id: <svadev.cs.uiuc.edu>

On Sat, Jun 9, 2012 at 9:56 AM, John Criswell
<criswell AT illinois.edu>
wrote:
> On 6/8/12 6:20 PM, Matthew Wala wrote:
>>
>> Hi everyone:
>>
>> While trying to get Apache to compile on Presto I am running into an
>> unusual error with clang on the below program which gets compiled by a
>> configure script. Running 'clang -S -fmemsafety' never finishes so it
>> looks it is going in an infinite loop.
>
>
> How long did you wait to see if it finishes?
>
> I'm seeing that, too, on Linux but not on Mac OS X.  Sadly, the problem
> doesn't appear to be with the SAFECode passes; if you use the -emit-llvm and
> -c options, clang will give you an instrumented bitcode file.
>
> Using gdb and interrupting clang to see where it is in execution, it looks
> like it's getting stuck in the code generator somewhere.  If that's the
> case, we won't be able to fix the bug unless we either find and back-port
> the fix into the LLVM 3.0 branch, figure out what part of the SAFECode
> instrumentation is tickling the bug, or upgrade SAFECode to LLVM 3.1.
>
>

With a Debug+Asserts build of clang, I get the following error
message, which seems to confirm that it's a code generation problem.

clang: /home/wala1/llvm/src/include/llvm/CodeGen/SelectionDAGNodes.h:589:
llvm::EVT llvm::SDNode::getValueType(unsigned int) const: Assertion
`ResNo < NumValues && "Illegal result number!"' failed.
0 clang 0x0000000002eb3d5e
1 clang 0x0000000002eb425a
2 libpthread.so.0 0x00000031c6a0f4a0
3 libc.so.6 0x00000031c5e32885 gsignal + 53
4 libc.so.6 0x00000031c5e34065 abort + 373
5 libc.so.6 0x00000031c5e2b9fe
6 libc.so.6 0x00000031c5e2bac0 __assert_perror_fail + 0
7 clang 0x00000000021780ba
llvm::SDNode::getValueType(unsigned int) const + 74
8 clang 0x0000000002177cba llvm::SDValue::getValueType() const + 26
9 clang 0x0000000002698930
llvm::SelectionDAG::getStore(llvm::SDValue, llvm::DebugLoc,
llvm::SDValue, llvm::SDValue, llvm::MachinePointerInfo, bool, bool,
unsigned int, llvm::MDNode const*) + 240
10 clang 0x00000000026c27c4
llvm::SelectionDAGBuilder::visitStore(llvm::StoreInst const&) + 1604
11 clang 0x00000000026be4c9
llvm::SelectionDAGBuilder::visit(unsigned int, llvm::User const&) +
697
12 clang 0x00000000026bdb94
llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 132
13 clang 0x000000000270e71c
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 140
14 clang 0x000000000270e606
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) +
2790
15 clang 0x000000000270cf4d
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) +
765
16 clang 0x00000000028cafce
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 110
17 clang 0x0000000002dd5c83
llvm::FPPassManager::runOnFunction(llvm::Function&) + 467
18 clang 0x0000000002dd600d
llvm::FPPassManager::runOnModule(llvm::Module&) + 125
19 clang 0x0000000002dd6260
llvm::MPPassManager::runOnModule(llvm::Module&) + 496
20 clang 0x0000000002dd68ec
llvm::PassManagerImpl::run(llvm::Module&) + 172
21 clang 0x0000000002dd6ce1 llvm::PassManager::run(llvm::Module&) +
33
22 clang 0x000000000136da1b
23 clang 0x000000000136d668
clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&,
clang::LangOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 104
24 clang 0x000000000136bc9d
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) +
541
25 clang 0x000000000150ba1d clang::ParseAST(clang::Sema&, bool) +
749
26 clang 0x00000000011ce008
clang::ASTFrontendAction::ExecuteAction() + 264
27 clang 0x000000000136a993
clang::CodeGenAction::ExecuteAction() + 1059
28 clang 0x00000000011cdc53 clang::FrontendAction::Execute() + 307
29 clang 0x00000000011aa9cd
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 797
30 clang 0x00000000011749d1
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 961
31 clang 0x000000000116316e cc1_main(char const**, char
const**, char const*, void*) + 926
32 clang 0x000000000116ea8d main + 477
33 libc.so.6 0x00000031c5e1ecdd __libc_start_main + 253
34 clang 0x0000000001162d09
Stack dump:
0. Program arguments: /home/wala1/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -main-file-name test.c
-mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.22.51.20111115 -momit-leaf-frame-pointer
-coverage-file test.s -resource-dir
/home/wala1/local/bin/../lib/clang/3.0 -fmodule-cache-path
/tmp/clang-module-cache -ferror-limit 19 -fmessage-length 158
-fmemsafety -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option
-fcolor-diagnostics -o test.s -x c test.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'test.c'.
4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 2 (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) are located at:
clang: note: diagnostic msg: /tmp/test-WrzZBB.i

>
>>
>> John, I know you wanted me to try to compile Apache, but this issue is
>> getting in the way. Can anyone else reproduce this?
>
>
> Matt, can you do the following?
>
> 1) File a bug with the reduced test case as an attachment.
>

I haven't done this yet. Should the bug be filed against SAFECode or clang?

Matt

>
> 2) Try to compile Apache on Gravity; it's running a different version of
> Linux.  That might help.
> 3) If #2 fails, try to compile on Mac OS X.
>
> -- John T.
>
>>
>> Matt
>>
>>
>> #define _GNU_SOURCE
>>
>> #include<crypt.h>
>>
>> int
>> main ()
>> {
>>
>> struct crypt_data buffer;
>> crypt_r("passwd", "hash",&buffer);
>>
>>   ;
>>     return 0;
>> }
>> _______________________________________________
>> svadev mailing list
>> svadev AT cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/svadev
>
>





Archive powered by MHonArc 2.6.16.

Top of Page