-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
WASM crashes on Node v22.2.0 if it reaches the new Buffer() deprecation warning #53075
Comments
pimterry
added
buffer
Issues and PRs related to the buffer subsystem.
util
Issues and PRs related to the built-in util module.
labels
May 20, 2024
This assessment makes sense. It also means that the method |
Uzlopak
added a commit
to Uzlopak/node
that referenced
this issue
May 21, 2024
… deprecation warning nodejs#53075
Uzlopak
added a commit
to Uzlopak/node
that referenced
this issue
May 21, 2024
This bug is now affecting v20.15.0 as well (#52147 was included in v20.15.0) |
RandomByte
added a commit
to SAP/ui5-builder
that referenced
this issue
Jul 2, 2024
Replacing deprecated 'new Buffer(string)' with 'Buffer.from(string)'. Resolves a TypeError being thrown in our tests when executed with Node 20.15.0 or 22.3.0. Root cause: nodejs/node#53075
RandomByte
added a commit
to SAP/ui5-builder
that referenced
this issue
Jul 2, 2024
Replacing deprecated 'new Buffer(string)' with 'Buffer.from(string)'. Resolves a TypeError being thrown in our tests when executed with Node 20.15.0 or 22.3.0. Root cause: nodejs/node#53075
pimterry
added a commit
to httptoolkit/mockttp
that referenced
this issue
Jul 3, 2024
nodejs/node#53075 results in crashes in test suite (not in cases relevant to most users) when using the latest Node v20 or v22, due to Buffer usage deep in wasm within zstd-codc subdependencies, which are challenging to resolve. For now, we just skip testing on the latest versions until this is resolved.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
v22.2.0
Platform
Any platform
Subsystem
buffer
What steps will reproduce the bug?
Reproducing this requires code that uses
new Buffer()
with wasm in the stacktrace somewhere.I ran into this using zstd-codec which calls
new Buffer()
internally in various places. This can be reproduced with:npm install zstd-codec
How often does it reproduce? Is there a required condition?
Fails every time with:
What is the expected behavior? Why is that the expected behavior?
This should not fail (and does not, for Node < 22.2.0). In Node v22.1.0 the code snippet above just runs happily without errors.
(Of course, libraries should also update and avoid using deprecated APIs, but it would be good if the deprecation warning itself didn't break anything in the meantime)
What do you see instead?
Fails every time
Additional information
I'm fairly sure that this is due to #52147 (cc @Uzlopak) which changed
isInsideNodeModules
to checkfilename[0]
for every stack frame.I'm not really familiar with wasm internals at all, but based on this error I think it looks pretty clear that
filename === undefined
for wasm stack frames, and sofilename[0]
crashes for any wasm code that calls that method.The text was updated successfully, but these errors were encountered: