Commit f32b18bc authored by Shu-yu Guo's avatar Shu-yu Guo Committed by Commit Bot

[logging] Fix deadlock with ICEvent

Bug: chromium:1188868
Change-Id: If3916891806b7db7c4556f0dc50ae73afa06036c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2766223
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73491}
parent 17af2b71
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "src/base/compiler-specific.h" #include "src/base/compiler-specific.h"
#include "src/base/optional.h" #include "src/base/optional.h"
#include "src/base/platform/mutex.h" #include "src/base/platform/mutex.h"
#include "src/common/assert-scope.h"
#include "src/flags/flags.h" #include "src/flags/flags.h"
#include "src/utils/allocation.h" #include "src/utils/allocation.h"
#include "src/utils/ostreams.h" #include "src/utils/ostreams.h"
...@@ -93,7 +94,7 @@ class Log { ...@@ -93,7 +94,7 @@ class Log {
void AppendRawCharacter(const char character); void AppendRawCharacter(const char character);
Log* log_; Log* log_;
base::MutexGuard lock_guard_; NoGarbageCollectionMutexGuard lock_guard_;
friend class Log; friend class Log;
}; };
......
...@@ -1763,11 +1763,13 @@ void Logger::ICEvent(const char* type, bool keyed, Handle<Map> map, ...@@ -1763,11 +1763,13 @@ void Logger::ICEvent(const char* type, bool keyed, Handle<Map> map,
Handle<Object> key, char old_state, char new_state, Handle<Object> key, char old_state, char new_state,
const char* modifier, const char* slow_stub_reason) { const char* modifier, const char* slow_stub_reason) {
if (!FLAG_log_ic) return; if (!FLAG_log_ic) return;
MSG_BUILDER();
if (keyed) msg << "Keyed";
int line; int line;
int column; int column;
// GetAbstractPC must come before MSG_BUILDER(), as it can GC, which might
// attempt to get the log lock again and result in a deadlock.
Address pc = isolate_->GetAbstractPC(&line, &column); Address pc = isolate_->GetAbstractPC(&line, &column);
MSG_BUILDER();
if (keyed) msg << "Keyed";
msg << type << kNext << reinterpret_cast<void*>(pc) << kNext << Time() msg << type << kNext << reinterpret_cast<void*>(pc) << kNext << Time()
<< kNext << line << kNext << column << kNext << old_state << kNext << kNext << line << kNext << column << kNext << old_state << kNext
<< new_state << kNext << new_state << kNext
......
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