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

ValueError: Unknown Mach-O header: 0x213c6172 #49

Open
HexDecimal opened this issue Sep 7, 2024 · 2 comments
Open

ValueError: Unknown Mach-O header: 0x213c6172 #49

HexDecimal opened this issue Sep 7, 2024 · 2 comments

Comments

@HexDecimal
Copy link

Downstream project Delocate is unable to read this file (libnpymath.a):

...
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/delocate/delocating.py", line 619, in _get_macos_min_version
    for header in MachO(dylib_path).headers:
                  ^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/macholib/MachO.py", line 121, in __init__
    self.load(fp)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/macholib/MachO.py", line 131, in load
    self.load_fat(fh)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/macholib/MachO.py", line 148, in load_fat
    self.load_header(fh, arch.offset, arch.size)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/macholib/MachO.py", line 170, in load_header
    raise ValueError("Unknown Mach-O header: 0x%08x in %r" % (header, fh))
ValueError: Unknown Mach-O header: 0x213c6172 in <_io.BufferedReader name='.../numpy/_core/lib/libnpymath.a'>

Full traceback, relevant files, and more discussion are here: matthew-brett/delocate#227

Apparently this binary is compiled from Fortran code.

@HexDecimal
Copy link
Author

More info: matthew-brett/delocate#229

If it's invalid for macholib to read static libraries then could this give a better error?

@HexDecimal
Copy link
Author

HexDecimal commented Sep 14, 2024

Caused by a static library with multiple architectures.

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

1 participant