Files
vscode/remote/package.json
T
Tyler James Leonhardt e6f4d6c6f2 Avoid CPU-pegging process report in libc detection (#322260)
* Avoid CPU-pegging process report in libc detection

detectLibc() called process.report.getReport() on every Linux process to
tell glibc from musl. That report serializes heap, native stack and libuv
state, and the network/socket enumeration can peg the CPU on busy hosts.

Detect cheapest-first instead: parse the ELF PT_INTERP dynamic-linker path
from the head of /proc/self/exe, then string-match the head of /usr/bin/ldd,
and only fall back to the process report (now with excludeNetwork = true to
skip the expensive libuv section, also inspecting sharedObjects). Default to
glibc when nothing is conclusive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Read ELF64 offsets as 64-bit with safe-integer guards

Address PR review: e_phoff, p_offset and p_filesz are 64-bit fields in
ELF64. Read them via readBigUInt64LE through a bounded helper that rejects
values past Number.MAX_SAFE_INTEGER, validate e_phentsize covers a full
Elf64_Phdr, and widen the per-entry bounds check to the 8-byte p_filesz.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use detect-libc package instead of hand-rolled libc detection

Replace the bespoke ELF/ldd/process-report probing in detectLibc() with the
detect-libc package (already present transitively, now a direct dependency).
It performs the same cheapest-first detection and sets process.report's
excludeNetwork flag internally, so the CPU-pegging libuv enumeration is still
avoided without us maintaining the ELF parser. Add detect-libc to the
hasNode import allowlist in eslint.config.js.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Declare detect-libc in remote/package.json

detectLibc() (via agentSdkDownloader) is reached from agentHostServerMain,
so the server/REH build requires detect-libc. It was only present in the
remote node_modules transitively (through @parcel/watcher); declare it
directly to match the root manifest and the direct import.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rename detectLibc to detectLibcSync

Signal the blocking nature in the name and leave room for a future
promise-based detectLibc that wraps detect-libc's async family(). Update
the agentSdkDownloader consumer and the unit test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-21 19:43:34 -07:00

67 lines
2.0 KiB
JSON

{
"name": "vscode-reh",
"version": "0.0.0",
"private": true,
"dependencies": {
"@github/copilot": "^1.0.64-0",
"@github/copilot-sdk": "^1.0.2",
"@microsoft/1ds-core-js": "^3.2.13",
"@microsoft/1ds-post-js": "^3.2.13",
"@microsoft/mxc-sdk": "0.6.0",
"@parcel/watcher": "^2.5.6",
"@vscode/copilot-api": "^0.4.2",
"@vscode/deviceid": "^0.1.1",
"@vscode/iconv-lite-umd": "0.7.1",
"@vscode/native-watchdog": "^1.4.6",
"@vscode/proxy-agent": "^0.42.0",
"@vscode/ripgrep-universal": "^1.18.0",
"@vscode/sandbox-runtime": "0.0.1",
"@vscode/spdlog": "^0.15.8",
"@vscode/sqlite3": "5.1.12-vscode",
"@vscode/tree-sitter-wasm": "^0.3.1",
"@vscode/vscode-languagedetection": "1.0.23",
"@vscode/windows-process-tree": "^0.7.0",
"@vscode/windows-registry": "^1.2.0",
"@xterm/addon-clipboard": "^0.3.0-beta.285",
"@xterm/addon-image": "^0.10.0-beta.285",
"@xterm/addon-ligatures": "^0.11.0-beta.285",
"@xterm/addon-progress": "^0.3.0-beta.285",
"@xterm/addon-search": "^0.17.0-beta.285",
"@xterm/addon-serialize": "^0.15.0-beta.285",
"@xterm/addon-unicode11": "^0.10.0-beta.285",
"@xterm/addon-webgl": "^0.20.0-beta.284",
"@xterm/headless": "^6.1.0-beta.285",
"@xterm/xterm": "^6.1.0-beta.285",
"cookie": "^0.7.0",
"detect-libc": "^2.1.2",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.2",
"jschardet": "3.1.4",
"katex": "^0.16.22",
"kerberos": "2.1.1",
"minimist": "^1.2.8",
"node-addon-api": "^6.0.0",
"node-pty": "^1.2.0-beta.13",
"ssh2": "^1.16.0",
"tar": "^7.5.9",
"tas-client": "0.3.1",
"vscode-oniguruma": "1.7.0",
"vscode-regexpp": "^3.1.0",
"vscode-textmate": "^9.3.2",
"ws": "^8.19.0",
"yauzl": "^3.3.1",
"yazl": "^2.4.3",
"zod": "^3.25.76"
},
"overrides": {
"node-gyp-build": "4.8.1",
"kerberos@2.1.1": {
"node-addon-api": "7.1.0"
},
"ssh2": {
"cpu-features": "0.0.0"
},
"yauzl": "^3.3.1"
}
}