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
Compilation fails when Address Sanitizer enabled #1990
Comments
Confirmed that rolling back to 7.2.0 fixes the issue. |
Does it work on the latest? 7.21.0? |
Sorry I got the versions wrong:
|
Thanks for reporting this, @davidrothera. I can reproduce this with your sample project and have to look into what's causing this. I'm surprised that our CI didn't catch this. |
It took me a while to catch it myself as it's not super clear what causes it and I wasn't seeing it in all projects or in all build modes and it wasn't until I went over them with a magnifying glass that I remembered I had ASAN enabled the one which was failing. I'm guessing most of your CI projects don't have ASAN enabled. |
If we enable it in one of our samples, would that do the job @philipphofmann @brustolin ? |
It should do, enabling ASAN usually should have no impact other than to surface issues and then even this is abnormal for ASAN but I'm guessing it could be related to the C++ module init functions which were added? |
Yep, it's related to sentry-cocoa/Sources/Sentry/SentrySysctl.m Lines 14 to 20 in 6781721
I just removed this code, and it compiles again. I wonder why that is. We have ASAN enabled in CI for the Sentry project, but not for the samples. Enabling it for our sample projects doesn't fail the build. Maybe we can use
Instead of the |
The detailed error is
The assertion error is coming from here Here is the linker snapshot. It's bigger than 25MB, so I couldn't upload it here. |
Fix address sanitizer compilation error by using the constructor attribute instead of __DATA,__mod_init_func. Fixes GH-1990
Platform
iOS
Installed
Swift Package Manager
Version
7.21.0
Steps to Reproduce
Simple repro at https://github.com/davidrothera/CrashTest with ASAN enabled
Expected Result
Compilation works
Actual Result
Compilation fails
The text was updated successfully, but these errors were encountered: