You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Error] unhandlederror-Underlying ArrayBuffer has been detached from the view or out-of-bounds #314126
ai-analyzedAI automation workflow has run an analysis of this issue and provided a comment.ai-generatedGenerated by AI automation workflowsbugIssue identified by VS Code Team member as probable bugerror-telemetryVS Code - Issues generated by telemetryrecent-regression
This looks like a regression in the Copilot Chat extension (v0.47.2026043003). The setItems method in l9e is likely failing because the upstream observable is returning a non-iterable value under certain network conditions or model responses on Win32.
Needs deminification to pinpoint the exact reactive state causing this.
The error "Underlying ArrayBuffer has been detached from the view or out-of-bounds" occurs in VS Code's IPC protocol layer (ChunkStream._read → VSBuffer.slice) when processing data from a Remote SSH port forwarding helper web worker. The entire call stack runs within the pfHelper worker context, where SSH channel data flows synchronously through a readable stream into the protocol reader. The failure happens because an ArrayBuffer backing a stored chunk becomes detached (transferred or neutered) before it is consumed by the deserialization code.
Culprit Commit
No culprit commit in VS Code core was identified. The core IPC protocol files (ipc.net.ts, ipc.mp.ts, buffer.ts) have not been modified in the regression window. The error originates from the Remote SSH extension's port forwarding helper (pfHelper-sshChannel.js, pfHelper-sshSession.js, pfHelper-_stream_readable.js) which runs as a web worker. A change in the Remote SSH extension likely began reusing or transferring ArrayBuffers before the protocol layer finishes consuming them. This is an external extension regression surfacing as a crash in VS Code core's buffer handling code.
Code Flow
sequenceDiagram
participant SSH as "pfHelper SSH Session"
participant Channel as "pfHelper SSH Channel"
participant Stream as "pfHelper Readable Stream"
participant Protocol as "ProtocolReader in ipc.net.ts"
participant IPC as "ChannelServer in ipc.ts"
SSH->>Channel: handleDataMessage
Channel->>Stream: handleDataReceived pushes buffer
Stream->>Protocol: acceptChunk fires data event
Note over Protocol: ChunkStream stores buffer reference
Protocol->>IPC: onMessage fires ProtocolMessage
IPC->>IPC: onRawMessage calls deserialize
Note over IPC: slice/subarray fails:<br/>ArrayBuffer is detached
Loading
Affected Files
File
Role
src/vs/base/parts/ipc/common/ipc.net.ts
Crash site — ChunkStream._read calls VSBuffer.slice on a detached buffer
src/vs/base/parts/ipc/common/ipc.ts
ChannelServer.onRawMessage triggers deserialization of the message
pfHelper-sshChannel.js (Remote SSH ext)
Root cause — provides data with a buffer that gets detached
pfHelper-_stream_readable.js (Remote SSH ext)
Data flow — readable stream passes buffer without copying
Repro Steps
Use VS Code for Web (vscode.dev) or VS Code on Mac with the Remote SSH extension
Connect to a remote SSH host with port forwarding enabled
Generate significant data traffic through the forwarded port (e.g., a web application serving responses)
The error occurs when the SSH channel's data buffer is reused or detached before the protocol layer finishes reading from it
Fix Proposal
Fix location: src/vs/base/parts/ipc/common/ipc.net.ts → ChunkStream.acceptChunk() (defensive) or the Remote SSH extension's pfHelper code (preferred)
Approach (defensive, in VS Code core): In ChunkStream.acceptChunk, defensively copy the incoming buffer's underlying data (VSBuffer.wrap(new Uint8Array(buff.buffer))) to ensure ChunkStream owns its buffers and is resilient to callers that reuse/transfer the ArrayBuffer after passing it.
Approach (preferred, in Remote SSH extension): The Remote SSH extension's port forwarding helper should not reuse or transfer ArrayBuffers after passing them to the IPC protocol layer. The pfHelper code should .slice() the data before passing it downstream, or avoid using transferable buffers in its internal postMessage calls.
Recommended Owner
@alexdima — area owner of src/vs/base/parts/ipc/ (IPC protocol layer) and best positioned to decide whether a defensive copy should be added in core or whether this should be redirected to the Remote SSH extension team.
Underlying ArrayBuffer has been detached from the view or out-of-bounds
1.121.0
Same root cause as 12b59e7b: subarray on a detached ArrayBuffer in the SSH port forwarding helper data path. Stable since 1.118, 13.5K users on 1.121.0 stable.
joshspicer My AI agent concludes that this is a problem with Remote SSH
🤖
Verdict: not a clear core fix — it's the Remote SSH extension
The crash is subarray/slice on a detached ArrayBuffer inside ChunkStream._read (src/vs/base/parts/ipc/common/ipc.net.ts:219/221). acceptChunk just stores the incoming VSBuffer by reference:
publicacceptChunk(buff: VSBuffer){this._chunks.push(buff);// <- reference kept, not copiedthis._totalLength+=buff.byteLength;}
The key signal from the stack trace: every frame is in the pfHelper-* worker (pfHelper-sshChannel.js, pfHelper-_stream_readable.js, pfHelper-sshSession.js). Those are the Remote SSH extension's port-forwarding helper, which bundles its own copy of this IPC code. The extension pushes an SSH data buffer into the stream and then transfers/reuses that same ArrayBuffer (via a postMessage transfer list) before the protocol layer finishes reading it → the stored chunk gets neutered.
That's why the AI investigation found no core culprit commit in the regression window — buffer.ts / ipc.net.ts / ipc.mp.ts weren't touched. I confirmed: no changes to those files in the 1.118.1→1.119.0 window.
So your options
Redirect to the Remote SSH team (recommended). The real fix is in their pfHelper: .slice() the SSH channel data before handing it to the stream, or stop putting that buffer in the postMessage transfer list. This is the correct owner and avoids penalizing all of core.
Add a defensive copy in core ChunkStream.acceptChunk — resilient, but it forces a copy on every IPC chunk for all connections to paper over one extension's buffer misuse. I'd avoid this on such a hot path unless you want belt-and-suspenders.
There isn't a "clean, obviously-correct, zero-cost" core change to make here. My recommendation is to reassign/redirect rather than land a defensive copy.
Want me to draft a comment on the issue redirecting to the Remote SSH extension with this analysis, or would you prefer I implement the defensive copy in ChunkStream?
Underlying ArrayBuffer has been detached from the view or out-of-bounds
1.124.2
Continues on stable 1.124.2 (5,785 affected users / 461,740 hits). Root cause already identified in this issue as the Remote-SSH port-forwarding helper worker — the fix belongs in the Remote-SSH extension rather than core.
Analysis: "ArrayBuffer is detached" surfaced as a new high-impact bucket in 1.124.2 (~6,558 users in the coalesced group), typically from accessing a transferred/neutered buffer after an async boundary.
ai-analyzedAI automation workflow has run an analysis of this issue and provided a comment.ai-generatedGenerated by AI automation workflowsbugIssue identified by VS Code Team member as probable bugerror-telemetryVS Code - Issues generated by telemetryrecent-regression
Activity
vs-code-engineering commentedon May 4, 2026
Regression Details
ngxminhlong-spec commentedon May 4, 2026
This looks like a regression in the Copilot Chat extension (v0.47.2026043003). The setItems method in l9e is likely failing because the upstream observable is returning a non-iterable value under certain network conditions or model responses on Win32.
Needs deminification to pinpoint the exact reactive state causing this.
vs-code-engineering commentedon May 4, 2026
🔍 Error Investigation
Summary
The error "Underlying ArrayBuffer has been detached from the view or out-of-bounds" occurs in VS Code's IPC protocol layer (
ChunkStream._read→VSBuffer.slice) when processing data from a Remote SSH port forwarding helper web worker. The entire call stack runs within the pfHelper worker context, where SSH channel data flows synchronously through a readable stream into the protocol reader. The failure happens because an ArrayBuffer backing a stored chunk becomes detached (transferred or neutered) before it is consumed by the deserialization code.Culprit Commit
No culprit commit in VS Code core was identified. The core IPC protocol files (
ipc.net.ts,ipc.mp.ts,buffer.ts) have not been modified in the regression window. The error originates from the Remote SSH extension's port forwarding helper (pfHelper-sshChannel.js,pfHelper-sshSession.js,pfHelper-_stream_readable.js) which runs as a web worker. A change in the Remote SSH extension likely began reusing or transferring ArrayBuffers before the protocol layer finishes consuming them. This is an external extension regression surfacing as a crash in VS Code core's buffer handling code.Code Flow
sequenceDiagram participant SSH as "pfHelper SSH Session" participant Channel as "pfHelper SSH Channel" participant Stream as "pfHelper Readable Stream" participant Protocol as "ProtocolReader in ipc.net.ts" participant IPC as "ChannelServer in ipc.ts" SSH->>Channel: handleDataMessage Channel->>Stream: handleDataReceived pushes buffer Stream->>Protocol: acceptChunk fires data event Note over Protocol: ChunkStream stores buffer reference Protocol->>IPC: onMessage fires ProtocolMessage IPC->>IPC: onRawMessage calls deserialize Note over IPC: slice/subarray fails:<br/>ArrayBuffer is detachedAffected Files
src/vs/base/parts/ipc/common/ipc.net.tsChunkStream._readcallsVSBuffer.sliceon a detached buffersrc/vs/base/parts/ipc/common/ipc.tsChannelServer.onRawMessagetriggers deserialization of the messageRepro Steps
Fix Proposal
Fix location:
src/vs/base/parts/ipc/common/ipc.net.ts→ChunkStream.acceptChunk()(defensive) or the Remote SSH extension's pfHelper code (preferred)Approach (defensive, in VS Code core): In
ChunkStream.acceptChunk, defensively copy the incoming buffer's underlying data (VSBuffer.wrap(new Uint8Array(buff.buffer))) to ensure ChunkStream owns its buffers and is resilient to callers that reuse/transfer the ArrayBuffer after passing it.Approach (preferred, in Remote SSH extension): The Remote SSH extension's port forwarding helper should not reuse or transfer ArrayBuffers after passing them to the IPC protocol layer. The pfHelper code should
.slice()the data before passing it downstream, or avoid using transferable buffers in its internal postMessage calls.Recommended Owner
@alexdima— area owner ofsrc/vs/base/parts/ipc/(IPC protocol layer) and best positioned to decide whether a defensive copy should be added in core or whether this should be redirected to the Remote SSH extension team.vs-code-engineering commentedon May 28, 2026
Related Error Buckets
These additional error buckets are tracked by this issue (v1.121.0):
9cf3c250Same root cause as
12b59e7b:subarrayon a detached ArrayBuffer in the SSH port forwarding helper data path. Stable since 1.118, 13.5K users on 1.121.0 stable.vs-code-engineering commentedon May 29, 2026
Related Error Buckets
These error buckets continue to appear in v1.122.0 (previously tracked since v1.121.0):
9cf3c250Continues on stable 1.122.0 with 1.5K users. Same SSH port forwarding helper root cause.
vs-code-engineering commentedon Jun 2, 2026
Related Error Buckets
These error buckets continue to appear in v1.122.1 (previously tracked since v1.121.0):
9cf3c250Continues on stable 1.122.1 with 5.9K users. Same SSH port forwarding helper root cause.
vs-code-engineering commentedon Jun 4, 2026
Related Error Buckets
These error buckets continue to appear in v1.123.0 (previously tracked since v1.121.0):
9cf3c250Continues on stable 1.123.0 with 674 users. Same SSH port forwarding helper root cause.
vs-code-engineering commentedon Jun 9, 2026
vs-code-engineering commentedon Jun 11, 2026
Related Error Buckets
These error buckets continue to appear in v1.124.0 (previously tracked since v1.121.0):
9cf3c250Continues on stable 1.124.0 with 959 users. Same SSH port forwarding helper root cause.
alexdima commentedon Jun 13, 2026
joshspicer My AI agent concludes that this is a problem with Remote SSH
🤖
Verdict: not a clear core fix — it's the Remote SSH extension
The crash is
subarray/sliceon a detached ArrayBuffer insideChunkStream._read(src/vs/base/parts/ipc/common/ipc.net.ts:219/221).acceptChunkjust stores the incomingVSBufferby reference:The key signal from the stack trace: every frame is in the
pfHelper-*worker (pfHelper-sshChannel.js,pfHelper-_stream_readable.js,pfHelper-sshSession.js). Those are the Remote SSH extension's port-forwarding helper, which bundles its own copy of this IPC code. The extension pushes an SSH data buffer into the stream and then transfers/reuses that same ArrayBuffer (via apostMessagetransfer list) before the protocol layer finishes reading it → the stored chunk gets neutered.That's why the AI investigation found no core culprit commit in the regression window —
buffer.ts/ipc.net.ts/ipc.mp.tsweren't touched. I confirmed: no changes to those files in the 1.118.1→1.119.0 window.So your options
Redirect to the Remote SSH team (recommended). The real fix is in their pfHelper:
.slice()the SSH channel data before handing it to the stream, or stop putting that buffer in thepostMessagetransfer list. This is the correct owner and avoids penalizing all of core.Add a defensive copy in core
ChunkStream.acceptChunk— resilient, but it forces a copy on every IPC chunk for all connections to paper over one extension's buffer misuse. I'd avoid this on such a hot path unless you want belt-and-suspenders.There isn't a "clean, obviously-correct, zero-cost" core change to make here. My recommendation is to reassign/redirect rather than land a defensive copy.
Want me to draft a comment on the issue redirecting to the Remote SSH extension with this analysis, or would you prefer I implement the defensive copy in
ChunkStream?vs-code-engineering commentedon Jun 16, 2026
Related Error Buckets
This error bucket continues to appear in v1.124.2 (previously tracked since v1.121.0):
9cf3c250Continues on stable 1.124.2 (5,785 affected users / 461,740 hits). Root cause already identified in this issue as the Remote-SSH port-forwarding helper worker — the fix belongs in the Remote-SSH extension rather than core.
vs-code-engineering commentedon Jun 16, 2026
Stable Release Anomaly Details
This issue was matched and linked by the stable-release anomaly scan (consecutive stable comparison).
new4303df6f-8fa5-eee8-6a15-0f39995f938a(coalesced with97d64c68)1.123.2...1.124.2Analysis: "ArrayBuffer is detached" surfaced as a new high-impact bucket in 1.124.2 (~6,558 users in the coalesced group), typically from accessing a transferred/neutered buffer after an async boundary.
alexdima commentedon Jun 18, 2026
Fixed via #321291