New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sporadic Failures: exit code 132 #417

Closed
allewun opened this Issue Sep 20, 2017 · 15 comments

Comments

Projects
None yet
6 participants
@allewun

allewun commented Sep 20, 2017

The project I'm working on uses Sourcery for two of its targets, which build frameworks that are then linked into the main app.

Our team has been noticing that Sourcery frequently fails during compilation. Simply re-compiling immediately after getting the error resolves the issue. However, it happens often enough to cause friction. It occurs on multiple machines and on CircleCI for our CI builds, so it's not isolated to my environment.

Any ideas what the issue might be or how to help debug this? It's hard to find a pattern, but it seems more frequent after switching git branches.

Thanks!

Setup

  • Xcode 8.3.3
  • Using Sourcery 0.8.0 installed via CocoaPods.
  • Run Script:
    "$PODS_ROOT/Sourcery/bin/sourcery" \
      --sources "${PROJECT_DIR}/../Project/NGCore/" \
      --templates "${PROJECT_DIR}/../Project/Templates/" \
      --output "${PROJECT_DIR}/../Project/NGCore/Sources/CodeGeneration/" \
      --disableCache

The Error

The number after "line 6" (i.e. 15042) always changes.

~/Project/../Pods/Sourcery/bin/sourcery: line 6: 15042 Illegal instruction: 4  "${parent_path}"/Sourcery.app/Contents/MacOS/Sourcery "$@"
Command /bin/sh failed with exit code 132

Here are a few more examples:

fail1


fail2

@Antondomashnev

This comment has been minimized.

Collaborator

Antondomashnev commented Sep 20, 2017

Hi @allewun, thanks for creating an issue. I'll try to take a look at it today.

@ilyapuchka

This comment has been minimized.

Collaborator

ilyapuchka commented Sep 20, 2017

@allewun do you use stencil or swift templates?

@allewun

This comment has been minimized.

allewun commented Sep 20, 2017

@ilyapuchka We are using 3 stencil templates: AutoCases, AutoEquatable, and AutoHashable.

@allewun

This comment has been minimized.

allewun commented Sep 20, 2017

It looks like these crashes are being logged (Console > User Reports). Here's the latest one:

Process:               Sourcery [82191]
Path:                  /Users/USER/*/Sourcery.app/Contents/MacOS/Sourcery
Identifier:            Sourcery
Version:               0.8.0 (1)
Code Type:             X86-64 (Native)
Parent Process:        ??? [82187]
Responsible:           Sourcery [82191]
User ID:               501

Date/Time:             2017-09-20 12:40:04.649 -0700
OS Version:            Mac OS X 10.12.6 (16G29)
Report Version:        12
Anonymous UUID:        D12577A7-9F91-CA96-CE6B-2B5CBCC422C1

Sleep/Wake UUID:       E8EFEA49-73E2-4720-B119-E55F81B1184A

Time Awake Since Boot: 93000 seconds
Time Since Wake:       15000 seconds

System Integrity Protection: enabled

Crashed Thread:        1  Dispatch queue: io.pixle.Sourcery.map.A2971249-3CB3-46F4-9BCD-C0FBCC764E06.1

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [0]

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff9aab1386 semaphore_wait_trap + 10
1   libdispatch.dylib             	0x00007fff9a96ca77 _os_semaphore_wait + 16
2   libdispatch.dylib             	0x00007fff9a95a7e9 _dispatch_group_wait_slow + 154
3   Pixle.Sourcery                	0x000000010f0b304d _TTSf4g_n_n_gs_g_g_g_g___TTSg5C8Sourcery10FileParser_C15SourceryRuntime16FileParserResult___TFFE8SourcerySa11parallelMapurFTFxqd__8progressGSqFSiT___GSaqd___U_FFxqd__T_ + 925
4   Pixle.Sourcery                	0x000000010f0b37c1 _TTSf4g_d_n___TTSg5C8Sourcery10FileParser_C15SourceryRuntime16FileParserResult___TFE8SourcerySa11parallelMapurfTFxqd__8progressGSqFSiT___GSaqd___ + 1089
5   Pixle.Sourcery                	0x000000010f057d28 _TFFC8Sourcery8SourceryP33_DB5C4364BFA94633EE953DD412A08C305parseFzT4fromGSaV7PathKit4Path_7excludeGSaS2__7modulesGSqGSaSS___T5typesC15SourceryRuntime5Types12inlineRangesGSaT4fileSS6rangesGVs10DictionarySSVSC8_NSRange____U_FzTSiS2__T_ + 4856
6   Pixle.Sourcery                	0x000000010f05e349 _TTSf4g_g_g_n___TFC8Sourcery8SourceryP33_DB5C4364BFA94633EE953DD412A08C305parsefzT4fromGSaV7PathKit4Path_7excludeGSaS2__7modulesGSqGSaSS___T5typesC15SourceryRuntime5Types12inlineRangesGSaT4fileSS6rangesGVs10DictionarySSVSC8_NSRange____ + 633
7   Pixle.Sourcery                	0x000000010f064d4b _TTSf4g_g_gs_n___TFFC8Sourcery8Sourcery12processFilesFzTOS_6Source14usingTemplatesVS_5Paths6outputV7PathKit4Path_GSqGSaCOS_13FolderWatcher5Local__U1_FzS1_T5typesC15SourceryRuntime5Types12inlineRangesGSaT4fileSS6rangesGVs10DictionarySSVSC8_NSRange____ + 123
8   Pixle.Sourcery                	0x000000010f066235 _TTSf4g_gs_n_n___TFC8Sourcery8Sourcery12processFilesfzTOS_6Source14usingTemplatesVS_5Paths6outputV7PathKit4Path_GSqGSaCOS_13FolderWatcher5Local__ + 2517
9   Pixle.Sourcery                	0x000000010f01d343 _TTSf4n_n_n_n_n_g_g_n_n_g___TFF8Sourcery6runCLIFT_T_U_FTSbSbSbSbSbGSaV7PathKit4Path_GSaS1__S1_S1_VS_15CustomArguments_T_ + 2467
10  Pixle.Sourcery                	0x000000010f019593 _TFF8Sourcery6runCLIFT_T_U_FTSbSbSbSbSbGSaV7PathKit4Path_GSaS1__S1_S1_VS_15CustomArguments_T_ + 35
11  Pixle.Sourcery                	0x000000010f021f34 _TPA__TTRXFo_dSbdSbdSbdSbdSboGSaV7PathKit4Path_oGSaS0__iS0_iS0_oV8Sourcery15CustomArguments_zoPs5Error__XFo_iSbiSbiSbiSbiSbiGSaS0__iGSaS0__iS0_iS0_iS2__zoPS3___ + 132
12  org.cocoapods.Commander       	0x000000010f1bbc4f _TFF9Commander7commandu8_RxS_18ArgumentDescriptor_S0_0_S0_1_S0_2_S0_3_S0_4_S0_5_S0_6_S0_7_S0_rFTxq_q0_q1_q2_q3_q4_q5_q6_q7_FzTwx9ValueTypew_S1_w0_S1_w1_S1_w2_S1_w3_S1_w4_S1_w5_S1_w6_S1_w7_S1__T__PS_11CommandType_U_FzCS_14ArgumentParserT_ + 4895
13  org.cocoapods.Commander       	0x000000010f1bc2ed _TPA__TFF9Commander7commandu8_RxS_18ArgumentDescriptor_S0_0_S0_1_S0_2_S0_3_S0_4_S0_5_S0_6_S0_7_S0_rFTxq_q0_q1_q2_q3_q4_q5_q6_q7_FzTwx9ValueTypew_S1_w0_S1_w1_S1_w2_S1_w3_S1_w4_S1_w5_S1_w6_S1_w7_S1__T__PS_11CommandType_U_FzCS_14ArgumentParserT_ + 877
14  org.cocoapods.Commander       	0x000000010f1a8a05 _TFE9CommanderPS_11CommandType3runfGSqSS_Os5Never + 1349
15  Pixle.Sourcery                	0x000000010f019568 _TF8Sourcery6runCLIFT_T_ + 2664
16  Pixle.Sourcery                	0x000000010f017b6b main + 187
17  libdyld.dylib                 	0x00007fff9a98a235 start + 1

Thread 1 Crashed:: Dispatch queue: io.pixle.Sourcery.map.A2971249-3CB3-46F4-9BCD-C0FBCC764E06.1
0   org.cocoapods.SourceKittenFramework	0x000000010f36cf04 _TFO21SourceKittenFramework7Request4sendfT_GVs10DictionarySSPS_22SourceKitRepresentable__ + 532
1   org.cocoapods.SourceKittenFramework	0x000000010f39edeb _TFV21SourceKittenFramework9SyntaxMapCfT4fileCS_4File_S0_ + 91
2   Pixle.Sourcery                	0x000000010f02ed7d _TTSf4g_g_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA16parseTypealiasesfT4fromGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__14containingTypeGSqC15SourceryRuntime4Type_9processedGSaGS1_SSPS3_____GSaCS4_9Typealias_ + 1885
3   Pixle.Sourcery                	0x000000010f02f708 _TTSf4g_n_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA15walkDeclarationfT6sourceGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__12containingInGSqTP_GS1_SSPS3_____10foundEntryFTOS2_20SwiftDeclarationKindSSO15SourceryRuntime11AccessLevelGSaSS_GS1_SSPS3___GSqP___GSqP___T_ + 2232
4   Pixle.Sourcery                	0x000000010f0304b8 _TTSf4g_n_n_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA16walkDeclarationsfT6sourceGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__12containingInGSqTP_GS1_SSPS3_____9processedRGSaGS1_SSPS3____10foundEntryFTOS2_20SwiftDeclarationKindSSO15SourceryRuntime11AccessLevelGSaSS_GS1_SSPS3___GSqP___GSqP___T_ + 2040
5   Pixle.Sourcery                	0x000000010f02f5a2 _TTSf4g_n_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA15walkDeclarationfT6sourceGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__12containingInGSqTP_GS1_SSPS3_____10foundEntryFTOS2_20SwiftDeclarationKindSSO15SourceryRuntime11AccessLevelGSaSS_GS1_SSPS3___GSqP___GSqP___T_ + 1874
6   Pixle.Sourcery                	0x000000010f0304b8 _TTSf4g_n_n_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA16walkDeclarationsfT6sourceGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__12containingInGSqTP_GS1_SSPS3_____9processedRGSaGS1_SSPS3____10foundEntryFTOS2_20SwiftDeclarationKindSSO15SourceryRuntime11AccessLevelGSaSS_GS1_SSPS3___GSqP___GSqP___T_ + 2040
7   Pixle.Sourcery                	0x000000010f02f5a2 _TTSf4g_n_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA15walkDeclarationfT6sourceGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__12containingInGSqTP_GS1_SSPS3_____10foundEntryFTOS2_20SwiftDeclarationKindSSO15SourceryRuntime11AccessLevelGSaSS_GS1_SSPS3___GSqP___GSqP___T_ + 1874
8   Pixle.Sourcery                	0x000000010f0304b8 _TTSf4g_n_n_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA16walkDeclarationsfT6sourceGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__12containingInGSqTP_GS1_SSPS3_____9processedRGSaGS1_SSPS3____10foundEntryFTOS2_20SwiftDeclarationKindSSO15SourceryRuntime11AccessLevelGSaSS_GS1_SSPS3___GSqP___GSqP___T_ + 2040
9   Pixle.Sourcery                	0x000000010f02f5a2 _TTSf4g_n_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA15walkDeclarationfT6sourceGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__12containingInGSqTP_GS1_SSPS3_____10foundEntryFTOS2_20SwiftDeclarationKindSSO15SourceryRuntime11AccessLevelGSaSS_GS1_SSPS3___GSqP___GSqP___T_ + 1874
10  Pixle.Sourcery                	0x000000010f0304b8 _TTSf4g_n_n_g_n___TFC8Sourcery10FileParserP33_135115014BC83D772AF5A228C422DBEA16walkDeclarationsfT6sourceGVs10DictionarySSP21SourceKittenFramework22SourceKitRepresentable__12containingInGSqTP_GS1_SSPS3_____9processedRGSaGS1_SSPS3____10foundEntryFTOS2_20SwiftDeclarationKindSSO15SourceryRuntime11AccessLevelGSaSS_GS1_SSPS3___GSqP___GSqP___T_ + 2040
11  Pixle.Sourcery                	0x000000010f022fee _TFC8Sourcery10FileParser5parsefT_C15SourceryRuntime16FileParserResult + 622
12  Pixle.Sourcery                	0x000000010f069845 _TTSf4g_g_n___TFC8Sourcery8SourceryP33_DB5C4364BFA94633EE953DD412A08C3011loadOrParsefT6parserCS_10FileParser10cachesPathKT_V7PathKit4Path_C15SourceryRuntime16FileParserResult + 85
13  Pixle.Sourcery                	0x000000010f06e62b _TPA__TFFFC8Sourcery8SourceryP33_DB5C4364BFA94633EE953DD412A08C305parseFzT4fromGSaV7PathKit4Path_7excludeGSaS2__7modulesGSqGSaSS___T5typesC15SourceryRuntime5Types12inlineRangesGSaT4fileSS6rangesGVs10DictionarySSVSC8_NSRange____U_FzTSiS2__T_U4_FCS_10FileParserCS3_16FileParserResult + 91
14  Pixle.Sourcery                	0x000000010f06e6c8 _TPA__TTRXFo_oC8Sourcery10FileParser_oC15SourceryRuntime16FileParserResult_XFo_iS0__iS2__ + 56
15  Pixle.Sourcery                	0x000000010f0b2bbe _TTSf4g_n___TTSg5GVs10ArraySliceC8Sourcery10FileParser_GS_S1__s10Collections_C15SourceryRuntime16FileParserResult___TFEsPs10Collection3mapurfzFzWx8Iterator7Element_qd__GSaqd___ + 526
16  Pixle.Sourcery                	0x000000010f0b3d16 _TTSf4g_n_n_n_g_g_g___TTSg5C8Sourcery10FileParser_C15SourceryRuntime16FileParserResult___TFFFE8SourcerySa11parallelMapurFTFxqd__8progressGSqFSiT___GSaqd___U_FFxqd__T_U_FT_T_ + 294
17  Pixle.Sourcery                	0x000000010f0b54db _TPA__TTSg5C8Sourcery10FileParser_C15SourceryRuntime16FileParserResult___TFFFE8SourcerySa11parallelMapurFTFxqd__8progressGSqFSiT___GSaqd___U_FFxqd__T_U_FT_T_ + 139
18  libdispatch.dylib             	0x00007fff9a95d524 _dispatch_call_block_and_release + 12
19  libdispatch.dylib             	0x00007fff9a9548fc _dispatch_client_callout + 8
20  libdispatch.dylib             	0x00007fff9a96a6f1 _dispatch_queue_serial_drain + 209
21  libdispatch.dylib             	0x00007fff9a95d306 _dispatch_queue_invoke + 1046
22  libdispatch.dylib             	0x00007fff9a963020 _dispatch_queue_override_invoke + 369
23  libdispatch.dylib             	0x00007fff9a9566b5 _dispatch_root_queue_drain + 476
24  libdispatch.dylib             	0x00007fff9a95648c _dispatch_worker_thread3 + 99
25  libsystem_pthread.dylib       	0x00007fff9aba35a2 _pthread_wqthread + 1299
26  libsystem_pthread.dylib       	0x00007fff9aba307d start_wqthread + 13

Thread 2:
0   libsystem_kernel.dylib        	0x00007fff9aab944e __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fff9aba348e _pthread_wqthread + 1023
2   libsystem_pthread.dylib       	0x00007fff9aba307d start_wqthread + 13

Thread 3:: Dispatch queue: com.apple.root.default-qos.overcommit
0   libdyld.dylib                 	0x00007fff9a9862cb dyld_stub_binder + 355
1   ???                           	0x000000011123f098 0 + 4582535320
2   com.apple.sourcekitd          	0x0000000111202b5a ___ZN10sourcekitd10initializeEv_block_invoke + 826
3   libxpc.dylib                  	0x00007fff9abddf96 _xpc_connection_call_event_handler + 35
4   libxpc.dylib                  	0x00007fff9abdfb98 do_mach_notify_port_destroyed + 166
5   libxpc.dylib                  	0x00007fff9abdfad4 _Xmach_notify_port_destroyed + 65
6   libxpc.dylib                  	0x00007fff9abdfa76 notify_server + 78
7   libxpc.dylib                  	0x00007fff9abe8bdc _xpc_connection_pass2mig + 165
8   libxpc.dylib                  	0x00007fff9abdc92d _xpc_connection_mach_event + 1665
9   libdispatch.dylib             	0x00007fff9a95a726 _dispatch_client_callout4 + 9
10  libdispatch.dylib             	0x00007fff9a95a999 _dispatch_mach_msg_invoke + 414
11  libdispatch.dylib             	0x00007fff9a96a7db _dispatch_queue_serial_drain + 443
12  libdispatch.dylib             	0x00007fff9a959497 _dispatch_mach_invoke + 868
13  libdispatch.dylib             	0x00007fff9a9566b5 _dispatch_root_queue_drain + 476
14  libdispatch.dylib             	0x00007fff9a95648c _dispatch_worker_thread3 + 99
15  libsystem_pthread.dylib       	0x00007fff9aba35a2 _pthread_wqthread + 1299
16  libsystem_pthread.dylib       	0x00007fff9aba307d start_wqthread + 13

Thread 1 crashed with X86 Thread State (64-bit):
  rax: 0x000070000c79f901  rbx: 0x0000000111201e90  rcx: 0x000000010f36fe74  rdx: 0x0000000000000000
  rdi: 0x000070000c79f978  rsi: 0x0000000000000000  rbp: 0x000070000c79f9c0  rsp: 0x000070000c79f8c0
   r8: 0x0000000000000fff   r9: 0x0000000000000025  r10: 0x0000000000000001  r11: 0x00007f869dd0f000
  r12: 0xc000000000000001  r13: 0x000000010f3b6c60  r14: 0x00007fffa38a8bc0  r15: 0x0000000000000000
  rip: 0x000000010f36cf04  rfl: 0x0000000000010202  cr2: 0x00007f8f070767a0
  
Logical CPU:     6
Error Code:      0x00000000
Trap Number:     6


Binary Images:
       0x10f016000 -        0x10f0c5fff +Pixle.Sourcery (0.8.0 - 1) <E2C14F99-10D4-36D6-9460-851748C5BD7E> /Users/USER/*/Sourcery.app/Contents/MacOS/Sourcery
       0x10f182000 -        0x10f1d8fff +org.cocoapods.Commander (0.6.0 - 1) <34E11D13-E098-3042-8D82-91FE2367198D> /Users/USER/*/Sourcery.app/Contents/Frameworks/Commander.framework/Versions/A/Commander
       0x10f230000 -        0x10f233ff7 +org.cocoapods.CommonCrypto (0.1.1 - 1) <5699D75C-64E3-322D-A673-F047CC609FB4> /Users/USER/*/Sourcery.app/Contents/Frameworks/CommonCrypto.framework/Versions/A/CommonCrypto
       0x10f241000 -        0x10f261fff +org.cocoapods.PathKit (0.8.0 - 1) <BC3E8A23-DD03-3198-B501-A20F82D3AEF2> /Users/USER/*/Sourcery.app/Contents/Frameworks/PathKit.framework/Versions/A/PathKit
       0x10f294000 -        0x10f2c6ff7 +org.cocoapods.SWXMLHash (3.0.4 - 1) <8E4FEC77-5120-30C6-8C70-36D4050B6651> /Users/USER/*/Sourcery.app/Contents/Frameworks/SWXMLHash.framework/Versions/A/SWXMLHash
       0x10f30e000 -        0x10f3b0fff +org.cocoapods.SourceKittenFramework (0.17.2 - 1) <430EE820-8AE9-3CA5-A59D-6E485FFA26AD> /Users/USER/*/Sourcery.app/Contents/Frameworks/SourceKittenFramework.framework/Versions/A/SourceKittenFramework
       0x10f46b000 -        0x10f4c2fff +org.cocoapods.Stencil (0.9.0 - 1) <82A5A06F-7F00-3655-83B4-CEDC7CA98F22> /Users/USER/*/Sourcery.app/Contents/Frameworks/Stencil.framework/Versions/A/Stencil
       0x10f521000 -        0x10f546ff7 +org.cocoapods.StencilSwiftKit (1.0.2 - 1) <2BB9F983-A672-3BFB-9D79-EDA78C76B446> /Users/USER/*/Sourcery.app/Contents/Frameworks/StencilSwiftKit.framework/Versions/A/StencilSwiftKit
       0x10f57b000 -        0x10f57fff7 +org.cocoapods.SwiftTryCatch (1.0.0 - 1) <8C8FAD9A-92DC-3A10-AF57-AAE8A612990A> /Users/USER/*/Sourcery.app/Contents/Frameworks/SwiftTryCatch.framework/Versions/A/SwiftTryCatch
       0x10f58a000 -        0x10f5cbff7 +org.cocoapods.XcodeEdit (1.0.0 - 1) <2CD895FE-3DCE-3C28-AFB3-869996735C8B> /Users/USER/*/Sourcery.app/Contents/Frameworks/XcodeEdit.framework/Versions/A/XcodeEdit
       0x10f62b000 -        0x10f6b9fff +org.cocoapods.Yams (0.3.2 - 1) <F656F985-17CF-3947-908B-2C21ED622286> /Users/USER/*/Sourcery.app/Contents/Frameworks/Yams.framework/Versions/A/Yams
       0x10f76d000 -        0x10f7f7fff +Pixel.SourceryRuntime (1.0 - 1) <BE23D52C-EA9E-33B5-AC20-5414A2C23E3A> /Users/USER/*/Sourcery.app/Contents/Frameworks/SourceryRuntime.framework/Versions/A/SourceryRuntime
      <<< TRUNCATED BY ALLEN >>>

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: 71025
    thread_create: 0
    thread_set_state: 7769

VM Region Summary:
ReadOnly portion of Libraries: Total=265.8M resident=0K(0%) swapped_out_or_unallocated=265.8M(100%)
Writable regions: Total=157.1M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=157.1M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Dispatch continuations            16.0M        2 
Kernel Alloc Once                    8K        2 
MALLOC                           131.3M       17 
MALLOC guard page                   32K        6 
STACK GUARD                       56.0M        5 
Stack                             9752K        5 
VM_ALLOCATE                          4K        2 
__DATA                            20.4M      225 
__IMAGE                            528K        2 
__LINKEDIT                       122.6M       30 
__TEXT                           143.3M      222 
__UNICODE                          556K        2 
shared memory                      304K        6 
===========                     =======  ======= 
TOTAL                            500.6M      513 
@allewun

This comment has been minimized.

allewun commented Sep 20, 2017

Digging a bit... For each Sourcery crash log, there's a corresponding SourceKitService crash log at the same timestamp:

Process:               SourceKitService [82193]
Path:                  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/sourcekitd.framework/Versions/A/XPCServices/SourceKitService.xpc/Contents/MacOS/SourceKitService
Identifier:            SourceKitService
Version:               1.0 (802.0.53)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
User ID:               501

Date/Time:             2017-09-20 12:40:04.649 -0700
OS Version:            Mac OS X 10.12.6 (16G29)
Report Version:        12
Anonymous UUID:        D12577A7-9F91-CA96-CE6B-2B5CBCC422C1

Sleep/Wake UUID:       E8EFEA49-73E2-4720-B119-E55F81B1184A

Time Awake Since Boot: 93000 seconds
Time Since Wake:       15000 seconds

System Integrity Protection: enabled

Crashed Thread:        2  Dispatch queue: com.apple.root.default-qos

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

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

VM Regions Near 0x7faa96c00000:
    MALLOC_TINY            00007faa8b800000-00007faa96c00000 [180.0M] rw-/rwx SM=PRV  
--> 
    Stack Guard            00007fff5a7db000-00007fff5dfdb000 [ 56.0M] ---/rwx SM=NUL  

Thread 0:: Dispatch queue: com.apple.root.default-qos.overcommit
0   libsystem_kernel.dylib        	0x00007fff9aab91e6 __sigsuspend_nocancel + 10
1   libdispatch.dylib             	0x00007fff9a962264 _dispatch_sigsuspend + 21
2   libdispatch.dylib             	0x00007fff9a96224f _dispatch_sig_thread + 41

Thread 1:
0   libsystem_kernel.dylib        	0x00007fff9aab944e __workq_kernreturn + 10
1   libsystem_pthread.dylib       	0x00007fff9aba3621 _pthread_wqthread + 1426
2   libsystem_pthread.dylib       	0x00007fff9aba307d start_wqthread + 13

Thread 2 Crashed:: Dispatch queue: com.apple.root.default-qos
0   com.apple.SourceKitService.802.0.53	0x00000001014bfd20 fillDictionaryForDiagnosticInfo(sourcekitd::ResponseBuilder::Dictionary, SourceKit::DiagnosticEntryInfoBase const&) + 320
1   com.apple.SourceKitService.802.0.53	0x00000001014bfa76 (anonymous namespace)::SKEditorConsumer::handleDiagnostic(SourceKit::DiagnosticEntryInfo const&, SourceKit::UIdent) + 262
2   com.apple.SourceKitService.802.0.53	0x0000000101487df4 SourceKit::SwiftEditorDocument::readSemanticInfo(llvm::IntrusiveRefCntPtr<SourceKit::ImmutableTextSnapshot>, SourceKit::EditorConsumer&) + 4420
3   com.apple.SourceKitService.802.0.53	0x000000010148d96c SourceKit::SwiftLangSupport::editorOpen(llvm::StringRef, llvm::MemoryBuffer*, bool, SourceKit::EditorConsumer&, llvm::ArrayRef<char const*>) + 1996
4   com.apple.SourceKitService.802.0.53	0x00000001014b3c23 handleRequestImpl(void*, std::__1::function<void (void*)>) + 7635
5   com.apple.SourceKitService.802.0.53	0x000000010144ad38 ___ZL35sourcekitdServer_peer_event_handlerP17_xpc_connection_sPv_block_invoke + 744
6   libdispatch.dylib             	0x00007fff9a95d524 _dispatch_call_block_and_release + 12
7   libdispatch.dylib             	0x00007fff9a9548fc _dispatch_client_callout + 8
8   libdispatch.dylib             	0x00007fff9a963196 _dispatch_queue_override_invoke + 743
9   libdispatch.dylib             	0x00007fff9a9566b5 _dispatch_root_queue_drain + 476
10  libdispatch.dylib             	0x00007fff9a95648c _dispatch_worker_thread3 + 99
11  libsystem_pthread.dylib       	0x00007fff9aba35a2 _pthread_wqthread + 1299
12  libsystem_pthread.dylib       	0x00007fff9aba307d start_wqthread + 13

Thread 2 crashed with X86 Thread State (64-bit):
  rax: 0x00007fa7b4aabbac  rbx: 0x0000000000000000  rcx: 0x0000000000000001  rdx: 0x0000000000000003
  rdi: 0x00007fa7b4aabba0  rsi: 0x00007faa87003438  rbp: 0x000070000aa842b0  rsp: 0x000070000aa84230
   r8: 0x006874676e656c2e   r9: 0x00007fa7b4aabbc0  r10: 0x00000000ffffffff  r11: 0xfffffffd2daa87a8
  r12: 0x00000001033d4108  r13: 0x00007faa00000000  r14: 0x00007fa7b4aaba90  r15: 0x00007faa96c00000
  rip: 0x00000001014bfd20  rfl: 0x0000000000010206  cr2: 0x00007faa96c00000
  
Logical CPU:     2
Error Code:      0x00000004
Trap Number:     14


Binary Images:
       0x101425000 -        0x10351bfff  com.apple.SourceKitService.802.0.53 (1.0 - 802.0.53) <8BB85557-80CE-38EB-8F2B-FD1F398D0462> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/sourcekitd.framework/Versions/A/XPCServices/SourceKitService.xpc/Contents/MacOS/SourceKitService
       0x108ab2000 -        0x108aefdc7  dyld (433.5) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fff993e0000 -     0x7fff993e1ffb  libSystem.B.dylib (1238.60.2) <F18AC1E7-C6F1-34B1-8069-BE571B3231D4> /usr/lib/libSystem.B.dylib
    0x7fff9951a000 -     0x7fff99570ff7  libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib
    0x7fff99571000 -     0x7fff9959aff7  libc++abi.dylib (307.4) <BC271AD3-831B-362A-9DA7-E8C51F285FE4> /usr/lib/libc++abi.dylib
    0x7fff99fe2000 -     0x7fff9a013ffb  libncurses.5.4.dylib (51.30.1) <B03B1BD2-7080-3856-BB02-7E8238320C3B> /usr/lib/libncurses.5.4.dylib
    0x7fff9a08f000 -     0x7fff9a461047  libobjc.A.dylib (709.1) <70614861-0340-32E2-85ED-FE65759CDFFA> /usr/lib/libobjc.A.dylib
    0x7fff9a88e000 -     0x7fff9a89fff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fff9a8ae000 -     0x7fff9a8b2ff7  libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib
    0x7fff9a8b3000 -     0x7fff9a8bdfff  libcommonCrypto.dylib (60092.50.5) <8A64D1B0-C70E-385C-92F0-E669079FDA90> /usr/lib/system/libcommonCrypto.dylib
    0x7fff9a8be000 -     0x7fff9a8c5fff  libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib
    0x7fff9a8c6000 -     0x7fff9a8cefff  libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib
    0x7fff9a8cf000 -     0x7fff9a952fdf  libcorecrypto.dylib (442.50.19) <65D7165E-2E71-335D-A2D6-33F78E2DF0C1> /usr/lib/system/libcorecrypto.dylib
    0x7fff9a953000 -     0x7fff9a984fff  libdispatch.dylib (703.50.37) <6582BAD6-ED27-3B30-B620-90B1C5A4AE3C> /usr/lib/system/libdispatch.dylib
    0x7fff9a985000 -     0x7fff9a98affb  libdyld.dylib (433.5) <9B2AC56D-107C-3541-A127-9094A751F2C9> /usr/lib/system/libdyld.dylib
    0x7fff9a98b000 -     0x7fff9a98bffb  libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib
    0x7fff9a999000 -     0x7fff9a999fff  liblaunch.dylib (972.70.1) <B856ABD2-896E-3DE0-B2C8-146A6AF8E2A7> /usr/lib/system/liblaunch.dylib
    0x7fff9a99a000 -     0x7fff9a99fff3  libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib
    0x7fff9a9a0000 -     0x7fff9a9a2ff3  libquarantine.dylib (85.50.1) <12448CC2-378E-35F3-BE33-9DC395A5B970> /usr/lib/system/libquarantine.dylib
    0x7fff9a9a3000 -     0x7fff9a9a4ffb  libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib
    0x7fff9a9a5000 -     0x7fff9a9bdff7  libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib
    0x7fff9a9be000 -     0x7fff9a9beff7  libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib
    0x7fff9a9bf000 -     0x7fff9aa4cfef  libsystem_c.dylib (1158.50.2) <E5AE5244-7D0C-36AC-8BB6-C7AE7EA52A4B> /usr/lib/system/libsystem_c.dylib
    0x7fff9aa4d000 -     0x7fff9aa50ffb  libsystem_configuration.dylib (888.60.2) <BECC01A2-CA8D-31E6-BCDF-D452965FA976> /usr/lib/system/libsystem_configuration.dylib
    0x7fff9aa51000 -     0x7fff9aa54fff  libsystem_coreservices.dylib (41.4) <7D26DE79-B424-3450-85E1-F7FAB32714AB> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff9aa55000 -     0x7fff9aa6dfff  libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib
    0x7fff9aa6e000 -     0x7fff9aa74fff  libsystem_dnssd.dylib (765.50.9) <CC960215-0B1B-3822-A13A-3DDE96FA796F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff9aa75000 -     0x7fff9aa9eff7  libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib
    0x7fff9aa9f000 -     0x7fff9aac1ff7  libsystem_kernel.dylib (3789.70.16) <34B1F16C-BC9C-3C5F-9045-0CAE91CB5914> /usr/lib/system/libsystem_kernel.dylib
    0x7fff9aac2000 -     0x7fff9ab09fe7  libsystem_m.dylib (3121.6) <86D499B5-BBDC-3D3B-8A4E-97AE8E6672A4> /usr/lib/system/libsystem_m.dylib
    0x7fff9ab0a000 -     0x7fff9ab28ff7  libsystem_malloc.dylib (116.50.8) <A3D15F17-99A6-3367-8C7E-4280E8619C95> /usr/lib/system/libsystem_malloc.dylib
    0x7fff9ab29000 -     0x7fff9ab82ffb  libsystem_network.dylib (856.60.1) <369D0221-56CA-3C3E-9EDE-94B41CAE77B7> /usr/lib/system/libsystem_network.dylib
    0x7fff9ab83000 -     0x7fff9ab8cff3  libsystem_networkextension.dylib (563.60.2) <B021F2B3-8A75-3633-ABB0-FC012B8E9B0C> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff9ab8d000 -     0x7fff9ab96ff3  libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib
    0x7fff9ab97000 -     0x7fff9ab9ffe7  libsystem_platform.dylib (126.50.8) <897462FD-B318-321B-A554-E61982630F7E> /usr/lib/system/libsystem_platform.dylib
    0x7fff9aba0000 -     0x7fff9abaaff7  libsystem_pthread.dylib (218.60.3) <B8FB5E20-3295-39E2-B5EB-B464D1D4B104> /usr/lib/system/libsystem_pthread.dylib
    0x7fff9abab000 -     0x7fff9abaeff7  libsystem_sandbox.dylib (592.70.1) <4B92EC49-ACD0-36AE-B07A-A2B8152EAF9D> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff9abaf000 -     0x7fff9abb0ff3  libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib
    0x7fff9abb1000 -     0x7fff9abb8ffb  libsystem_symptoms.dylib (532.50.47) <3390E07C-C1CE-348F-ADBD-2C5440B45EAA> /usr/lib/system/libsystem_symptoms.dylib
    0x7fff9abb9000 -     0x7fff9abccff7  libsystem_trace.dylib (518.70.1) <AC63A7FE-50D9-3A30-96E6-F6B7FF16E465> /usr/lib/system/libsystem_trace.dylib
    0x7fff9abcd000 -     0x7fff9abd2ffb  libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib
    0x7fff9abd3000 -     0x7fff9abfcff7  libxpc.dylib (972.70.1) <BF896DF0-D8E9-31A8-A4B3-01120BFEEE52> /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: 71025
    thread_create: 0
    thread_set_state: 7769

VM Region Summary:
ReadOnly portion of Libraries: Total=158.9M resident=0K(0%) swapped_out_or_unallocated=158.9M(100%)
Writable regions: Total=12.1G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=12.1G(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Dispatch continuations            16.0M        2 
Kernel Alloc Once                    8K        2 
MALLOC                            12.1G       24 
MALLOC guard page                   16K        4 
STACK GUARD                         12K        4 
Stack                             1572K        5 
Stack Guard                       64.0M        3 
__DATA                            2556K       45 
__LINKEDIT                       117.9M        4 
__TEXT                            41.1M       43 
shared memory                        8K        3 
===========                     =======  ======= 
TOTAL                             12.3G      128 
@andrewcl

This comment has been minimized.

andrewcl commented Sep 28, 2017

Any updates on this? I too am getting a failure w/ this same message. For reference, I'm using the AutoMockable stencil

@ilyapuchka

This comment has been minimized.

Collaborator

ilyapuchka commented Sep 28, 2017

In case you are using caching (it's on by default) please try to disable it and see if failures continue.

As this is paired with SourceKitService crashes I suspect this service itself is the point of failure, not Sourcery or SourceKitten that we use to communicate with SourceKitService. In this case it can be something specific related to your code base that makes it crash (I would expect it to crash in the Xcode too)

@andrewcl

This comment has been minimized.

andrewcl commented Sep 28, 2017

I just did a fresh install of 0.9.0. Would the caching still be relevant in this case?

Currently I'm switching between Xcode 8.3.3 and Xcode 9 so perhaps that's creating issues w/ SourceKitService?

@ilyapuchka

This comment has been minimized.

Collaborator

ilyapuchka commented Sep 28, 2017

We shouldn't use caches from previous version, but I would still disable caching at least for first run.
In case of switching Xcode's if that would be the reason I guess failures would be constant, not random.

@andrewcl

This comment has been minimized.

andrewcl commented Sep 28, 2017

It's switch b/w Xcode's for my case since the failures are constant. What would be a solution for resolving the SourceKitService issues in this case? Kill and restart SourceKitService?

@ilyapuchka

This comment has been minimized.

Collaborator

ilyapuchka commented Sep 28, 2017

Might help. In my case during migration I had to restart mac OS just to make Xcode build the project after versions switch.

@andrewcl

This comment has been minimized.

andrewcl commented Sep 28, 2017

Hmm, no go w/ a fresh restart and disabling caches. Any other solutions I should try?

@Liquidsoul

This comment has been minimized.

Collaborator

Liquidsoul commented Oct 5, 2017

@andrewcl do you have any unicode characters in the code you parse with Sourcery? (like emojis)
I've just had an error that seems like the one you're having and the issue was related to emojis introduced in the code.
This may not be related at all, but since you do not seem to have a workaround yet, I thought this may be related?
Hope this helps!

@krzysztofzablocki

This comment has been minimized.

Owner

krzysztofzablocki commented Nov 13, 2017

@Liquidsoul this might be related to #432

@krzysztofzablocki

This comment has been minimized.

Owner

krzysztofzablocki commented Dec 17, 2017

I'm going to close this for now as this is almost certainly related to the 432, we'll revisit once Apple fixes their bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment