This happens when the dbus connection is closed right before the response to SendMessageToBackend message is going to be sent. In that case, g_dbus_connection_call async ready handler generates an error before the close signal is emitted. Then the close commands try to handle the error checking if SessionHost::isConnected(), but it still returns true, because the browser is still still alive, but the dbus connection has been closed.
Created attachment 358252 [details] Patch
Attachment 358252 [details] did not pass style-queue: ERROR: Source/WebDriver/glib/SessionHostGlib.cpp:112: Extra space before last semicolon. If this should be an empty statement, use { } instead. [whitespace/semicolon] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 358253 [details] Patch
Committed r239606: <https://trac.webkit.org/changeset/239606>
<rdar://problem/47045793>