Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jeffrson opened this issue Mar 5, 2021 · 3 comments
Closed

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

jeffrson opened this issue Mar 5, 2021 · 3 comments

Comments

@jeffrson
Copy link

jeffrson commented Mar 5, 2021

  • 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)

@jeffrson
Copy link
Author

jeffrson commented Mar 5, 2021

@lpinca
it seems this problem became evident after ws 7.4.2

@lpinca
Copy link
Member

lpinca commented Mar 5, 2021

Please continue the discussion on websockets/ws#1840 until we have a test case to reproduce this using only Node.js built in modules.

lpinca added a commit to websockets/ws that referenced this issue Mar 6, 2021
@lpinca
Copy link
Member

lpinca commented Mar 6, 2021

I'm closing this as the issue is caused by an invalid usage of the InflateRaw object in ws.

@lpinca lpinca closed this as completed Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@lpinca @jeffrson and others