Repository navigation
Include <execinfo.h> only where backtrace() is used - #1554
Open
Evstifeev Mikhail (mievst) wants to merge 1 commit into
Open
Evstifeev Mikhail (mievst) wants to merge 1 commit into
Evstifeev Mikhail (mievst) wants to merge 1 commit into
Conversation
Utils.hpp included <execinfo.h> on every non-Android __unix__ target, but only print_backtrace() in Utils.cpp needs it, and only under USE_BACKTRACE. musl (Alpine Linux) does not provide the header, so the SDK failed to compile there. This also breaks ONNX Runtime builds on Alpine, which build the SDK by default since 1DS became their telemetry backend (microsoft/onnxruntime#33827).
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib/utils/Utils.hppincludes<execinfo.h>on every non-Android__unix__target. The header is glibc-specific and musl (Alpine Linux) does not provide it, so the SDK fails to compile there:The only user of the header is
print_backtrace()inlib/utils/Utils.cpp, and only underUSE_BACKTRACE. This change moves the include there, under the same condition. Builds withoutUSE_BACKTRACE(all regular builds) no longer depend on the header.This breaks ONNX Runtime builds on Alpine, which build the SDK by default since 1DS became their telemetry backend: microsoft/onnxruntime#33827.
Tested:
libmat.alinks, the Python wheel runs a model. Without the change it fails with the error above.mainwith this change on Debian 13 (gcc 14.2.0, glibc 2.41):matbuilds.Note, not changed here: with
-DUSE_BACKTRACEon GCCprint_backtrace()does not compile, with or without this change.mat_demangleis the identity macro there (_CPPRTTIis MSVC-only), somat_demangle(strings[i]).c_str()is called on achar*.