1

I implemented XPC as Apple reccomends it for high risk operations. The problem is that when XPC crashes it displays crash dialog to the user. I know that this code can sometimes crach, that is why I mplemented XPC in the first place. So is there any way I can suppress the crash report?

If you need any details please add comment, I will update the thread ASAP.

Michał Kreft
  • 548
  • 3
  • 16
  • What is causing the crash? Is it an `NSException` or a signal? – trojanfoe May 15 '12 at 11:21
  • Exception can be caught so that is not a problem, it is caused by signal. We also tried to capture the signals but well, it simply doesn't work for our XPC. – Michał Kreft May 15 '12 at 11:59
  • So you have code that you know can _crash_ sometimes? Is the crash your fault or the fault of a buggy Cocoa class/framework? – Johannes Fahrenkrug May 15 '12 at 12:32
  • Unfortunatelly it uses dynamic libs that we are not the athours of. Also it is dealing with file content reading from users and there can be literally anything there. – Michał Kreft May 15 '12 at 12:34
  • I see, but crashing is still a Very Bad Thing (tm). What exactly causes the crash? XPC was - to my knowledge - created to separate different permissions/entitlements but not so that we don't have to care about code crashing. I'd strongly suggest trying to prevent the code from crashing at all costs. – Johannes Fahrenkrug May 15 '12 at 12:38
  • Yes I totally agree. I am pretty sure in most cases it is bad memory access, like freeing memory and then trying to access it or other things of that kind. I know it sounds really bad. – Michał Kreft May 15 '12 at 12:40
  • I am also aware there might be no answer to this. Just posted a question because maybe somebody got this figured out. – Michał Kreft May 15 '12 at 12:43
  • When the crash happens, XPC client i.e. the main app should be notified of the problem and provide a better report or even a fix. Sure thing, we should avoid crashes, but XPC services are designed perfectly to move all crashes into helper processes. So I agree with a topic starter: crash dialog should not appear, especially because the main app is still running. – Vadim Oct 14 '12 at 21:36

1 Answers1

2

I've found an answer here: http://lists.apple.com/archives/cocoa-dev/2009/Sep/msg01658.html

That might solve your problem, but it might cause other problems: I'm not sure if this is still permitted in sandboxed apps...

Still, the Right Thing to do is to fix the crashes :)

Johannes Fahrenkrug
  • 42,912
  • 19
  • 126
  • 165