node icon indicating copy to clipboard operation
node copied to clipboard

Support snapshotting node:test

Open RaisinTen opened this issue 1 year ago • 3 comments

Version

v20.0.0

Platform

No response

Subsystem

bootstrap

What steps will reproduce the bug?

$ cat input.js
require('node:test')

$ lldb -- $(command -v node) --snapshot-blob snapshot.blob --build-snapshot input.js
(lldb) target create "/usr/local/bin/node"
Current executable set to '/usr/local/bin/node' (x86_64).
(lldb) settings set -- target.run-args  "--snapshot-blob" "snapshot.blob" "--build-snapshot" "input.js"
(lldb) run
Process 5484 launched: '/usr/local/bin/node' (x86_64)
(node:5484) Warning: built-in module test is not yet supported in user snapshots
(Use `node --trace-warnings ...` to show where the warning was created)
Unknown external reference 0x1001cc6e0.
<unresolved>
Process 5484 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
    frame #0: 0x00000001014073e3 node`v8::base::OS::Abort() + 19
node`v8::base::OS::Abort:
->  0x1014073e3 <+19>: ud2
    0x1014073e5 <+21>: nopw   %cs:(%rax,%rax)
    0x1014073ef <+31>: nop

node`v8::base::OS::DebugBreak:
    0x1014073f0 <+0>:  pushq  %rbp
Target 0: (node) stopped.
(lldb) image lookup --address 0x1001cc6e0
      Address: node[0x00000001001cc6e0] (node.__TEXT.__text + 1869536)
      Summary: node`node::UDPWrapBase::RecvStart(v8::FunctionCallbackInfo<v8::Value> const&)
(lldb) ^D

So it complains that UDPWrapBase::RecvStart() - https://github.com/nodejs/node/blob/b0ca77032aa9314542c496fd6a6d109c7b4b29b3/src/udp_wrap.cc#L645-L648 has not been registered.

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

No response

What is the expected behavior? Why is that the expected behavior?

Should warn and exit with a 0 error code instead of crashing.

What do you see instead?

It crashes.

Additional information

After https://github.com/nodejs/node/pull/47779 lands, the error would reproduce while building a snapshot that requires the node:test module instead of test.

RaisinTen avatar May 03 '23 07:05 RaisinTen

cc @joyeecheung

RaisinTen avatar May 03 '23 07:05 RaisinTen

We don't support udp and the test module in the snapshot yet.

joyeecheung avatar May 03 '23 13:05 joyeecheung

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

github-actions[bot] avatar Feb 08 '24 01:02 github-actions[bot]

There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

For more information on how the project manages feature requests, please consult the feature request management document.

github-actions[bot] avatar Mar 10 '24 01:03 github-actions[bot]