diff --git a/lib/sender.js b/lib/sender.js index 2c767e2c62a7fb50a987454f0c148ec5b4a0a523..48549a5c0fde4347a3fde83a32e56c2bbc81d0ce 100644 --- a/lib/sender.js +++ b/lib/sender.js @@ -561,7 +561,13 @@ class Sender { * @private */ sendFrame(list, cb) { - if (list.length === 2) { + // + // Never write an empty payload on its own: `socket.write()` of a + // zero-length buffer fails with EFAULT under Electron on arm64 kernels with + // 39-bit virtual addresses, which kills the connection (stablyai/orca#23398). + // The header already encodes the zero length, so the wire bytes are unchanged. + // + if (list.length === 2 && list[1].length !== 0) { this._socket.cork(); this._socket.write(list[0]); this._socket.write(list[1], cb);