Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Have you considered making a dispatch_source_t

I think that would have been considerably more work than finding the SO answer that says you need to use sigsetjmp, and would probably still conflict with Breakpad ;)

> Would it be possible to install your own handler before Breakpad does?

I may be wrong, but I think you can only register one exception handler per "task" (process), so Breakpad would override ours.



When you install a mach exception handler you can get the port of the previous exception handler, which you can use to forward the messages your newly installed exception handler receives. Of course (as with all raw mach APIs) it is poorly documented and error prone.


Interestingly, it seems like Breakpad does a task_get/set_exception_ports dance instead of using task_swap_exception_ports: https://chromium.googlesource.com/breakpad/breakpad/+/refs/h.... Doesn't this break if someone registers a handler between the two lines?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: