[LLVMbugs] [Bug 6077] New: Segfault in "X86 DAG->DAG Instruction Selection" when compiling simple file

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Jan 18 14:08:11 PST 2010


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

           Summary: Segfault in "X86 DAG->DAG Instruction Selection" when
                    compiling simple file
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: major
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4076)
 --> (http://llvm.org/bugs/attachment.cgi?id=4076)
A file that crash the compiler

I didn't managed to identify exactly the issue, but I have a simple test case:


# clang --version
clang version 1.1 (trunk 93721)
Target: x86_64-apple-darwin10
Thread model: posix

This is a Release-Assert build compiled using llvm-gcc-4.2 from Xcode 3.2.1 and
occurs when generating debugging symbols

-------------------------------- test.m --------------------------------
// clang -arch i386 -O0 -gdwarf-2 -c test.m

#import <Cocoa/Cocoa.h>

@interface SATrack : NSObject {
@private

}

- (CGSize)size;

- (id)valueForAttribute:(NSString *)anAttribute;

@end

@implementation SATrack

- (CGSize)size {
  NSValue *s = [self valueForAttribute:@"sapphire.aperture.clean"];
  if (!s)
    s = [self valueForAttribute:@"sapphire.track.size"];
  if (s)
    return NSSizeToCGSize([s sizeValue]);
  return CGSizeZero;
}

- (id)valueForAttribute:(NSString *)anAttribute { 
  return nil;
}

@end
--------------------------------------------------------------------------------

clang -arch i386 -O0 -gdwarf-2 -c test.m
0  clang             0x0000000100db9e62 PrintStackTrace(void*) + 34
1  clang             0x0000000100dba344 SignalHandler(int) + 468
2  libSystem.B.dylib 0x00007fff87ce4eaa _sigtramp + 26
3  libSystem.B.dylib 0x00000001013c7a50 _sigtramp + 2037263296
4  clang             0x000000010092f8d3
llvm::SelectionDAGBuilder::visitCall(llvm::CallInst&) + 787
5  clang             0x0000000100952233
llvm::SelectionDAGISel::SelectBasicBlock(llvm::BasicBlock*,
llvm::ilist_iterator<llvm::Instruction>,
llvm::ilist_iterator<llvm::Instruction>, bool&) + 179
6  clang             0x00000001009529a3
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function&,
llvm::MachineFunction&, llvm::MachineModuleInfo*, llvm::DwarfWriter*,
llvm::TargetInstrInfo const&) + 1619
7  clang             0x000000010095381c
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1084
8  clang             0x0000000100a1c44b
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 43
9  clang             0x0000000100d51acd
llvm::FPPassManager::runOnFunction(llvm::Function&) + 429
10 clang             0x0000000100d51ca4
llvm::FunctionPassManagerImpl::run(llvm::Function&) + 100
11 clang             0x0000000100d51e4e
llvm::FunctionPassManager::run(llvm::Function&) + 78
12 clang             0x0000000100030515 (anonymous
namespace)::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 773
13 clang             0x0000000100304a93 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 387
14 clang             0x00000001000375ae
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 302
15 clang             0x000000010001f546 cc1_main(char const**, char const**,
char const*, void*) + 2102
16 clang             0x0000000100021a54 main + 2052
17 clang             0x000000010001d328 start + 52
18 clang             0x000000000000001d start + 4294847785
Stack dump:
0.      Program arguments:
/Users/jddupas/Projects/OpenSource/llvm/Release-Asserts/bin/clang -cc1 -triple
i386-apple-darwin10.0 -S -disable-free -main-file-name test.m -pic-level 1
-mdisable-fp-elim -target-cpu yonah -g -resource-dir
/Users/jddupas/Projects/OpenSource/llvm/Release-Asserts/lib/clang/1.1 -O0
-fmessage-length 172 -stack-protector 1 -fblocks -fdiagnostics-show-option
-fcolor-diagnostics -o
/var/folders/u-/u-YCVFReEbeFgXey1xAjx++++TI/-Tmp-/cc-RmAqfu.s -x objective-c
test.m 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@"\01-[SATrack size]"'
clang: error: compiler command failed due to signal 11 (use -v to see
invocation)


-- 
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