Skip to content

Commit b1e453e

Browse files
committed
[ Timeline ] Fix use-after-free error at shutdown when using endless timeline recorder
Timeline::Clear() results in the linked list of events being destroyed when using the endless timeline recorder. This call was not protected by RecorderLock::WaitForShutdown() and could result in an event being allocated after the recorder's list of events had been destroyed. Fixes #48899 TEST=CQ Change-Id: I7e3de2bc99535a560321159ded70aef3e8686526 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243140 Commit-Queue: Ben Konyi <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
1 parent 26c6550 commit b1e453e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/vm/timeline.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ void Timeline::Cleanup() {
222222
Timeline::stream_##name##_.set_enabled(false);
223223
TIMELINE_STREAM_LIST(TIMELINE_STREAM_DISABLE)
224224
#undef TIMELINE_STREAM_DISABLE
225-
Timeline::Clear();
226225
RecorderLock::WaitForShutdown();
226+
Timeline::Clear();
227227
delete recorder_;
228228
recorder_ = NULL;
229229
if (enabled_streams_ != NULL) {

0 commit comments

Comments
 (0)