qychen1982 / crashpad

Automatically exported from code.google.com/p/crashpad
0 stars 0 forks source link

Not all EXC_RESOURCE exceptions are fatal #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For nonfatal EXC_RESOURCE exceptions, we probably shouldn’t generate a crash 
report.

Original issue reported on code.google.com by mark@chromium.org on 7 Apr 2015 at 4:30

GoogleCodeExporter commented 9 years ago

Original comment by mark@chromium.org on 7 Apr 2015 at 4:31

GoogleCodeExporter commented 9 years ago

Original comment by mark@chromium.org on 7 Apr 2015 at 4:31

GoogleCodeExporter commented 9 years ago
Bug chromium:474163 and chromium:474326 are EXC_RESOURCE (0xb = 11) with 
RESOURCE_TYPE_WAKEUPS/FLAVOR_WAKEUPS_MONITOR. These are only fatal if 
TASK_RUSECPU_FLAGS_FATAL_WAKEUPSMON is set in task->rusage_cpu_flags. See 10.10 
xnu-2782.1.97/osfmk/kern/task.c 
THIS_PROCESS_IS_CAUSING_TOO_MANY_WAKEUPS__SENDING_EXC_RESOURCE().

I haven’t yet found a way to determine if this particular exception is fatal 
when it’s caught.

Original comment by mark@chromium.org on 7 Apr 2015 at 4:41

GoogleCodeExporter commented 9 years ago
I haven’t tested this yet, but:

  proc_rlimit_control_wakeupmon wakeups_monitor = {};
  wakeups_monitor.wm_flags = WAKEMON_GET_PARAMS;
  proc_rlimit_control(pid, RLIMIT_WAKEUPS_MONITOR, &wakeups_monitor);
  if (wakeups_monitor.wm_flags & WAKEMON_MAKE_FATAL) {
    // it’s fatal
  }

proc_rlimit_control() doesn’t have a declaration in the SDK but does have a 
syscall wrapper in libsystem_kernel in 10.9 and 10.10. There is no EXC_RESOURCE 
prior to 10.8.

Original comment by mark@chromium.org on 7 Apr 2015 at 4:54

GoogleCodeExporter commented 9 years ago
Prior to 10.9, I mean.

Original comment by mark@chromium.org on 7 Apr 2015 at 4:55

GoogleCodeExporter commented 9 years ago
https://codereview.chromium.org/1066243002/

Original comment by mark@chromium.org on 7 Apr 2015 at 10:39

GoogleCodeExporter commented 9 years ago

Original comment by mark@chromium.org on 8 Apr 2015 at 7:13

GoogleCodeExporter commented 9 years ago

Original comment by mark@chromium.org on 8 Apr 2015 at 9:16

GoogleCodeExporter commented 9 years ago

Original comment by dalecurtis@chromium.org on 8 Apr 2015 at 9:21

GoogleCodeExporter commented 9 years ago

Original comment by andresan...@chromium.org on 8 Apr 2015 at 9:46

GoogleCodeExporter commented 9 years ago
https://chromium.googlesource.com/crashpad/crashpad/+/1baff4ff92fe1a1ead6b88b5f0
1633a4f0b6b51c

Original comment by mark@chromium.org on 8 Apr 2015 at 9:48

GoogleCodeExporter commented 9 years ago

Original comment by dalecurtis@chromium.org on 9 Apr 2015 at 6:07