Skip to content

zlib: Error [ERR_INTERNAL_ASSERTION]: zlib binding closed #37612

@jeffrson

Description

@jeffrson
  • Version: 15.11.0, 14.1[56].* 12.2[01].* and more
  • Platform: Windows, Linux x64
  • Subsystem: zlib

What steps will reproduce the bug?

see repo @ https://github.com/jeffrson/node_zlib_binding_err_internal_assertion

NodeJs connects via websockets (https://www.npmjs.com/package/ws) to Windows service using websocket-sharp (https://github.com/sta/websocket-sharp).

Sending data from ws# service to nodejs client crashs the client.

How often does it reproduce? Is there a required condition?

always - apparently must send two messages

What is the expected behavior?

should not crash but receive and use data

What do you see instead?

internal/assert.js:14
    throw new ERR_INTERNAL_ASSERTION(message);
    ^

Error [ERR_INTERNAL_ASSERTION]: zlib binding closed
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at assert (internal/assert.js:14:11)
    at InflateRaw.ZlibBase.reset (zlib.js:318:5)
    at ...\ws_test\node\node_modules\ws\lib\permessage-deflate.js:383:23
    at errorBuffer (internal/streams/writable.js:486:5)
    at afterWrite (internal/streams/writable.js:470:5)
    at onwrite (internal/streams/writable.js:446:7)
    at InflateRaw.afterTransform (internal/streams/transform.js:103:3)
    at Zlib.processCallback (zlib.js:546:10) {
  code: 'ERR_INTERNAL_ASSERTION'
}

Additional information

Workaround: disable compression in client (perMessageDeflate: false)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions