title: How can I find out which symbol is causing "dyld: missing symbol called"?
body: <p>On MacOS, I have a set of <code>python</code> binaries I don't control (i.e. I can't build them with <code>LDFLAGS='-undefined error'</code>).</p>
  <p>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 <code>dyld[some_pid]: missing symbol called</code>.</p>
  <p>How can I find out which library file is causing the issue, and which symbol, by name, is missing?</p>
  <h1>What I have tried</h1>
  <p>Using the below environment displays <code>dyld</code>'s diagnostic output:</p>
  <pre><code>DYLD_PRINT_LIBRARIES=1
  DYLD_PRINT_APIS=1
  DYLD_PRINT_WARNINGS=1
  </code></pre>
  <p>That causes the failed operations to emit what sees to be <em>successful</em> <code>dyld</code> operations before the crash. But the diagnostic output isn't sufficient; for example, it often looks like this:</p>
  <pre><code>dyld[91757]: dyld_image_path_containing_address(0x10a7ab000) =&gt; '/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) =&gt; 0
  dyld[91757]:       dlopen(_csv.cpython-37m-darwin.so) =&gt; 0x210fbb0c0
  dyld[91757]: dlsym(0x210fbb0c0, &quot;PyInit__csv&quot;)
  dyld[91757]:      dlsym(&quot;PyInit__csv&quot;) =&gt; 0x10a7abbc0
  dyld[91757]: missing symbol called
  </code></pre>
  <p>In that example, <code>nm</code> reports that <code>_csv.cpython-37m-darwin.so</code> can resolve a symbol called <code>PyInit__csv</code>. So it seems (I think) like the <code>missing symbol called</code> error is failing on a different symbol, but I don't know how to determine which one that is.</p>