Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: base/debug/stack_trace_posix.cc

Issue 2694023002: linux/cros: Print a warning when StackDumpSignalHandler calls _exit(1) (Closed)
Patch Set: just warn Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/debug/stack_trace.h" 5 #include "base/debug/stack_trace.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 376
377 PrintToStderr("[end of stack trace]\n"); 377 PrintToStderr("[end of stack trace]\n");
378 378
379 #if defined(OS_MACOSX) && !defined(OS_IOS) 379 #if defined(OS_MACOSX) && !defined(OS_IOS)
380 if (::signal(signal, SIG_DFL) == SIG_ERR) 380 if (::signal(signal, SIG_DFL) == SIG_ERR)
381 _exit(1); 381 _exit(1);
382 #else 382 #else
383 // Non-Mac OSes should probably reraise the signal as well, but the Linux 383 // Non-Mac OSes should probably reraise the signal as well, but the Linux
384 // sandbox tests break on CrOS devices. 384 // sandbox tests break on CrOS devices.
385 // https://code.google.com/p/chromium/issues/detail?id=551681 385 // https://code.google.com/p/chromium/issues/detail?id=551681
386 PrintToStderr("Calling _exit(1). Core file will not be generated.\n");
386 _exit(1); 387 _exit(1);
387 #endif // defined(OS_MACOSX) && !defined(OS_IOS) 388 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
388 } 389 }
389 390
390 class PrintBacktraceOutputHandler : public BacktraceOutputHandler { 391 class PrintBacktraceOutputHandler : public BacktraceOutputHandler {
391 public: 392 public:
392 PrintBacktraceOutputHandler() {} 393 PrintBacktraceOutputHandler() {}
393 394
394 void HandleOutput(const char* output) override { 395 void HandleOutput(const char* output) override {
395 // NOTE: This code MUST be async-signal safe (it's used by in-process 396 // NOTE: This code MUST be async-signal safe (it's used by in-process
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 *ptr = *start; 811 *ptr = *start;
811 *start++ = ch; 812 *start++ = ch;
812 } 813 }
813 return buf; 814 return buf;
814 } 815 }
815 816
816 } // namespace internal 817 } // namespace internal
817 818
818 } // namespace debug 819 } // namespace debug
819 } // namespace base 820 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698