LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 10990 - error: LLVM IR generation of declaration 'BrowserWebView::initWithFrame:'
Summary: error: LLVM IR generation of declaration 'BrowserWebView::initWithFrame:'
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: LLVM Codegen (show other bugs)
Version: trunk
Hardware: Macintosh MacOS X
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-22 17:27 PDT by Marshall Greenblatt
Modified: 2011-09-26 13:15 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments
reduced repro (335 bytes, application/octet-stream)
2011-09-22 23:05 PDT, Nico Weber
Details
Patch (2.00 KB, patch)
2011-09-22 23:43 PDT, Nico Weber
Details
test case that shows that the previous patch attempt is wrong (2.29 KB, application/octet-stream)
2011-09-22 23:48 PDT, Nico Weber
Details
test case that shows that the previous patch attempt is wrong (930 bytes, application/octet-stream)
2011-09-22 23:56 PDT, Nico Weber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marshall Greenblatt 2011-09-22 17:27:27 PDT
$ uname -v
Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64

$ clang --version
clang version 3.0 (trunk 139990)
Target: x86_64-apple-darwin11.1.0
Thread model: posix

$ clang -c browser_webview_mac-rPF6f7.mii -arch i386
Assertion failed: (CurOffs <= CurLayObj->first), function getObjCEncodingForStructureImpl, file /Volumes/MacintoshHD2/src/chrome-git/src/third_party/llvm/tools/clang/lib/AST/ASTContext.cpp, line 4627.
0  clang             0x00000001013643f2 _ZL15PrintStackTracePv + 34
1  clang             0x00000001013649d9 _ZL13SignalHandleri + 713
2  libsystem_c.dylib 0x00007fff89c24cfa _sigtramp + 26
3  libsystem_c.dylib 0x00007fff89bed00e szone_malloc_should_clear + 1115
4  clang             0x000000010001c2b6 abort + 22
5  clang             0x000000010001c308 __assert_rtn + 56
6  clang             0x00000001007d2374 clang::ASTContext::getObjCEncodingForStructureImpl(clang::RecordDecl*, std::string&, clang::FieldDecl const*, bool) const + 2690
7  clang             0x00000001007d0fba clang::ASTContext::getObjCEncodingForTypeImpl(clang::QualType, std::string&, bool, bool, clang::FieldDecl const*, bool, bool, bool) const + 2526
8  clang             0x00000001007d1648 clang::ASTContext::getObjCEncodingForTypeImpl(clang::QualType, std::string&, bool, bool, clang::FieldDecl const*, bool, bool, bool) const + 4204
9  clang             0x00000001007d2ca7 clang::ASTContext::getObjCEncodingForMethodDecl(clang::ObjCMethodDecl const*, std::string&) const + 107
10 clang             0x00000001001f3f50 (anonymous namespace)::CGObjCCommonMac::GetMethodVarType(clang::ObjCMethodDecl const*) + 54
11 clang             0x00000001001f4441 (anonymous namespace)::CGObjCMac::GetMethodConstant(clang::ObjCMethodDecl const*) + 239
12 clang             0x0000000100205cda (anonymous namespace)::CGObjCMac::GenerateClass(clang::ObjCImplementationDecl const*) + 1308
13 clang             0x0000000100240ef0 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 768
14 clang             0x000000010024cbff (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 121
15 clang             0x0000000100234dd3 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 167
16 clang             0x00000001002569d2 clang::ParseAST(clang::Sema&, bool) + 306
17 clang             0x0000000100233fb0 clang::CodeGenAction::ExecuteAction() + 862
18 clang             0x0000000100039082 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 958
19 clang             0x0000000100023b91 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2193
20 clang             0x000000010001e03b cc1_main(char const**, char const**, char const*, void*) + 2939
21 clang             0x0000000100020be0 main + 640
22 clang             0x000000010001d4b4 start + 52
23 clang             0x0000000000000029 start + 18446744069414464425
Stack dump:
0.	Program arguments: /Users/marshall/code/chromium/src/third_party/llvm-build/Release+Asserts/bin/clang -cc1 -triple i386-apple-macosx10.7.1 -emit-obj -mrelax-all -disable-free -main-file-name browser_webview_mac-rPF6f7.mii -pic-level 1 -mdisable-fp-elim -masm-verbose -target-cpu yonah -target-linker-version 97.14 -coverage-file browser_webview_mac-rPF6f7.o -resource-dir /Users/marshall/code/chromium/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.0 -fdeprecated-macro -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-exceptions -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o browser_webview_mac-rPF6f7.o -x objective-c++-cpp-output /var/folders/65/gqj_ckvs0dg7ydj4qy9hj1200000gn/T/browser_webview_mac-rPF6f7.mii 
1.	<eof> parser at end of file
2.	/Users/marshall/code/chromium/src/cef/libcef/browser_webview_mac.mm:25:1: LLVM IR generation of declaration 'BrowserWebView::initWithFrame:'
clang: error: unable to execute command: Illegal instruction: 4
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: Error generating preprocessed source(s) - no preprocessable inputs.
Comment 1 Marshall Greenblatt 2011-09-22 17:34:19 PDT
The browser_webview_mac-rPF6f7.mii file is available here:
http://www.magpcss.net/patches/browser_webview_mac-rPF6f7.mii
Comment 2 Nico Weber 2011-09-22 17:51:37 PDT
Still happening with trunk (r140347). Reducing…
Comment 3 Nico Weber 2011-09-22 17:53:45 PDT
The failing assert was added by Argyrios in r131446.
Comment 4 Ted Kremenek 2011-09-22 19:48:22 PDT
cloned to <rdar://problem/10172840>
Comment 5 Nico Weber 2011-09-22 23:05:23 PDT
Created attachment 7333 [details]
reduced repro
Comment 6 Nico Weber 2011-09-22 23:43:30 PDT
Created attachment 7334 [details]
Patch

This seems to fix the problem, but I'm not sure it's the right fix.
Comment 7 Nico Weber 2011-09-22 23:48:52 PDT
Created attachment 7335 [details]
test case that shows that the previous patch attempt is wrong

Better test case.
Comment 8 Nico Weber 2011-09-22 23:56:41 PDT
Created attachment 7336 [details]
test case that shows that the previous patch attempt is wrong
Comment 9 Argyrios Kyrtzidis 2011-09-26 13:15:21 PDT
Fixed at r140542.