Bug 1503639 Part 6 - Handle read() failures in the checkpoint listening thread, r=lsmyth.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 31 Oct 2018 10:22:20 -1000
changeset 445255 8efe543a747c1fadf44b46f79c121a13c687f81c
parent 445254 f3a5ebd83214692da16e1188150c68d72505bf11
child 445256 4319d0b6443bc3c6c2bff061ac01a20060841897
push id35014
push userdvarga@mozilla.com
push dateFri, 09 Nov 2018 10:01:40 +0000
treeherdermozilla-central@5e7636ec12c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsmyth
bugs1503639
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1503639 Part 6 - Handle read() failures in the checkpoint listening thread, r=lsmyth.
toolkit/recordreplay/ipc/ChildIPC.cpp
--- a/toolkit/recordreplay/ipc/ChildIPC.cpp
+++ b/toolkit/recordreplay/ipc/ChildIPC.cpp
@@ -192,22 +192,24 @@ ChannelMessageHandler(Message* aMsg)
 // recorded. By communicating between the two threads with a pipe, this
 // thread's behavior will be replicated exactly when replaying and new
 // checkpoints will be created at the same point as during recording.
 static void
 ListenForCheckpointThreadMain(void*)
 {
   while (true) {
     uint8_t data = 0;
-    ssize_t rv = read(gCheckpointReadFd, &data, 1);
+    ssize_t rv = HANDLE_EINTR(read(gCheckpointReadFd, &data, 1));
     if (rv > 0) {
       NS_DispatchToMainThread(NewRunnableFunction("NewCheckpoint", NewCheckpoint,
                                                   /* aTemporary = */ false));
     } else {
-      MOZ_RELEASE_ASSERT(errno == EINTR);
+      MOZ_RELEASE_ASSERT(errno == EIO);
+      MOZ_RELEASE_ASSERT(HasDivergedFromRecording());
+      Thread::WaitForever();
     }
   }
 }
 
 // Shared memory block for graphics data.
 void* gGraphicsShmem;
 
 void