[cfe-dev] Clang crashes when trying to use @selector (ObjC)

Guenther Noack guenther at unix-ag.uni-kl.de
Sat Nov 1 14:22:02 PDT 2008


Hi!

I'm experiencing assertion failures (crashes) when trying to compile the
appended small Objective-C file. (I built it to run with the TestRunner.sh
script in clang/test.) Unfortunately, I couldn't figure out how to fix
it.

My system configuration is Ubuntu 7 on x86, fresh working copies of LLVM
and clang. David Chisnall reported that the error doesn't occur on
FreeBSD.

Best regards and thanks for your help,
Guenther


PS: test runner output is as follows:
guenther at kandinsky: CodeGen$ sh ../TestRunner.sh selectorcrash.m 
******************** TEST 'selectorcrash.m' FAILED! ********************
Command: 
 clang -emit-llvm-bc selectorcrash.m
 Incorrect Output:
 clang: Instructions.cpp:882: void llvm::StoreInst::AssertOK():
   Assertion `getOperand(0)->getType() ==
   cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr
   must be a pointer to Val type!"' failed.
 clang[0x8fc9816]
 clang[0x8fc9948]
 [0xffffe420]
 /lib/tls/i686/cmov/libc.so.6(abort+0x101)[0xb7c98201]
 /lib/tls/i686/cmov/libc.so.6(__assert_fail+0xee)[0xb7c8fb6e]
 clang(_ZN4llvm9StoreInst8AssertOKEv+0x127)[0x8f3a875]
 clang(_ZN4llvm9StoreInstC1EPNS_5ValueES2_bPNS_11InstructionE+0xc7)[0x8f4453b]
 clang(_ZN4llvm9IRBuilderILb1ENS_14ConstantFolderEE11CreateStoreEPNS_5ValueES4_b+0x41)[0x8909a01]
 clang(_ZN5clang7CodeGen15CodeGenFunction14EmitReturnStmtERKNS_10ReturnStmtE+0xc3)[0x8950afb]
 clang(_ZN5clang7CodeGen15CodeGenFunction8EmitStmtEPKNS_4StmtE+0x2fa)[0x89513a2]
 clang(_ZN5clang7CodeGen15CodeGenFunction16EmitCompoundStmtERKNS_12CompoundStmtEbPN4llvm5ValueEb+0xaf)[0x89528ef]
 clang(_ZN5clang7CodeGen15CodeGenFunction8EmitStmtEPKNS_4StmtE+0x1ff)[0x89512a7]
 clang(_ZN5clang7CodeGen15CodeGenFunction12GenerateCodeEPKNS_12FunctionDeclEPN4llvm8FunctionE+0x275)[0x89569d9]
 clang(_ZN5clang7CodeGen13CodeGenModule28EmitGlobalFunctionDefinitionEPKNS_12FunctionDeclE+0x23d)[0x88f27b3]
 clang(_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionEPKNS_9ValueDeclE+0x2c)[0x88f28b6]
 clang(_ZN5clang7CodeGen13CodeGenModule10EmitGlobalEPKNS_9ValueDeclE+0x19d)[0x88f2aa3]
 clang(_ZN5clang7CodeGen13CodeGenModule16EmitTopLevelDeclEPNS_4DeclE+0x93)[0x88f330b]
 clang[0x88efeac]
 clang[0x86cf0df]
 clang(_ZN5clang8ParseASTERNS_12PreprocessorEPNS_11ASTConsumerEbb+0x206)[0x89ec826]
 clang[0x870554a]
 clang(main+0x76f)[0x870655d]
 /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7c82050]
 clang[0x86c33b1]
 Aborted (core dumped)
 ******************** TEST 'selectorcrash.m' FAILED! ********************

-------------- next part --------------
// RUN: clang -emit-llvm-bc selectorcrash.m
// breaks for me.
SEL foo () {
  return @selector(value:);
}


More information about the cfe-dev mailing list