-
-
Notifications
You must be signed in to change notification settings - Fork 60
feat: PlayStation native support #2433
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
base: main
Are you sure you want to change the base?
Conversation
|
| [DllImport("__Internal")] | ||
| private static extern int vsnprintf_sentry(IntPtr buffer, UIntPtr bufferSize, IntPtr format, IntPtr args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: [DllImport("__Internal")] in SentryNativeBridge causes EntryPointNotFoundException on Windows/Linux Mono players.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
On Windows and Linux standalone players using the Mono runtime, the SentryNativeBridge.vsnprintf_sentry method will cause a runtime EntryPointNotFoundException. This occurs because [DllImport("__Internal")] is an IL2CPP-specific mechanism, but these platforms use Mono, which cannot resolve __Internal symbols. The crash will happen when nativeLogImpl attempts to format a message using vsnprintf_sentry.
💡 Suggested Fix
Revert [DllImport("__Internal")] for vsnprintf_sentry to platform-specific system libraries (msvcrt for Windows, libc for Linux) or implement platform-specific conditional compilation.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/Sentry.Unity.Native/SentryNativeBridge.cs#L244-L245
Potential issue: On Windows and Linux standalone players using the Mono runtime, the
`SentryNativeBridge.vsnprintf_sentry` method will cause a runtime
`EntryPointNotFoundException`. This occurs because `[DllImport("__Internal")]` is an
IL2CPP-specific mechanism, but these platforms use Mono, which cannot resolve
`__Internal` symbols. The crash will happen when `nativeLogImpl` attempts to format a
message using `vsnprintf_sentry`.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 4258752
Resolves #2050
#skip-changelog