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

[crashpad] Add compilation condition restrictions to fix sentry-native linux runtime error #103

Open
wants to merge 1 commit into
base: getsentry
Choose a base branch
from

Conversation

JonLiu1993
Copy link

@JonLiu1993 JonLiu1993 commented Jun 7, 2024

When install sentry-native:x64-linux in vcpkg, the cmake project generation & building it works fine, however while trying to run the app with dummy crash (assigning a nullptr after initialization of sentry) the crash raport doesn't gets send to the sentry backend.

[1717:1717:20240604,064748.491454:FATAL pthread_create_linux.cc:54] Check failed: next_pthread_create. dlsym: RTLD_NEXT used in code not dynamically loaded

Add constraint to compile pthread_create_linux.cc only when BUILD_SHARED_LIBS to fix error。
Related issue:getsentry/sentry-native#596
microsoft/vcpkg#39114

@supervacuus
Copy link
Collaborator

Hi @JonLiu1993, I'm sorry, but I cannot reproduce this. Would you happen to have a non-vcpkg-based CMake configuration to repro this so I can test it? I don't see the described issue when running static builds on Linux.

Also, from the linked issues, I cannot understand why BUILD_SHARED_LIBS should be the discriminator since it affects add_library() only, but this involves an executable (the crashpad_handler).

The Native SDK issue getsentry/sentry-native#596 highlights the offending source but does not mention how that could relate to building sentry as a static artifact.

Could the issue be related to using static standard libraries rather than static sentry builds? If so, I would prefer to find a better condition for that scenario because the pthread_create-wrapper could still make sense in the crashpad_handler if sentry is built as a static library on Linux.

@JonLiu1993
Copy link
Author

@supervacuus, Thank you for your reply. Actually, this problem is encountered by vcpkg users. Since I don't have the conditions to reproduce it, I followed the upstream related issue getsentry/sentry-native#596 to fix it and it can be used by user testing. So I submitted or issue. You can ask @Patrix9999 for the specific steps to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Investigation
Development

Successfully merging this pull request may close these issues.

3 participants