-
-
Notifications
You must be signed in to change notification settings - Fork 200
fix: support musl on Linux #1233
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a81a138
fix: libunwind as the macOS unwinder
supervacuus 0ae4aef
fix: use libunwind with musl
jpnurmi abb2ffb
ci: experiment with Alpine Linux (musl)
jpnurmi 8740434
chore: comment out debug output
jpnurmi 8f795d4
chore: update external/crashpad
jpnurmi 5a744d3
fixup: don't set SENTRY_WITH_LIBUNWIND on APPLE
jpnurmi 92a38ae
chore: find libunwind.h & libunwind.so
jpnurmi 938167b
ci: libunwind vs. llvm-libunwind
jpnurmi 9a73f9f
chore: update external/crashpad
jpnurmi 81b459f
chore: update external/crashpad
jpnurmi bcf60bf
chore: clean up
jpnurmi c834353
chore: update CHANGELOG.md
jpnurmi ae1b202
ci: gcc+libunwind vs. clang+llvm-libunwind
jpnurmi 32359aa
chore: update external/crashpad
jpnurmi 4a94ea6
chore: clean up extra newlines
jpnurmi 1cc6bcd
build: pick libunwind.a when SENTRY_BUILD_SHARED_LIBS=0
jpnurmi e8a96a4
build: add SENTRY_LIBUNWIND_SHARED option
jpnurmi 2364721
build: no libunwind when SENTRY_BACKEND=none (unit tests)
jpnurmi 010d5a6
Revert "build: no libunwind when SENTRY_BACKEND=none (unit tests)"
jpnurmi 79c9094
build: lzma
jpnurmi dff56c9
drop llvm-libunwind
jpnurmi 60f2ffa
Update src/unwinder/sentry_unwinder_libunwind.c
jpnurmi 8999ba1
chore: fix formatting
jpnurmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Submodule crashpad
updated
4 files
| +19 −2 | .github/workflows/build.yml | |
| +8 −0 | CMakeLists.txt | |
| +2 −0 | compat/linux/sys/ptrace.h | |
| +7 −0 | tools/CMakeLists.txt |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #include "sentry_boot.h" | ||
| #include "sentry_logger.h" | ||
| #define UNW_LOCAL_ONLY | ||
| #include <libunwind.h> | ||
|
|
||
| size_t | ||
| sentry__unwind_stack_libunwind( | ||
| void *addr, const sentry_ucontext_t *uctx, void **ptrs, size_t max_frames) | ||
| { | ||
| if (addr) { | ||
| return 0; | ||
| } | ||
|
|
||
| unw_cursor_t cursor; | ||
| if (uctx) { | ||
| int ret = unw_init_local(&cursor, (unw_context_t *)uctx->user_context); | ||
jpnurmi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (ret != 0) { | ||
| SENTRY_WARN("Failed to initialize libunwind with ucontext"); | ||
| return 0; | ||
| } | ||
| } else { | ||
| unw_context_t uc; | ||
| int ret = unw_getcontext(&uc); | ||
| if (ret != 0) { | ||
| SENTRY_WARN("Failed to retrieve context with libunwind"); | ||
| return 0; | ||
| } | ||
|
|
||
| ret = unw_init_local(&cursor, &uc); | ||
| if (ret != 0) { | ||
| SENTRY_WARN("Failed to initialize libunwind with local context"); | ||
| return 0; | ||
| } | ||
| } | ||
|
|
||
| size_t frame_idx = 0; | ||
| while (unw_step(&cursor) > 0 && frame_idx < max_frames - 1) { | ||
| unw_word_t ip = 0; | ||
| unw_get_reg(&cursor, UNW_REG_IP, &ip); | ||
| ptrs[frame_idx] = (void *)ip; | ||
| unw_word_t sp = 0; | ||
| unw_get_reg(&cursor, UNW_REG_SP, &sp); | ||
| frame_idx++; | ||
| } | ||
| return frame_idx + 1; | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.