9

On MacOS, I have a set of python binaries I don't control (i.e. I can't build them with LDFLAGS='-undefined error').

On certain MacOS hosts/architectures (that is, some ARM Macs, but not all of them; some x86 Macs, but not all of them), doing certain things in Python fails with dyld[some_pid]: missing symbol called.

How can I find out which library file is causing the issue, and which symbol, by name, is missing?

What I have tried

Using the below environment displays dyld's diagnostic output:

DYLD_PRINT_LIBRARIES=1
DYLD_PRINT_APIS=1
DYLD_PRINT_WARNINGS=1

That causes the failed operations to emit what seem to be successful dyld operations before the crash. But the diagnostic output isn't sufficient; for example, it often looks like this:

dyld[91757]: dyld_image_path_containing_address(0x10a7ab000) => '/path/to/python/lib/lib.macosx-10.15-x86_64-3.7/_csv.cpython-37m-darwin.so'
dyld[91757]: _dyld_is_memory_immutable(0x10a7ab000, 28) => 0
dyld[91757]:       dlopen(_csv.cpython-37m-darwin.so) => 0x210fbb0c0
dyld[91757]: dlsym(0x210fbb0c0, "PyInit__csv")
dyld[91757]:      dlsym("PyInit__csv") => 0x10a7abbc0
dyld[91757]: missing symbol called

In that example, nm reports that _csv.cpython-37m-darwin.so can resolve a symbol called PyInit__csv. So it seems (I think) like the missing symbol called error is failing on a different symbol, but I don't know how to determine which one that is.

Zac B
  • 3,796
  • 3
  • 35
  • 52
  • Checked the version-differences (OS, Python) between working and not-working computers? – Lorinczy Zsigmond Sep 03 '22 at 06:11
  • 1
    Yes, I have. In most cases, I can dig up a difference that resolves the issue. But that "diff two systems" route is slow and error-prone. I'd much rather get `dyld` to tell me what symbol it couldn't find, as that would save much of the debugging/diffing process, hence my question. – Zac B Sep 12 '22 at 18:17

0 Answers0