Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

objc_direct attribute is broken with invocations from other compilation units #43186

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR44216
Status NEW
Importance P release blocker
Reported by Liu Liu (i@liuliu.me)
Reported on 2019-12-03 16:31:53 -0800
Last modified on 2019-12-05 13:31:43 -0800
Version trunk
Hardware PC All
CC i@liuliu.me, llvm-bugs@lists.llvm.org, madcoder@debian.org, neeilans@live.com, richard-llvm@metafoo.co.uk, rjmccall@apple.com
Fixed by commit(s)
Attachments reduced.mm (314 bytes, text/x-objcsrc)
direct.patch (943 bytes, text/plain)
Blocks
Blocked by
See also

I am experimenting with this attribute from commit: https://github.com/llvm/llvm-project/commit/d4e1ba3fa9dfec2613bdcc7db0b58dea490c56b1

I am on trunk 705a6aef350246c790ff8e73864dd27a640c59c8

Adding direct in property attribute to ordinary objc class with callsites from C++ side seems cause issues. Attached project exhibit this. Also attached crash stacktraces and clang diagnostic package.

Process:               clang-10 [60115]
Path:                  /Users/USER/*/clang-10
Identifier:            clang-10
Version:               10.0.0 (10.0)
Code Type:             X86-64 (Native)
Parent Process:        clang-10 [60113]
Responsible:           clang-10 [60115]
User ID:               502

Date/Time:             2019-12-03 16:26:05.160 -0800
OS Version:            Mac OS X 10.14.6 (18G1012)
Report Version:        12
Bridge OS Version:     3.0 (14Y906)
Anonymous UUID:        C4F0532E-C439-4C6E-B87B-991B4A18BF64

Sleep/Wake UUID:       D3B480F3-43E7-4383-8517-C594956F4391

Time Awake Since Boot: 190000 seconds
Time Since Wake:       21000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000030
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [60115]

VM Regions Near 0x30:
--> 
    __TEXT                 000000010c38a000-0000000110e3a000 [ 74.7M] r-x/r-x SM=COW  /Users/USER/*

Application Specific Information:
Stack dump:
0.  Program arguments: /Users/liuliu/Snapchat/Dev/llvm-project/build/bin/clang-10 -cc1 -triple x86_64-apple-ios10.0.0-simulator -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name SCTestDocObjectsBuilders.mm -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -masm-verbose -munwind-tables -target-sdk-version=13.2 -target-cpu core2 -dwarf-column-info -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=lldb -target-linker-version 520 -resource-dir /Users/liuliu/Snapchat/Dev/llvm-project/build/lib/clang/10.0.0 -dependency-file buck-out/gen/Apps/ClangBugReportDemo/ClangBugReportDemoBinary#compile-SCTestDocObjectsBuilders.mm.of70b8a92,iphonesimulator-x86_64/ClangBugReportDemo/SCTestDocObjectsBuilders.mm.o.dep -MT buck-out/gen/Apps/ClangBugReportDemo/ClangBugReportDemoBinary\#compile-SCTestDocObjectsBuilders.mm.of70b8a92,iphonesimulator-x86_64/ClangBugReportDemo/SCTestDocObjectsBuilders.mm.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -iquote /Users/liuliu/Snapchat/Dev/phantom -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -iquote /Users/liuliu/Snapchat/Dev/phantom -I buck-out/gen/Apps/ClangBugReportDemo/ClangBugReportDemoBinary#iphonesimulator-x86_64,private-headers.hmap -I buck-out -D OBJC_OLD_DISPATCH_PROTOTYPES=0 -D DEBUG -D SHAKE_TO_REPORT -D SHOTGUN_INTERNAL -D USE_HOCKEY -D SC_CREMA_SERVER_ENABLED -stdlib=libc++ -internal-isystem /Users/liuliu/Snapchat/Dev/llvm-project/build/bin/../include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/local/include -internal-isystem /Users/liuliu/Snapchat/Dev/llvm-project/build/lib/clang/10.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include -O0 -Werror -Wno-nonportable-include-path -Wno-block-capture-autoreleasing -Wno-unknown-warning-option -Wshorten-64-to-32 -Wall -Wextra -Wno-delete-non-virtual-dtor -Wno-unknown-pragmas -Wno-char-subscripts -Wno-missing-braces -Wno-reorder -Wno-overloaded-virtual -Wno-unused-property-ivar -Wno-unused-local-typedef -Wno-ignored-qualifiers -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-nullability-completeness -std=c++1z -fdeprecated-macro -fdebug-compilation-dir /Users/liuliu/Snapchat/Dev/phantom -fdebug-prefix-map=/Applications/Xcode.app/Contents/Developer=APPLE_DEVELOPER_DIR -fdebug-prefix-map=/Users/liuliu/Snapchat/Dev/phantom=. -fdebug-prefix-map=/Users/liuliu/Snapchat/Dev/phantom=.///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -fdebug-prefix-map=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform=APPLE_PLATFORM_DIR -fdebug-prefix-map=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk=APPLE_SDKROOT -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fencode-extended-block-signature -fcoroutines-ts -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmodules -fimplicit-module-maps -fmodules-cache-path=/var/folders/mx/63c2qlgd7wdf1j22jkhb5lrw0000gp/C/org.llvm.clang.liuliu/ModuleCache -fmodules-validate-system-headers -fobjc-runtime=ios-10.0.0 -fobjc-arc -fobjc-arc-cxxlib=libc++ -fobjc-arc-exceptions -fobjc-exceptions -fcxx-exceptions -fexceptions -fno-aligned-allocation -fmax-type-align=16 -fno-common -fdiagnostics-show-option -fcolor-diagnostics -fdebug-compilation-dir .///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -o buck-out/gen/Apps/ClangBugReportDemo/ClangBugReportDemoBinary#compile-SCTestDocObjectsBuilders.mm.of70b8a92,iphonesimulator-x86_64/ClangBugReportDemo/SCTestDocObjectsBuilders.mm.o -x objective-c++ Apps/ClangBugReportDemo/ClangBugReportDemo/SCTestDocObjectsBuilders.mm 
1.  Apps/ClangBugReportDemo/ClangBugReportDemo/SCTestDocObjectsBuilders.mm:139:71: current parser token ';'
2.  Apps/ClangBugReportDemo/ClangBugReportDemo/SCTestDocObjectsBuilders.mm:136:26: LLVM IR generation of declaration 'SCTestMainEntityBuilder::SCTestMainEntityBuilder'
3.  Apps/ClangBugReportDemo/ClangBugReportDemo/SCTestDocObjectsBuilders.mm:136:26: Generating code for declaration 'SCTestMainEntityBuilder::SCTestMainEntityBuilder'

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   clang-10                        0x000000010e09eb18 clang::CodeGen::CodeGenTypes::arrangeObjCMethodDeclaration(clang::ObjCMethodDecl const*) + 8
1   clang-10                        0x000000010e1b84b3 (anonymous namespace)::CGObjCCommonMac::GenerateDirectMethod(clang::ObjCMethodDecl const*, clang::ObjCContainerDecl const*) + 227
2   clang-10                        0x000000010e1b7928 (anonymous namespace)::CGObjCCommonMac::EmitMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, clang::Selector, llvm::Value*, clang::QualType, bool, clang::CodeGen::CallArgList const&, clang::ObjCMethodDecl const*, clang::ObjCInterfaceDecl const*, (anonymous namespace)::ObjCCommonTypesHelper const&) + 984
3   clang-10                        0x000000010e1c083d (anonymous namespace)::CGObjCNonFragileABIMac::GenerateMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, clang::Selector, llvm::Value*, clang::CodeGen::CallArgList const&, clang::ObjCInterfaceDecl const*, clang::ObjCMethodDecl const*) + 237
4   clang-10                        0x000000010e174117 clang::CodeGen::CGObjCRuntime::GeneratePossiblySpecializedMessageSend(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::QualType, clang::Selector, llvm::Value*, clang::CodeGen::CallArgList const&, clang::ObjCInterfaceDecl const*, clang::ObjCMethodDecl const*, bool) + 87
5   clang-10                        0x000000010e175440 clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(clang::ObjCMessageExpr const*, clang::CodeGen::ReturnValueSlot) + 3600
6   clang-10                        0x000000010e14b8b7 clang::StmtVisitorBase<std::__1::add_pointer, (anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 12391
7   clang-10                        0x000000010e1407fd clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 77
8   clang-10                        0x000000010e183b54 (anonymous namespace)::ARCExprEmitter<(anonymous namespace)::ARCRetainExprEmitter, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >::visit(clang::Expr const*) + 1012
9   clang-10                        0x000000010e183f1f (anonymous namespace)::ARCExprEmitter<(anonymous namespace)::ARCRetainExprEmitter, llvm::PointerIntPair<llvm::Value*, 1u, bool, llvm::PointerLikeTypeTraits<llvm::Value*>, llvm::PointerIntPairInfo<llvm::Value*, 1u, llvm::PointerLikeTypeTraits<llvm::Value*> > > >::visit(clang::Expr const*) + 1983
10  clang-10                        0x000000010e17f1e4 clang::CodeGen::CodeGenFunction::EmitARCRetainScalarExpr(clang::Expr const*) + 196
11  clang-10                        0x000000010e0e5e64 clang::CodeGen::CodeGenFunction::EmitScalarInit(clang::Expr const*, clang::ValueDecl const*, clang::CodeGen::LValue, bool) + 596
12  clang-10                        0x000000010e0b560d clang::CodeGen::CodeGenFunction::EmitInitializerForField(clang::FieldDecl*, clang::CodeGen::LValue, clang::Expr*) + 429
13  clang-10                        0x000000010e0bea8d EmitMemberInitializer(clang::CodeGen::CodeGenFunction&, clang::CXXRecordDecl const*, clang::CXXCtorInitializer*, clang::CXXConstructorDecl const*, clang::CodeGen::FunctionArgList&) + 813
14  clang-10                        0x000000010e0b6c4f clang::CodeGen::CodeGenFunction::EmitCtorPrologue(clang::CXXConstructorDecl const*, clang::CXXCtorType, clang::CodeGen::FunctionArgList&) + 2239
15  clang-10                        0x000000010e0b6098 clang::CodeGen::CodeGenFunction::EmitConstructorBody(clang::CodeGen::FunctionArgList&) + 472
16  clang-10                        0x000000010e285fa0 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 880
17  clang-10                        0x000000010e09ad25 clang::CodeGen::CodeGenModule::codegenCXXStructor(clang::GlobalDecl) + 213
18  clang-10                        0x000000010e305afd (anonymous namespace)::ItaniumCXXABI::emitCXXStructor(clang::GlobalDecl) + 765
19  clang-10                        0x000000010e299a5b clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) + 267
20  clang-10                        0x000000010e30124b (anonymous namespace)::ItaniumCXXABI::EmitCXXConstructors(clang::CXXConstructorDecl const*) + 43
21  clang-10                        0x000000010e320f2f (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 127
22  clang-10                        0x000000010e27d5d1 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 177
23  clang-10                        0x000000010f207742 clang::ParseAST(clang::Sema&, bool, bool) + 514
24  clang-10                        0x000000010e5581ba clang::FrontendAction::Execute() + 154
25  clang-10                        0x000000010e4ecddf clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1519
26  clang-10                        0x000000010e5c6cfe clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1726
27  clang-10                        0x000000010c3919fc cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2444
28  clang-10                        0x000000010c38f3ab main + 10747
29  libdyld.dylib                   0x00007fff65ba33d5 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x00007f8d75006ad8  rcx: 0x000000000000005d  rdx: 0x0000000000000000
  rdi: 0x00007f8d75006ad8  rsi: 0x00007f8d751a2fb0  rbp: 0x00007ffee386bd60  rsp: 0x00007ffee386bd60
   r8: 0x0000000000000000   r9: 0x0000000000000010  r10: 0x00007f8d75004a88  r11: 0x00000000000000cb
  r12: 0x00007f8d75800a00  r13: 0x00007f8d751a2fb0  r14: 0x00007f8d75800a00  r15: 0x00007f8d751a2fb0
  rip: 0x000000010e09eb18  rfl: 0x0000000000010206  cr2: 0x0000000000000030

Logical CPU:     6
Error Code:      0x00000004
Trap Number:     14

Binary Images:
       0x10c38a000 -        0x110e39ff7 +clang-10 (10.0.0 - 10.0) <D2D52E46-252B-325E-A15A-5AC5EC446935> /Users/USER/*/clang-10
       0x1169ea000 -        0x116a5470f  dyld (655.1.1) <615654D5-B6C5-3D83-A146-34A3EA6D3A80> /usr/lib/dyld
    0x7fff62b87000 -     0x7fff62b88ffb  libSystem.B.dylib (1252.250.1) <2CBD96C4-5698-363C-A22E-BFB6FF686FB4> /usr/lib/libSystem.B.dylib
    0x7fff62dcc000 -     0x7fff62e1fff7  libc++.1.dylib (400.9.4) <9A60A190-6C34-339F-BB3D-AACE942009A4> /usr/lib/libc++.1.dylib
    0x7fff62e20000 -     0x7fff62e35ff7  libc++abi.dylib (400.17) <38C09CED-9090-3719-90F3-04A2749F5428> /usr/lib/libc++abi.dylib
    0x7fff63e0a000 -     0x7fff63e3afff  libncurses.5.4.dylib (53.200.3) <767B4D3D-CF4C-33DF-B282-0CAC013A7AD0> /usr/lib/libncurses.5.4.dylib
    0x7fff643c0000 -     0x7fff64b45fdf  libobjc.A.dylib (756.2) <7C312627-43CB-3234-9324-4DEA92D59F50> /usr/lib/libobjc.A.dylib
    0x7fff65230000 -     0x7fff65242ff7  libz.1.dylib (70.200.4) <B048FC1F-058F-3A08-A1FE-81D5308CB3E6> /usr/lib/libz.1.dylib
    0x7fff65a26000 -     0x7fff65a2aff3  libcache.dylib (81) <1987D1E1-DB11-3291-B12A-EBD55848E02D> /usr/lib/system/libcache.dylib
    0x7fff65a2b000 -     0x7fff65a35ff3  libcommonCrypto.dylib (60118.250.2) <1765BB6E-6784-3653-B16B-CB839721DC9A> /usr/lib/system/libcommonCrypto.dylib
    0x7fff65a36000 -     0x7fff65a3dff7  libcompiler_rt.dylib (63.4) <5212BA7B-B7EA-37B4-AF6E-AC4F507EDFB8> /usr/lib/system/libcompiler_rt.dylib
    0x7fff65a3e000 -     0x7fff65a47ff7  libcopyfile.dylib (146.250.1) <98CD00CD-9B91-3B5C-A9DB-842638050FA8> /usr/lib/system/libcopyfile.dylib
    0x7fff65a48000 -     0x7fff65accfc3  libcorecrypto.dylib (602.260.2) <01464D24-570C-3B83-9D18-467769E0FCDD> /usr/lib/system/libcorecrypto.dylib
    0x7fff65b53000 -     0x7fff65b8cff7  libdispatch.dylib (1008.270.1) <97273678-E94C-3C8C-89F6-2E2020F4B43B> /usr/lib/system/libdispatch.dylib
    0x7fff65b8d000 -     0x7fff65bb9ff7  libdyld.dylib (655.1.1) <002418CC-AD11-3D10-865B-015591D24E6C> /usr/lib/system/libdyld.dylib
    0x7fff65bba000 -     0x7fff65bbaffb  libkeymgr.dylib (30) <0D0F9CA2-8D5A-3273-8723-59987B5827F2> /usr/lib/system/libkeymgr.dylib
    0x7fff65bc8000 -     0x7fff65bc8ff7  liblaunch.dylib (1336.261.2) <2B07E27E-D404-3E98-9D28-BCA641E5C479> /usr/lib/system/liblaunch.dylib
    0x7fff65bc9000 -     0x7fff65bcefff  libmacho.dylib (927.0.3) <A377D608-77AB-3F6E-90F0-B4F251A5C12F> /usr/lib/system/libmacho.dylib
    0x7fff65bcf000 -     0x7fff65bd1ff7  libquarantine.dylib (86.270.1) <50A89DAB-7E34-3347-9AD5-68957B27EFD2> /usr/lib/system/libquarantine.dylib
    0x7fff65bd2000 -     0x7fff65bd3ff7  libremovefile.dylib (45.200.2) <9FBEB2FF-EEBE-31BC-BCFC-C71F8D0E99B6> /usr/lib/system/libremovefile.dylib
    0x7fff65bd4000 -     0x7fff65bebff3  libsystem_asl.dylib (356.200.4) <A62A7249-38B8-33FA-9875-F1852590796C> /usr/lib/system/libsystem_asl.dylib
    0x7fff65bec000 -     0x7fff65becff7  libsystem_blocks.dylib (73) <A453E8EE-860D-3CED-B5DC-BE54E9DB4348> /usr/lib/system/libsystem_blocks.dylib
    0x7fff65bed000 -     0x7fff65c74fff  libsystem_c.dylib (1272.250.1) <7EDACF78-2FA3-35B8-B051-D70475A35117> /usr/lib/system/libsystem_c.dylib
    0x7fff65c75000 -     0x7fff65c78ffb  libsystem_configuration.dylib (963.270.3) <2B4A836D-68A4-33E6-8D48-CD4486B03387> /usr/lib/system/libsystem_configuration.dylib
    0x7fff65c79000 -     0x7fff65c7cff7  libsystem_coreservices.dylib (66) <719F75A4-74C5-3BA6-A09E-0C5A3E5889D7> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff65c7d000 -     0x7fff65c83fff  libsystem_darwin.dylib (1272.250.1) <EC9B39A5-9592-3577-8997-7DC721D20D8C> /usr/lib/system/libsystem_darwin.dylib
    0x7fff65c84000 -     0x7fff65c8affb  libsystem_dnssd.dylib (878.270.3) <97EEE658-D935-33C8-B56E-0F41EA7F6B43> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff65c8b000 -     0x7fff65cd6ffb  libsystem_info.dylib (517.200.9) <D09D5AE0-2FDC-3A6D-93EC-729F931B1457> /usr/lib/system/libsystem_info.dylib
    0x7fff65cd7000 -     0x7fff65cffff7  libsystem_kernel.dylib (4903.278.12) <210C5A31-0B19-3AA3-98E4-686F1DD3983E> /usr/lib/system/libsystem_kernel.dylib
    0x7fff65d00000 -     0x7fff65d4bff7  libsystem_m.dylib (3158.200.7) <F19B6DB7-014F-3820-831F-389CCDA06EF6> /usr/lib/system/libsystem_m.dylib
    0x7fff65d4c000 -     0x7fff65d76fff  libsystem_malloc.dylib (166.270.1) <011F3AD0-8E6A-3A89-AE64-6E5F6840F30A> /usr/lib/system/libsystem_malloc.dylib
    0x7fff65d77000 -     0x7fff65d81ff7  libsystem_networkextension.dylib (767.250.2) <FF06F13A-AEFE-3A27-A073-910EF78AEA36> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff65d82000 -     0x7fff65d89fff  libsystem_notify.dylib (172.200.21) <145B5CFC-CF73-33CE-BD3D-E8DDE268FFDE> /usr/lib/system/libsystem_notify.dylib
    0x7fff65d8a000 -     0x7fff65d93fef  libsystem_platform.dylib (177.270.1) <9D1FE5E4-EB7D-3B3F-A8D1-A96D9CF1348C> /usr/lib/system/libsystem_platform.dylib
    0x7fff65d94000 -     0x7fff65d9eff7  libsystem_pthread.dylib (330.250.2) <2D5C08FF-484F-3D59-9132-CE1DCB3F76D7> /usr/lib/system/libsystem_pthread.dylib
    0x7fff65d9f000 -     0x7fff65da2ff7  libsystem_sandbox.dylib (851.270.1) <9494594B-5199-3186-82AB-5FF8BED6EE16> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff65da3000 -     0x7fff65da5ff3  libsystem_secinit.dylib (30.260.2) <EF1EA47B-7B22-35E8-BD9B-F7003DCB96AE> /usr/lib/system/libsystem_secinit.dylib
    0x7fff65da6000 -     0x7fff65dadff3  libsystem_symptoms.dylib (820.267.1) <03F1C2DD-0F5A-3D9D-88F6-B26C0F94EB52> /usr/lib/system/libsystem_symptoms.dylib
    0x7fff65dae000 -     0x7fff65dc3fff  libsystem_trace.dylib (906.260.1) <FC761C3B-5434-3A52-912D-F1B15FAA8EB2> /usr/lib/system/libsystem_trace.dylib
    0x7fff65dc5000 -     0x7fff65dcaffb  libunwind.dylib (35.4) <24A97A67-F017-3CFC-B0D0-6BD0224B1336> /usr/lib/system/libunwind.dylib
    0x7fff65dcb000 -     0x7fff65dfafff  libxpc.dylib (1336.261.2) <7DEE2300-6D8E-3C00-9C63-E3E80D56B0C4> /usr/lib/system/libxpc.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 26001413
    thread_create: 0
    thread_set_state: 498

VM Region Summary:
ReadOnly portion of Libraries: Total=323.3M resident=0K(0%) swapped_out_or_unallocated=323.3M(100%)
Writable regions: Total=103.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=103.7M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                    8K        1 
MALLOC                            95.5M       20 
MALLOC guard page                   16K        4 
STACK GUARD                       56.0M        1 
Stack                             8192K        1 
__DATA                            10.3M       41 
__LINKEDIT                       236.7M        3 
__TEXT                            86.6M       41 
mapped file                       27.7M       17 
shared memory                        8K        2 
===========                     =======  ======= 
TOTAL                            520.7M      131 
Quuxplusone commented 4 years ago

MadCoder, please advise whether you are aware of this issue. Thanks. I am going to have a debug version and dig this a bit today as well.

Quuxplusone commented 4 years ago

Did you mean to attach something to this bug?

If you can reduce a self-contained test case that crashes, that would be very helpful. Looks like it's in the constructor for SCTestMainEntityBuilder.

Quuxplusone commented 4 years ago

Attached reduced.mm (314 bytes, text/x-objcsrc): Reduced test case

Quuxplusone commented 4 years ago

Thanks, that's perfect.

Quuxplusone commented 4 years ago

Attached direct.patch (943 bytes, text/plain): patch to fix getSelfType

Quuxplusone commented 4 years ago

We can move discussions there. There are some other bugs I need to fix along the way. It appears there are additional mangling going on in CodeGen part that makes GetNameForMethod won't return correct linkage name for a method. Do you have any pointers on this?

Quuxplusone commented 4 years ago
(In reply to Liu Liu from comment #7)
> We can move discussions there. There are some other bugs I need to fix along
> the way. It appears there are additional mangling going on in CodeGen part
> that makes GetNameForMethod won't return correct linkage name for a method.
> Do you have any pointers on this?

Email would probably be a more productive venue for that.  I don't know why
there'd be additional mangling; ObjCMethodDecls shouldn't be able to
accidentally
fall into the C++ name-mangling paths.