Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Xamarin.Mac signal handling

$
0
0

Hi,

I'd like to manage Signals, so the application does not just crash and leave users in the dark. I've been looking at PLCrashReporter which seems to do what I'd want, with one issue. As pointed here, that prevents NullReferenceExceptions from being correctly handled (and other for what I've tested).

So I've followed the instruction and wrapped my EnableCrashReporter with Mono.Runtime.RemoveSignalHandlers and Mono.Runtime.InstallSignalHandlers. Which restore the wanted behavior (NullReferenceException now being handled). But PLCrashReporter does not appear to catch anything, at all. It's not just the signal that mono handles, it's even those that do end in a crash regardless, even if I raise a SIGSEGV in manage code myself or trigger a SIGFPE in native code.

I have to be frank and admit that I'm far from experience when it come to signal handling, so I might be missing something. But looking at this quote:

Since Mono’s signal handlers are reinstalled and not restored, Mono will now chain to the signal handlers installed by EnableCrashReporting.

I'd have though that when registering it's own signal handler, Mono would keep the previously installed one (in this case PLCrashReporter one) and call it when it sees nothing to do with the signal. Which is also what this line seems to suggest:

[...], because Mono will chain to the previous handler if it detects that a SIGSEGV occurred in native code, and the existing signal handlers when Mono installed its signal handlers would be the default signal handlers for the platform.

Any idea?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>