[cfe-dev] Regression in clang. Crash when compiling simple objc file

Ted Kremenek kremenek at apple.com
Mon Jan 18 13:15:25 CST 2010


Hi Jean-Daniel,

Thanks for reporting this.  Could you file a Bugzilla report?  That way we don't lose track of this issue.

Thanks,
Ted

On Jan 18, 2010, at 3:58 AM, Jean-Daniel Dupas wrote:

> I forget to mention that it occurs only when I pass -gdwarf-2.
> 
> Le 18 janv. 2010 à 12:10, Jean-Daniel Dupas a écrit :
> 
>> Hello,
>> 
>> I encounter a annoying segfault in clang when compiling simple obj-c file. This error only 1 or 2 week old. 
>> 
>> I managed to create 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.
>> 
>> -------------------------------- Track.m --------------------------------
>> // clang -arch i386 -O0 -gdwarf-2 -c Track.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 Track.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 Track.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 Track.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)
>> 
>> 
>> -- Jean-Daniel
>> 
>> 
>> 
>> 
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 
> -- Jean-Daniel
> 
> 
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/cfe-dev/attachments/20100118/f42d457a/attachment-0001.html 


More information about the cfe-dev mailing list