Skip to content
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

+[GREYDispatchQueueTracker load] fails when attempting rebind_symbols #1641

Closed
Mattmlm opened this issue Sep 11, 2021 · 5 comments
Closed

+[GREYDispatchQueueTracker load] fails when attempting rebind_symbols #1641

Mattmlm opened this issue Sep 11, 2021 · 5 comments

Comments

@Mattmlm
Copy link

Mattmlm commented Sep 11, 2021

When running EarlGrey 2 setup with whitebox via bazel on Xcode 13 Beta 5, I run into this issue on the host app (not the test runner app).

The callstack fails inside of fishhook.c, in this method perform_rebinding_with_section on this line:
indirect_symbol_bindings[i] = cur->rebindings[j].replacement;

The error is:
Thread 1: EXC_BAD_ACCESS (code=2, address=0x7fff80b9fce8)

With this output:

(lldb) p indirect_symbol_bindings
(void **) $7 = 0x00007fff80b9e588
(lldb) p cur
(rebindings_entry *) $8 = 0x0000600001259540
(lldb) p cur->rebindings
(rebinding *) $9 = 0x000060000205c1b0
(lldb) p cur->rebindings[j]
(rebinding) $10 = {
  name = 0x000000010ee72df2 "dispatch_after"
  replacement = 0x000000010e5741d0
  replaced = 0x0000000000000000
}
(lldb) p cur->rebindings[j].replacement
(void *) $11 = 0x000000010e5741d0

The full stack trace is here:

2021-09-10 13:12:03.848430-0700 HostAppEG2[94089:1522543] Crash handler setup started.
2021-09-10 13:12:03.848605-0700 HostAppEG2[94089:1522543] Crash handler setup completed.
2021-09-10 13:12:03.866055-0700 HostAppEG2[94089:1522543] Writing analzed variants.
2021-09-10 13:12:03.872509-0700 HostAppEG2[94089:1522543] Writing analzed variants.

(lldb) po [NSThread callStackSymbols]
<_NSCallStackArray 0x600000f262b0>(
0   ???                                 0x000000011aa32867 0x0 + 4741867623,
1   HostAppEG2             0x000000010e154c50 main + 0,
2   HostAppEG2             0x0000000110b22f9e rebind_symbols_for_image + 590,
3   HostAppEG2             0x0000000110b23152 _rebind_symbols_for_image + 50,
4   dyld                                0x000000011a68be19 ___ZN5dyld44APIs33_dyld_register_func_for_add_imageEPFvPK11mach_headerlE_block_invoke + 175,
5   dyld                                0x000000011a6780b5 _ZN5dyld412RuntimeState19withLoadersReadLockEU13block_pointerFvvE + 41,
6   dyld                                0x000000011a68bd1a _ZN5dyld44APIs33_dyld_register_func_for_add_imageEPFvPK11mach_headerlE + 116,
7   HostAppEG2             0x0000000110b2309d rebind_symbols + 93,
8   HostAppEG2             0x0000000110afd0e4 +[GREYDispatchQueueTracker load] + 1476,
9   libobjc.A.dylib                     0x00007fff2018cf26 load_images + 1419,
10  dyld                                0x000000011a67c9da _ZN5dyld412RuntimeState14notifyObjCInitEPKNS_6LoaderE + 170,
11  dyld                                0x000000011a6818cd _ZNK5dyld46Loader23runInitializersBottomUpERNS_12RuntimeStateERN5dyld35ArrayIPKS0_EE + 167,
12  dyld                                0x000000011a681976 _ZNK5dyld46Loader38runInitializersBottomUpPlusUpwardLinksERNS_12RuntimeStateE + 102,
13  dyld                                0x000000011a69023a _ZN5dyld44APIs25runAllInitializersForMainEv + 222,
14  dyld                                0x000000011a674920 _ZN5dyld4L7prepareERNS_4APIsEPKN5dyld313MachOAnalyzerE + 2306,
15  dyld                                0x000000011a674d3f _dyld_sim_prepare + 379,
16  ???                                 0x000000012078fc27 0x0 + 4839767079,
17  ???                                 0x000000012078d15e 0x0 + 4839756126,
18  ???                                 0x0000000120787224 0x0 + 4839731748,
19  ???                                 0x0000000120787025 0x0 + 4839731237
)
@aataraxiaa
Copy link

We are experiencing the same issue, stack trace as follows:

0   ???                                 0x0000000105db9530 0x0 + 4393243952,
1   EarlGreyApp                         0x0000000105bd8c40 main + 0,
2   EarlGrey                            0x00000001075fe5c3 rebind_symbols_for_image + 675,
3   EarlGrey                            0x00000001075fe734 _rebind_symbols_for_image + 36,
4   dyld                                0x0000000105c1de19 ___ZN5dyld44APIs33_dyld_register_func_for_add_imageEPFvPK11mach_headerlE_block_invoke + 175,
5   dyld                                0x0000000105c0a0b5 _ZN5dyld412RuntimeState19withLoadersReadLockEU13block_pointerFvvE + 41,
6   dyld                                0x0000000105c1dd1a _ZN5dyld44APIs33_dyld_register_func_for_add_imageEPFvPK11mach_headerlE + 116,
7   EarlGrey                            0x00000001075fe6aa rebind_symbols + 90,
8   EarlGrey                            0x00000001076062ab +[GREYDispatchQueueTracker load] + 2539,
9   libobjc.A.dylib                     0x00007fff2018cf26 load_images + 1419,
10  dyld                                0x0000000105c0e9da _ZN5dyld412RuntimeState14notifyObjCInitEPKNS_6LoaderE + 170,
11  dyld                                0x0000000105c138cd _ZNK5dyld46Loader23runInitializersBottomUpERNS_12RuntimeStateERN5dyld35ArrayIPKS0_EE + 167,
12  dyld                                0x0000000105c138bb _ZNK5dyld46Loader23runInitializersBottomUpERNS_12RuntimeStateERN5dyld35ArrayIPKS0_EE + 149,
13  dyld                                0x0000000105c13976 _ZNK5dyld46Loader38runInitializersBottomUpPlusUpwardLinksERNS_12RuntimeStateE + 102,
14  dyld                                0x0000000105c1edfb _ZN5dyld44APIs11dlopen_fromEPKciPv + 563,
15  CoreFoundation                      0x00007fff203355da _CFBundleDlfcnLoadBundle + 149,
16  CoreFoundation                      0x00007fff203062fb _CFBundleLoadExecutableAndReturnError + 256,
17  Foundation                          0x00007fff2070e8f9 -[NSBundle loadAndReturnError:] + 448,
18  libXCTestBundleInject.dylib         0x0000000105dbe52f __XCTestBundleInject + 727,
19  dyld                                0x0000000105c13819 ___ZNK5dyld46Loader25findAndRunAllInitializersERNS_12RuntimeStateE_block_invoke + 182,
20  dyld                                0x0000000105c2f891 ___ZNK5dyld313MachOAnalyzer18forEachInitializerER11DiagnosticsRKNS0_15VMAddrConverterEU13block_pointerFvjEPKv_block_invoke.256 + 129,
21  dyld                                0x0000000105c28d59 ___ZNK5dyld39MachOFile14forEachSectionEU13block_pointerFvRKNS0_11SectionInfoEbRbE_block_invoke + 564,
22  dyld                                0x0000000105c27ec3 _ZNK5dyld39MachOFile18forEachLoadCommandER11DiagnosticsU13block_pointerFvPK12load_commandRbE + 129,
23  dyld                                0x0000000105c28ae3 _ZNK5dyld39MachOFile14forEachSectionEU13block_pointerFvRKNS0_11SectionInfoEbRbE + 179,
24  dyld                                0x0000000105c2f2f2 _ZNK5dyld313MachOAnalyzer32forEachInitializerPointerSectionER11DiagnosticsU13block_pointerFvjjPKhRbE + 118,
25  dyld                                0x0000000105c2f534 _ZNK5dyld313MachOAnalyzer18forEachInitializerER11DiagnosticsRKNS0_15VMAddrConverterEU13block_pointerFvjEPKv + 386,
26  dyld                                0x0000000105c1374c _ZNK5dyld46Loader25findAndRunAllInitializersERNS_12RuntimeStateE + 144,
27  dyld                                0x0000000105c138d8 _ZNK5dyld46Loader23runInitializersBottomUpERNS_12RuntimeStateERN5dyld35ArrayIPKS0_EE + 178,
28  dyld                                0x0000000105c13976 _ZNK5dyld46Loader38runInitializersBottomUpPlusUpwardLinksERNS_12RuntimeStateE + 102,
29  dyld                                0x0000000105c2223a _ZN5dyld44APIs25runAllInitializersForMainEv + 222,
30  dyld                                0x0000000105c06920 _ZN5dyld4L7prepareERNS_4APIsEPKN5dyld313MachOAnalyzerE + 2306,
31  dyld                                0x0000000105c06d3f _dyld_sim_prepare + 379,
32  ???                                 0x000000010a089c27 0x0 + 4463303719,
33  ???                                 0x000000010a08715e 0x0 + 4463292766,
34  ???                                 0x000000010a081224 0x0 + 4463268388,
35  ???                                 0x000000010a081025 0x0 + 4463267877,
36  ???                                 0x0000000000000001 0x0 + 1

@tirodkar
Copy link
Collaborator

This seems related to a fishhook issue. We'll follow up here with next steps.

@tirodkar
Copy link
Collaborator

Should be fixed now with the latest PR. Fixed fishhook is now part of our source.

@aataraxiaa
Copy link

That's great news @tirodkar. Will there be a release containing this fix?

@adil-hussain-84
Copy link

@tirodkar Could we get a CocoaPods release please which contains this fix 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants