Skip to content

Instantly share code, notes, and snippets.

@claui
Created September 1, 2020 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claui/c29c94efe38280a290b2b58fc69134b4 to your computer and use it in GitHub Desktop.
Save claui/c29c94efe38280a290b2b58fc69134b4 to your computer and use it in GitHub Desktop.
Bash crashes while loading pyenv-realpath.dylib
Process: bash [56267]
Path: /bin/bash
Identifier: bash
Version: 123
Code Type: ARM-64 (Native)
Parent Process: ??? [56263]
Responsible: Terminal [5711]
User ID: 430
Date/Time: 2020-09-01 16:09:34.931 +0200
OS Version: Mac OS X 10.16 (20A5354i)
Report Version: 12
Anonymous UUID: 65BB1F74-349F-0C3F-FCD8-EF5C39966EAB
Time Awake Since Boot: 850000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes: 0x0000000000000032, 0x0000000104e78000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 0x2
kernel messages:
VM Regions Near 0x104e78000:
MALLOC metadata 104e74000-104e78000 [ 16K] r--/rwx SM=PRV
--> mapped file 104e78000-104e7c000 [ 16K] r-x/rwx SM=COW Object_id=55052a59
VM_ALLOCATE (reserved) 104e7c000-104e88000 [ 48K] rw-/rwx SM=NUL reserved VM address space (unallocated)
Application Specific Information:
dyld3 mode
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libdyld.dylib 0x00000001d29df514 dyld3::MachOFile::isMachO(Diagnostics&, unsigned long long) const + 28
1 libdyld.dylib 0x00000001d29f62ec invocation function for block in dyld3::Loader::mapImage(Diagnostics&, dyld3::LoadedImage&, bool, bool*) + 372
2 libdyld.dylib 0x00000001d29f62ec invocation function for block in dyld3::Loader::mapImage(Diagnostics&, dyld3::LoadedImage&, bool, bool*) + 372
3 libdyld.dylib 0x00000001d29d6868 dyld3::closure::Image::forEachDiskSegment(void (unsigned int, unsigned int, unsigned int, long long, unsigned long long, unsigned char, bool, bool&) block_pointer) const + 276
4 libdyld.dylib 0x00000001d29f5c08 dyld3::Loader::mapImage(Diagnostics&, dyld3::LoadedImage&, bool, bool*) + 1512
5 libdyld.dylib 0x00000001d29f510c dyld3::Loader::mapAndFixupAllImages(Diagnostics&, bool, bool, bool*, bool*) + 412
6 libdyld.dylib 0x00000001d29f20d4 dyld3::AllImages::loadImage(Diagnostics&, char const*, unsigned int, dyld3::closure::DlopenClosure const*, bool, bool, bool, bool, void const*) + 532
7 libdyld.dylib 0x00000001d29f1d34 dyld3::AllImages::dlopen(Diagnostics&, char const*, bool, bool, bool, bool, bool, void const*, bool) + 904
8 libdyld.dylib 0x00000001d29d7fa8 dyld3::dlopen_internal(char const*, int, void*) + 196
9 libdyld.dylib 0x00000001d29d7e7c dlopen + 116
10 bash 0x0000000104da75b4 0x104d94000 + 79284
11 bash 0x0000000104db88d4 0x104d94000 + 149716
12 bash 0x0000000104db6874 0x104d94000 + 141428
13 bash 0x0000000104db3d28 0x104d94000 + 130344
14 bash 0x0000000104db4ba8 0x104d94000 + 134056
15 bash 0x0000000104db3d28 0x104d94000 + 130344
16 bash 0x0000000104db3878 0x104d94000 + 129144
17 bash 0x0000000104d98228 0x104d94000 + 16936
18 libdyld.dylib 0x00000001d29e8a04 start + 4
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000104e78000 x1: 0x000000016b06a268 x2: 0x0000000000004000 x3: 0x0000000000040012
x4: 0x0000000000000003 x5: 0x0000000000000000 x6: 0x0000000000000005 x7: 0x0000000000000000
x8: 0x000000016b065670 x9: 0x00000000feedfacf x10: 0x0000000000000001 x11: 0x0000000000004000
x12: 0x000000000000c1c0 x13: 0x00000001f5779fd0 x14: 0x00000001d2a07000 x15: 0x000000016b061c28
x16: 0x00000001d2b520c4 x17: 0x00000001f577b548 x18: 0x0000000000000000 x19: 0x000000016b06a268
x20: 0x000000016b0655d0 x21: 0x0000000000000000 x22: 0x0000000000000005 x23: 0x0000000000004000
x24: 0x0000000000000000 x25: 0x0000000000004000 x26: 0x0000000000000001 x27: 0x0000000104e78000
x28: 0x0000000000000016 fp: 0x000000016b065400 lr: 0xc1658001d29f62ec
sp: 0x000000016b0653f0 pc: 0x00000001d29df514 cpsr: 0x20000000
far: 0x0000000104e78000 esr: 0x92000007
Binary Images:
0x104d94000 - 0x104e1bfff bash (123) <CB499B2B-5EAA-35B4-9FEB-125CFEEECDE9> /bin/bash
0x1051b0000 - 0x10522bfff dyld (828) <B7C477DF-6B8F-310C-B39A-4A1FA2CE901D> /usr/lib/dyld
0x1cf97c000 - 0x1cf97dfff libSystem.B.dylib (1292) <F19B5F1A-FAB9-357C-8055-FC4F6DA399BD> /usr/lib/libSystem.B.dylib
0x1cfd64000 - 0x1cfdbffff libc++.1.dylib (904.4) <9664CCFF-3E52-3158-9763-FD11158FEA12> /usr/lib/libc++.1.dylib
0x1cfdc0000 - 0x1cfdd5fff libc++abi.dylib (904.4) <ED02BC97-F9B4-389A-848D-B93FF1030ADB> /usr/lib/libc++abi.dylib
0x1d0fb6000 - 0x1d0fe5fff libncurses.5.4.dylib (57) <0EABD098-CE84-3BF3-8718-87F31E1CF434> /usr/lib/libncurses.5.4.dylib
0x1d18c5000 - 0x1d18ccfff liboah.dylib (188.1) <CC9526E3-926B-33CD-909A-E588AA0CB50A> /usr/lib/liboah.dylib
0x1d18cd000 - 0x1d1905fff libobjc.A.dylib (818) <7C7D8162-5DD8-34C8-BFA1-F20DA5F20526> /usr/lib/libobjc.A.dylib
0x1d2819000 - 0x1d281efff libcache.dylib (83) <C7F4443F-112F-3AD8-A200-947881B36BEB> /usr/lib/system/libcache.dylib
0x1d281f000 - 0x1d282cfff libcommonCrypto.dylib (60178) <BA472F58-6E07-319F-8CB6-1E70CC72343B> /usr/lib/system/libcommonCrypto.dylib
0x1d282d000 - 0x1d2830fff libcompiler_rt.dylib (102.2) <20CB7797-DBAF-3B55-A8EB-93AF6BD54BD5> /usr/lib/system/libcompiler_rt.dylib
0x1d2831000 - 0x1d2839fff libcopyfile.dylib (173.40.1) <D77FF819-03A8-39BE-98FB-E09F20AABFBD> /usr/lib/system/libcopyfile.dylib
0x1d283a000 - 0x1d28acfff libcorecrypto.dylib (1000.40.5) <3539E572-E946-3BB3-A55F-504369DC82E2> /usr/lib/system/libcorecrypto.dylib
0x1d298f000 - 0x1d29d1fff libdispatch.dylib (1271.40.4) <C2811B43-6189-3E33-A7C2-6F1C40A51A27> /usr/lib/system/libdispatch.dylib
0x1d29d2000 - 0x1d2a0ffff libdyld.dylib (828) <FE9974DD-68A3-3EDF-9C58-0311194B030C> /usr/lib/system/libdyld.dylib
0x1d2a10000 - 0x1d2a10fff libkeymgr.dylib (31) <0222DF46-69AB-3747-9245-F9DF73E46F2C> /usr/lib/system/libkeymgr.dylib
0x1d2a2d000 - 0x1d2a2dfff liblaunch.dylib (2038.40.17.151.1) <04436DC1-7606-3827-A52B-3ACCE5514A48> /usr/lib/system/liblaunch.dylib
0x1d2a2e000 - 0x1d2a33fff libmacho.dylib (973) <7AD9E588-5930-34A4-82AE-A555EECB9020> /usr/lib/system/libmacho.dylib
0x1d2a34000 - 0x1d2a36fff libquarantine.dylib (119.40.1) <98920829-E0B3-3D76-9B90-6339108C7051> /usr/lib/system/libquarantine.dylib
0x1d2a37000 - 0x1d2a39fff libremovefile.dylib (49.40.1) <7DDBDC6C-3681-3105-BD8E-5648515FCAE0> /usr/lib/system/libremovefile.dylib
0x1d2a3a000 - 0x1d2a51fff libsystem_asl.dylib (385) <2F893C4D-2381-3BBF-A698-927DDAC5EEE7> /usr/lib/system/libsystem_asl.dylib
0x1d2a52000 - 0x1d2a53fff libsystem_blocks.dylib (77) <B35D0F10-0B7E-386D-BA5A-C33D3A89D7C3> /usr/lib/system/libsystem_blocks.dylib
0x1d2a54000 - 0x1d2ad4fff libsystem_c.dylib (1439.40.4) <D3E2E584-19BB-383F-9769-3E4E04E26363> /usr/lib/system/libsystem_c.dylib
0x1d2ad5000 - 0x1d2ad7fff libsystem_collections.dylib (1439.40.4) <3B9C25E7-D8FC-326B-A9A6-CF6F606CC789> /usr/lib/system/libsystem_collections.dylib
0x1d2ad8000 - 0x1d2adcfff libsystem_configuration.dylib (1109.40.4) <5C804B73-BB01-3B89-A0E8-6138735E43AA> /usr/lib/system/libsystem_configuration.dylib
0x1d2add000 - 0x1d2aedfff libsystem_containermanager.dylib (318.40.4.151.1) <9F34AF58-B449-3772-81B6-0C30443C7A18> /usr/lib/system/libsystem_containermanager.dylib
0x1d2aee000 - 0x1d2af2fff libsystem_coreservices.dylib (124.9) <163F9770-A933-367C-9EEC-6FF97DB360EB> /usr/lib/system/libsystem_coreservices.dylib
0x1d2af3000 - 0x1d2afcfff libsystem_darwin.dylib (1439.40.4) <852601FF-FD95-39FD-A721-68C494185BC2> /usr/lib/system/libsystem_darwin.dylib
0x1d2afd000 - 0x1d2b05fff libsystem_dnssd.dylib (1310.40.15) <27F3BE29-390C-3EC3-B7AC-AB6A95D4A3F5> /usr/lib/system/libsystem_dnssd.dylib
0x1d2b06000 - 0x1d2b08fff libsystem_featureflags.dylib (28) <D066B904-3319-3215-846D-5BC20D0C8DD9> /usr/lib/system/libsystem_featureflags.dylib
0x1d2b09000 - 0x1d2b4ffff libsystem_info.dylib (542.40.1) <6B41B878-8F15-38DC-BB65-1752EE175028> /usr/lib/system/libsystem_info.dylib
0x1d2b50000 - 0x1d2b82fff libsystem_kernel.dylib (7195.40.44.151.1) <F60F14CF-092D-3467-AB96-FB6A413B8853> /usr/lib/system/libsystem_kernel.dylib
0x1d2b83000 - 0x1d2bb0fff libsystem_m.dylib (3186.40.2) <6D3C545C-98DD-39CF-81D3-24A3E46D45BB> /usr/lib/system/libsystem_m.dylib
0x1d2bb1000 - 0x1d2bdbfff libsystem_malloc.dylib (317) <2013F5FE-8754-3FDA-9CB9-9BDE35DA481A> /usr/lib/system/libsystem_malloc.dylib
0x1d2bdc000 - 0x1d2bebfff libsystem_networkextension.dylib (1295.40.5.151.1) <3628B5FC-3BE4-3CA2-B04D-0A9D7490DB34> /usr/lib/system/libsystem_networkextension.dylib
0x1d2bec000 - 0x1d2bf5fff libsystem_notify.dylib (279.40.2) <4024157B-034A-38B5-A596-F6C1CAE915C0> /usr/lib/system/libsystem_notify.dylib
0x1d2bf6000 - 0x1d2bfcfff libsystem_platform.dylib (254.40.1) <2F210F6C-85C1-3663-93AF-40916F9CA58F> /usr/lib/system/libsystem_platform.dylib
0x1d2bfd000 - 0x1d2bfdfff libsystem_product_info_filter.dylib (8.40.1) <11F07969-F363-338A-8771-E44DADFC625A> /usr/lib/system/libsystem_product_info_filter.dylib
0x1d2bfe000 - 0x1d2c09fff libsystem_pthread.dylib (454) <EFE2DFC7-7856-324C-A207-D3A009635AE5> /usr/lib/system/libsystem_pthread.dylib
0x1d2c0a000 - 0x1d2c0efff libsystem_sandbox.dylib (1441.40.11) <5A9A42BF-3BF1-3936-984E-F0A771404ADF> /usr/lib/system/libsystem_sandbox.dylib
0x1d2c0f000 - 0x1d2c11fff libsystem_secinit.dylib (87) <274689C0-0B49-3278-9E29-4FCA632DB822> /usr/lib/system/libsystem_secinit.dylib
0x1d2c12000 - 0x1d2c19fff libsystem_symptoms.dylib (1431.40.13) <AE867E67-CF44-3CAE-8BA5-5E683FD794AA> /usr/lib/system/libsystem_symptoms.dylib
0x1d2c1a000 - 0x1d2c30fff libsystem_trace.dylib (1277.40.8) <EA8FBD18-D9E5-3B07-AE0A-0540B942EC37> /usr/lib/system/libsystem_trace.dylib
0x1d2c35000 - 0x1d2c3ffff libunwind.dylib (200.10) <E00280C4-8CF2-3D0A-82EE-F57D6BF73662> /usr/lib/system/libunwind.dylib
0x1d2c40000 - 0x1d2c76fff libxpc.dylib (2038.40.17.151.1) <A5C87BA8-222A-3204-A2E5-41F3028A5A2F> /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: 731308
thread_create: 0
thread_set_state: 186
VM Region Summary:
ReadOnly portion of Libraries: Total=450.2M resident=0K(0%) swapped_out_or_unallocated=450.2M(100%)
Writable regions: Total=17.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=17.6M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Kernel Alloc Once 32K 1
MALLOC 9568K 10
MALLOC guard page 64K 4
STACK GUARD 56.0M 1
Stack 8176K 1
VM_ALLOCATE 48K 2
VM_ALLOCATE (reserved) 48K 1 reserved VM address space (unallocated)
__AUTH 47K 15
__AUTH_CONST 74K 39
__DATA 428K 39
__DATA_CONST 205K 39
__LINKEDIT 445.0M 3
__OBJC_CONST 10K 5
__OBJC_RO 63.7M 1
__OBJC_RW 2496K 1
__TEXT 5396K 45
mapped file 16K 1
shared memory 16K 1
=========== ======= =======
TOTAL 590.7M 209
TOTAL, minus reserved VM space 590.6M 209
@FonsRademakers
Copy link

So the pyenv recipe should codesign the pyenv-realpath.dylib plugin? Or is this an issue with /bin/bash being too old and do we need brew's bash?

@claui
Copy link
Author

claui commented Sep 2, 2020

@FonsRademakers The build process of pyenv does sign the plugin but I haven’t found out yet why the signature doesn’t match the code.

@FonsRademakers
Copy link

Yes, the plugin has the default ad-hoc, linker-signed signature which /bin/bash does not seem to like. I've asked a question about this on the Apple Developer forum.

@FonsRademakers
Copy link

@claui got an answer on de developers forum:

/bin/bash is a system binary and, as such, has library validation enabled all the time. Given that, it won’t be able to load code unless it’s signed by Apple.

So to fix this we need to get brew's bash working.

@claui
Copy link
Author

claui commented Sep 3, 2020

@FonsRademakers Then why does it work after I fix the invalid signature?

You can try it out yourself by running brew install -s pyenv and then watching brew test pyenv crash.

Run codesign -s - /usr/local/opt/pyenv/libexec/pyenv-realpath.dylib and watch brew test pyenv pass.

@FonsRademakers
Copy link

@claui Bravo, good you tried the explicit code sign. I’ll let them know on the dev forum that that is good enough for a plug-in to work.
With this you can fix pyenv on brew.

@FonsRademakers
Copy link

@claui Now that pyenv works I try to install python using it but that fails on:

configure: error: Unexpected output of 'arch' on OSX

in the python configure script for 3.80 and 3.8.5. Do you know of a patched python tgz I could use that has this fixed?

Thanks.

@claui
Copy link
Author

claui commented Sep 4, 2020

No idea, sorry. I don’t even use pyenv.

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