sentry-native icon indicating copy to clipboard operation
sentry-native copied to clipboard

Can't get sentry-native to upload crash dumps on macOS (using Rosetta translation)

Open christofmuc opened this issue 3 years ago • 8 comments

Hello friends,

I am about to give up, but before I do, let me ask my question here - I cannot get the sentry-native (0.4.12) with a native C++ macOS app upload (or even create one on disk) a crashdump. Sending events works, and the code I have works with crashpad on Windows and with breakpad on Linux, but on the mac, on crash I always get the Apple ProblemReport dialog and not the sentry crash dump. I am not event sure if the Apple reporter is expected on a Sentry-enabled build or not.

I guess my expectations must be wrong somehow on how macOS handles crashes - our app is sandboxed and signed with Developer ID for distribution on DMG, but no matter if I use crashpad or breakpad, or if I even try locally before signing/packaging, I cannot get a single crashdump to be created by the Mac.

Is Apple's OS interfering here? My developer machine is M1/12.0.1, but also other machines downloading our built and signed version don't produce crashdumps. Some are able to send an event. BTW does it matter if it is a native M1 compile or being executed via Rosetta?

Thanks for your help!

christofmuc avatar Feb 13 '22 18:02 christofmuc

similar issues here. The only combination I have gotten to work is when both the application and the crashpad_handler are running m1 native (not in Rosetta)

If the application is running in rosetta, the crashpad_handler does not get notified correctly when there is a crash (regardless of whether the handler is running native or in rosetta). I've traced it down to here in crashpad_util/Source Files/mach_message.cc:

Screen Shot 2022-02-24 at 3 42 02 PM

message->msh_id is 70 and should be 2407

Same code works as expected on intel and as I stated earlier, on M1, works as expected if both the application and the crashpad_handler are not running in rosetta.

shanekoss-output avatar Feb 24 '22 23:02 shanekoss-output

Capturing crashes currently only works when the executable (and crash handler) are running natively, and not when run through rosetta.

Swatinem avatar Feb 25 '22 09:02 Swatinem

Capturing crashes currently only works when the executable (and crash handler) are running natively, and not when run through rosetta.

that would explain it! Any plans for Rosetta support? Thanks for chiming in.

shanekoss-output avatar Feb 25 '22 18:02 shanekoss-output

Capturing crashes currently only works when the executable (and crash handler) are running natively, and not when run through rosetta.

Thank you! I suspected that much. Would a universal binary work?

christofmuc avatar Feb 27 '22 14:02 christofmuc

Yes universal binaries should work well.

We don’t have plans to support Rosetta. As times moves on, demand will be lower and lower considering that people move to universal/native binaries instead. Also, although we maintain a couple of patches on top of crashpad, we are not the original authors of it, and maintaining support for Rosetta seems like an unreasonably huge effort for diminishing usefulness.

Swatinem avatar Feb 28 '22 09:02 Swatinem

Hi ,I meet the same issue local crash dump file not upload to sentry? But Sending events works How do i do?

toby20130333 avatar Jul 20 '22 11:07 toby20130333

As mentioned before, we currently have no plans to make crash reporting on Rosetta emulation work.

Swatinem avatar Jul 21 '22 06:07 Swatinem

My X86 or arm64 both has this issue,on macos ,which path the crash_handler location? app/Cotents/MacOS/?

toby20130333 avatar Jul 21 '22 11:07 toby20130333