Commit edec6207 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[logging] Reduce FailureMessage buffer size

This should reduce the probability of running out of stack space while logging
a fatal error message.
Additionally this CL distinguishes the error OOM error message when there is no
isolate available on the background thread.

Bug: chromium:839166
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I17e929f322dda20127fbf86a6154af5460e53490
Reviewed-on: https://chromium-review.googlesource.com/1041964Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52958}
parent 494068c1
......@@ -350,7 +350,9 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location,
memset(&heap_stats, 0xBADC0DE, sizeof(heap_stats));
// Note that the embedder's oom handler won't be called in this case. We
// just crash.
FATAL("API fatal error handler returned after process out of memory");
FATAL(
"API fatal error handler returned after process out of memory on the "
"background thread");
UNREACHABLE();
}
......
......@@ -135,7 +135,7 @@ class FailureMessage {
static const uintptr_t kStartMarker = 0xdecade10;
static const uintptr_t kEndMarker = 0xdecade11;
static const int kMessageBufferSize = 1024;
static const int kMessageBufferSize = 512;
uintptr_t start_marker_ = kStartMarker;
char message_[kMessageBufferSize];
......@@ -154,6 +154,7 @@ void V8_Fatal(const char* file, int line, const char* format, ...) {
fflush(stdout);
fflush(stderr);
// Print the formatted message to stdout without cropping the output.
v8::base::OS::PrintError("\n\n#\n# Fatal error in %s, line %d\n# ", file,
line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment