-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Unable to deserialize cloned data #49844
Comments
This could be what we have been seeing in the CI too #49852 |
The unstable behavior is caused by the weak global handles held by #50026 makes the JSTransferable global handles to be strong references. Since JSTransferables are created in place for serialization or deserialization, strong references would be released once the process is completed with detached |
JSTransferable wrapper object is a short-lived wrapper in the scope of the serialization or the deserialization. Make the JSTransferable wrapper object pointer as a strongly-referenced detached BaseObjectPtr so that a JSTransferable wrapper object and its target object will never be garbage-collected during a ser-des process, and the wrapper object will be immediately destroyed when the process is completed. PR-URL: #50026 Fixes: #49852 Fixes: #49844 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
JSTransferable wrapper object is a short-lived wrapper in the scope of the serialization or the deserialization. Make the JSTransferable wrapper object pointer as a strongly-referenced detached BaseObjectPtr so that a JSTransferable wrapper object and its target object will never be garbage-collected during a ser-des process, and the wrapper object will be immediately destroyed when the process is completed. PR-URL: nodejs#50026 Fixes: nodejs#49852 Fixes: nodejs#49844 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
JSTransferable wrapper object is a short-lived wrapper in the scope of the serialization or the deserialization. Make the JSTransferable wrapper object pointer as a strongly-referenced detached BaseObjectPtr so that a JSTransferable wrapper object and its target object will never be garbage-collected during a ser-des process, and the wrapper object will be immediately destroyed when the process is completed. PR-URL: nodejs#50026 Fixes: nodejs#49852 Fixes: nodejs#49844 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
👋🏻 Hi, y'all. Quick question. This is a bug in the LTS version of Node. Shouldn't this bug fix make its way into a Node 20 release? Node 21 shouldn't be used in production, and Node 22 doesn't enter LTS until late October. And one of the native packages I use in production doesn't have support for Node 22, yet. |
Thanks for the quick reply, @richardlau! I see this error message consistently in Node 20.12.0 in a Node test runner test. Could I be encountering a different bug with the same symptom? |
Possibly. |
Hmm... Whatever it was seems to have been fixed. Bumping to Node 20.14.0 resolved the issue, which was consistent in 20.12.0. Anyway, thanks for the quick reply. I appreciate it! |
@fraxken the error shown in the screenshot is about the snapshot was taken in a Node.js version different than the current running one. Please file a new issue if you can reproduce it with single Node.js version. |
Version
main
Platform
Linux h4ad 5.15.0-82-generic #91~20.04.1-Ubuntu SMP Fri Aug 18 16:24:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
js_transferable
What steps will reproduce the bug?
To reproduce, build the NodeJS on the main branch, add the following benchmark inside
perf_hooks
folder with the name ofhistogram.js
:Then run the benchmark with the command:
How often does it reproduce? Is there a required condition?
This error doesn't throw every time you call
structuredClone
, you will be able to find it more frequently running thebenchmark
, if you run the benchmark directly, withoutcompare.js
, you will need to run at least 10x to be able to see the issue, is very weird.What is the expected behavior? Why is that the expected behavior?
The cloning always works, instead of throwing errors randomly.
What do you see instead?
Additional information
I did a
bisect
and this issue was introduced by this commit 38dee8a.So, @legendecas, maybe you have some hints about what is happening here.
The text was updated successfully, but these errors were encountered: