-
Notifications
You must be signed in to change notification settings - Fork 4
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
[bug] 'compiled-objects-have-debug-symbols' false positive on mach-o files that have been passed through 'strip' #235
Comments
Looks like this is a special, corner case that might be possible to ignore safely, because Xcode's Unfortunately, the corresponding Apple Open Source pages have been wiped into oblivion. I tried
and I naïvely thought I could look them up on archival services such as https://archive.is/opensource.apple.com or on the Internet Archive's Wayback Machine, but to no avail – it is apparent that Apple has probably worked aggressively to stop the spread of this knowledge. It is a remnant of the linker, though, so maybe using alternative linkers such as Zld will avoid this problem. Even on this page: https://docs.angr.io/projects/cle/en/v9.2.70/_modules/cle/backends/macho/symbol.html, the sentence seems incomplete:
I don't claim any conspiracies here, though. 😃 IDA 7.6 seems to ignore it as well: https://docs.hex-rays.com/release-notes/7_6#file-formats |
I managed to find a link that still works: https://archive.is/7voAu |
Wow AMAZING investigation!!! Thank you so much for looking into that. Are you interested in submitting a PR that ignores this specific symbol when I think it'd involve filtering that out around here: pydistcheck/src/pydistcheck/shared_lib_utils.py Lines 65 to 68 in 85b8af3
with a code comment pointing back to this issue to explain why |
Thank you for the pointer! Yes, I'm interested in contributing and will put together a PR this week :D |
What did you expect to happen?
Expected
compiled-objects-have-debug-symbols
check to only find debug symbols if a mach-o binary contains them.What actually happened?
Over in LightGBM, observed that when upgrading
scikit-build-core
for a shared library from v0.4.4 to 0.9.3,pydistcheck
started raising this on the resulting librarylib_lightgbm.dylib
.But ONLY that macOS library... not the equivalent files on linux (
lib_lightgbm.so
) or windows (lib_lightgbm.dll
).How can someone else reproduce this problem?
I mention that
scikit-build-core
version because in that range,scikit-build-core
added the ability to strip the binaries it produced.https://github.com/scikit-build/scikit-build-core/blob/2994db5d993f0cb252dbeebfac7d66677b670ed8/README.md#L278-279
I built that library (
lib_lightgbm.dylib
) on an M2 mac, in a build driven byscikit-build-core
, like this:Then diffed those files. Only saw 1 difference.
The results of
nm -a
includes this:It seems that maybe this is added by
strip
?I found this repo, https://github.com/nico/lssym, which says
I strongly suspect that's what's happening here! Not sure what the best fix is though for
pydistcheck
, will need to think through that.What version of
pydistcheck
are you using?0.6.0
Notes
Thanks @nico for putting up https://github.com/nico/lssym! It was a great clue to help me investigate this!!
The text was updated successfully, but these errors were encountered: