Capture sandbox::logging::Fatal and PFatal error messages as crash annotations |
|||||||
Issue descriptionThe low-level Mac sandbox primitives do not depend on //base, to avoid transitively linking to system frameworks that may perform sandbox-sensitive work in static initializers. For logging, a small set of utilities exist here for the sandbox to use: https://cs.chromium.org/chromium/src/sandbox/mac/sandbox_logging.cc For sandbox::logging::Fatal and PFatal messages, we should record the fatal message into a crash annotation. That way we can easily see in crash reports why the process crashed. We could either use function likes __assert_rtn, abort_with_payload, abort_with_reason, or os_crash to store it in the macOS crash annotations (that Crashpad collects), or we could use a Chromium-style crash key.
,
Oct 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5f4d1e33f0f855d5a78e71722aedbf7ff4ce4a06 commit 5f4d1e33f0f855d5a78e71722aedbf7ff4ce4a06 Author: Greg Kerr <kerrnel@chromium.org> Date: Tue Oct 09 20:25:53 2018 macOS sandbox: Capture sandbox::logging aborts as crash annotations. This records the fatal message into crash annotations so that crash reports will easily show why a process crashed. Bug: 878856 Change-Id: Icde9198b24e8a78952e168656e47abccb6b45690 Reviewed-on: https://chromium-review.googlesource.com/c/1270175 Reviewed-by: Robert Sesek <rsesek@chromium.org> Commit-Queue: Greg Kerr <kerrnel@chromium.org> Cr-Commit-Position: refs/heads/master@{#598063} [modify] https://crrev.com/5f4d1e33f0f855d5a78e71722aedbf7ff4ce4a06/sandbox/mac/sandbox_logging.cc
,
Oct 9
,
Oct 22
Please find the crash stack that we were expecting to collect after above CL below and here is the crash impact on Chrome versions here :https://goto.google.com/ksdyu Thread 13 (id: 0x1abc) CRASHED [0x00000000 / 0x00000000 @ 0x00007fff5cfe4b86 ] MAGIC SIGNATURE THREAD Stack Quality84%Show frame trust levels 0x00007fff5cfe4b86 (libsystem_kernel.dylib + 0x00006b86 ) __pthread_kill 0x00007fff5cf4e1c8 (libsystem_c.dylib + 0x0005c1c8 ) abort 0x00007fff5cf4e33b (libsystem_c.dylib + 0x0005c33b ) abort_report_np 0x000000010db83ddf (Google Chrome Framework -sandbox_logging.cc:131 ) sandbox::logging::(anonymous namespace)::AnnotateCrash(char const*, __va_list_tag*) 0x000000010db840d7 (Google Chrome Framework -sandbox_logging.cc:188 ) sandbox::logging::PFatal(char const*, ...) 0x000000010a9b0731 (Google Chrome Framework -memory:3118 ) content::internal::ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(content::PosixFileDescriptorInfo const&, base::LaunchOptions*) 0x000000010a9afca9 (Google Chrome Framework -child_process_launcher_helper.cc:113 ) content::internal::ChildProcessLauncherHelper::LaunchOnLauncherThread() 0x000000010c3cd689 (Google Chrome Framework -callback.h:99 ) base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) 0x000000010c4429c8 (Google Chrome Framework -task_tracker.cc:653 ) base::internal::TaskTracker::RunOrSkipTask(base::internal::Task, base::internal::Sequence*, bool) 0x000000010c482bd2 (Google Chrome Framework -task_tracker_posix.cc:23 ) base::internal::TaskTrackerPosix::RunOrSkipTask(base::internal::Task, base::internal::Sequence*, bool) 0x000000010c442318 (Google Chrome Framework -task_tracker.cc:508 ) base::internal::TaskTracker::RunAndPopNextTask(scoped_refptr<base::internal::Sequence>, base::internal::CanScheduleSequenceObserver*) 0x000000010c43ac56 (Google Chrome Framework -scheduler_worker.cc:332 ) base::internal::SchedulerWorker::RunWorker() 0x000000010c43aab3 (Google Chrome Framework -scheduler_worker.cc:248 ) base::internal::SchedulerWorker::RunDedicatedWorker() 0x000000010c482ff6 (Google Chrome Framework -platform_thread_posix.cc:80 ) base::(anonymous namespace)::ThreadFunc(void*) 0x00007fff5d09833c (libsystem_pthread.dylib + 0x0000333c ) _pthread_body 0x00007fff5d09b2a6 (libsystem_pthread.dylib + 0x000062a6 ) _pthread_start 0x00007fff5d097424 (libsystem_pthread.dylib + 0x00002424 ) thread_start 0x000000010c482f9f (Google Chrome Framework + 0x027e2f9f )
,
Oct 22
,
Oct 23
I need to plumb the errno string through as well.
,
Oct 24
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2995d5e371074a1763507b4f41a9d4636d372e87 commit 2995d5e371074a1763507b4f41a9d4636d372e87 Author: Greg Kerr <kerrnel@chromium.org> Date: Wed Oct 24 15:29:27 2018 macOS V2 Sandbox: Plumb errno string through logging. Bug: 878856 Change-Id: Id6f84e3f58557ddd91850b52729f5d0eeea8eff3 Reviewed-on: https://chromium-review.googlesource.com/c/1297073 Reviewed-by: Robert Sesek <rsesek@chromium.org> Commit-Queue: Greg Kerr <kerrnel@chromium.org> Cr-Commit-Position: refs/heads/master@{#602345} [modify] https://crrev.com/2995d5e371074a1763507b4f41a9d4636d372e87/sandbox/mac/sandbox_logging.cc
,
Oct 25
,
Oct 26
crash/b4609b92f3e55f65: Magic Signature: sandbox::logging::`anonymous namespace'::SendAslLog List Annotations: SeatbeltExecClient: pipe failed: Too many open files in system Thread 24 (id: 0x14368da) CRASHED [0x00000000 / 0x00000000 @ 0x00007fffcfa61d42 ] 0x00007fffcfa61d42 (libsystem_kernel.dylib + 0x00019d42 ) 0x00007fffcf9c741f (libsystem_c.dylib + 0x0005f41f ) abort 0x00007fffcf9c7591 (libsystem_c.dylib + 0x0005f591 ) abort_report_np 0x000000010d914ca2 (Google Chrome Framework -sandbox_logging.cc:99 ) sandbox::logging::(anonymous namespace)::SendAslLog(sandbox::logging::(anonymous namespace)::Level, char const*) 0x000000010d91479a (Google Chrome Framework -sandbox_logging.cc:125 ) sandbox::logging::(anonymous namespace)::DoLogging(sandbox::logging::(anonymous namespace)::Level, char const*, __va_list_tag*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*) 0x000000010d914b6d (Google Chrome Framework -sandbox_logging.cc:175 ) sandbox::logging::PFatal(char const*, ...) 0x000000010a70e942 (Google Chrome Framework -memory:3118 ) content::internal::ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(content::PosixFileDescriptorInfo const&, base::LaunchOptions*) 0x000000010a70dea9 (Google Chrome Framework -child_process_launcher_helper.cc:117 ) content::internal::ChildProcessLauncherHelper::LaunchOnLauncherThread() 0x000000010c1747c9 (Google Chrome Framework -callback.h:99 ) base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) 0x000000010c1e8d08 (Google Chrome Framework -task_tracker.cc:647 ) base::internal::TaskTracker::RunOrSkipTask(base::internal::Task, base::internal::Sequence*, bool) 0x000000010c2292b2 (Google Chrome Framework -task_tracker_posix.cc:23 ) base::internal::TaskTrackerPosix::RunOrSkipTask(base::internal::Task, base::internal::Sequence*, bool) 0x000000010c1e8658 (Google Chrome Framework -task_tracker.cc:502 ) base::internal::TaskTracker::RunAndPopNextTask(scoped_refptr<base::internal::Sequence>, base::internal::CanScheduleSequenceObserver*) 0x000000010c1e0b4d (Google Chrome Framework -scheduler_worker.cc:332 ) base::internal::SchedulerWorker::RunWorker() 0x000000010c1e0923 (Google Chrome Framework -scheduler_worker.cc:248 ) base::internal::SchedulerWorker::RunDedicatedWorker() 0x000000010c2296d6 (Google Chrome Framework -platform_thread_posix.cc:81 ) base::(anonymous namespace)::ThreadFunc(void*) 0x00007fffcfb4c93a (libsystem_pthread.dylib + 0x0000393a ) _pthread_body 0x00007fffcfb4c886 (libsystem_pthread.dylib + 0x00003886 ) _pthread_start 0x00007fffcfb4c08c (libsystem_pthread.dylib + 0x0000308c ) thread_start 0x000000010c22967f (Google Chrome Framework + 0x027cf67f ) |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by kerrnel@chromium.org
, Aug 29Status: Assigned (was: Available)