Skip to content

takeHeapSnapshot() file write race condition #39555

@bnoordhuis

Description

@bnoordhuis
$ ./out/Release/node inspect -p 0
Debugger listening on ws://127.0.0.1:9229/ef5d9804-6bab-4956-b2da-04b21081fac7
For help see https://nodejs.org/en/docs/inspector
connecting to 127.0.0.1:9229 ...Debugger attached.
debug> takeHeapSnapshot(); takeHeapSnapshot()
Heap snaphost prepared.
Heap snaphost prepared.
Heap snaphost prepared.
Heap snaphost prepared.
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (_stream_writable.js:227:12)
    at WriteStream.Writable.write (_stream_writable.js:277:5)
    at Proxy.onChunk (internal/deps/node-inspect/lib/internal/inspect_repl.js:913:20)
    at Proxy.emit (events.js:134:15)
    at Proxy.emit (domain.js:437:20)
    at Client.NodeInspector.handleDebugEvent (internal/deps/node-inspect/lib/_inspect.js:169:22)
    at Client.emit (events.js:129:13)
    at Client.emit (domain.js:437:20)
    at Client._handleChunk (internal/deps/node-inspect/lib/internal/inspect_client.js:216:14)
    at Socket.emit (events.js:129:13)
Writing snapshot: 5341202Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (_stream_writable.js:227:12)
    at WriteStream.Writable.write (_stream_writable.js:277:5)
    at Proxy.onChunk (internal/deps/node-inspect/lib/internal/inspect_repl.js:913:20)
    at Proxy.emit (events.js:134:15)
    at Proxy.emit (domain.js:437:20)
    at Client.NodeInspector.handleDebugEvent (internal/deps/node-inspect/lib/_inspect.js:169:22)
    at Client.emit (events.js:129:13)
    at Client.emit (domain.js:437:20)
    at Client._handleChunk (internal/deps/node-inspect/lib/internal/inspect_client.js:216:14)
    at Socket.emit (events.js:129:13)
// etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions