Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 "crash-reporter/user_collector.h" | 5 #include "crash-reporter/user_collector.h" |
| 6 | 6 |
| 7 #include <fcntl.h> // For creat. | 7 #include <fcntl.h> // For creat. |
| 8 #include <grp.h> // For struct group. | 8 #include <grp.h> // For struct group. |
| 9 #include <pwd.h> // For struct passwd. | 9 #include <pwd.h> // For struct passwd. |
| 10 #include <sys/types.h> // For getpwuid_r, getgrnam_r, WEXITSTATUS. | 10 #include <sys/types.h> // For getpwuid_r, getgrnam_r, WEXITSTATUS. |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 (FLAGS_filter_in == "none" || | 434 (FLAGS_filter_in == "none" || |
| 435 FLAGS_filter_in != exec)) { | 435 FLAGS_filter_in != exec)) { |
| 436 // We use a different format message to make it more obvious in tests | 436 // We use a different format message to make it more obvious in tests |
| 437 // which crashes are test generated and which are real. | 437 // which crashes are test generated and which are real. |
| 438 logger_->LogWarning("Ignoring crash from %s[%d] while filter_in=%s", | 438 logger_->LogWarning("Ignoring crash from %s[%d] while filter_in=%s", |
| 439 exec.c_str(), pid, FLAGS_filter_in.c_str()); | 439 exec.c_str(), pid, FLAGS_filter_in.c_str()); |
| 440 return true; | 440 return true; |
| 441 } | 441 } |
| 442 | 442 |
| 443 bool feedback = is_feedback_allowed_function_(); | 443 bool feedback = is_feedback_allowed_function_(); |
| 444 const char *handling_string = "handling"; | |
| 445 if (!feedback) { | |
| 446 handling_string = "ignoring - no consent"; | |
| 447 } | |
| 448 | |
| 449 // Treat Chrome crashes as if the user opted-out. We stop counting Chrome | |
| 450 // crashes towards user crashes, so user crashes really mean non-Chrome | |
| 451 // user-space crashes. | |
| 452 if (exec == "chrome") { | |
| 453 feedback = false; | |
|
petkov
2010/11/09 23:30:12
probably doesn't matter but feedback may be false
| |
| 454 handling_string = "ignoring - chrome crash"; | |
| 455 } | |
| 456 | |
| 444 logger_->LogWarning("Received crash notification for %s[%d] sig %d (%s)", | 457 logger_->LogWarning("Received crash notification for %s[%d] sig %d (%s)", |
| 445 exec.c_str(), pid, signal, | 458 exec.c_str(), pid, signal, handling_string); |
| 446 feedback ? "handling" : "ignoring - no consent"); | |
| 447 | 459 |
| 448 if (feedback) { | 460 if (feedback) { |
| 449 count_crash_function_(); | 461 count_crash_function_(); |
| 450 | 462 |
| 451 if (generate_diagnostics_) { | 463 if (generate_diagnostics_) { |
| 452 bool out_of_capacity = false; | 464 bool out_of_capacity = false; |
| 453 if (!ConvertAndEnqueueCrash(pid, exec, &out_of_capacity)) { | 465 if (!ConvertAndEnqueueCrash(pid, exec, &out_of_capacity)) { |
| 454 if (!out_of_capacity) | 466 if (!out_of_capacity) |
| 455 EnqueueCollectionErrorLog(pid, exec); | 467 EnqueueCollectionErrorLog(pid, exec); |
| 456 return false; | 468 return false; |
| 457 } | 469 } |
| 458 } | 470 } |
| 459 } | 471 } |
| 460 | 472 |
| 461 return true; | 473 return true; |
| 462 } | 474 } |
| OLD | NEW |