Skip to content

Support snapshotting node:test #47832

Description

@RaisinTen

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

node/src/udp_wrap.cc

Lines 645 to 648 in b0ca770

void UDPWrapBase::RecvStart(const FunctionCallbackInfo<Value>& args) {
UDPWrapBase* wrap = UDPWrapBase::FromObject(args.Holder());
args.GetReturnValue().Set(wrap == nullptr ? UV_EBADF : wrap->RecvStart());
}
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 #47779 lands, the error would reproduce while building a snapshot that requires the node:test module instead of test.

Activity

  1. RaisinTen commented on May 3, 2023

    @RaisinTen
    MemberAuthor
  2. joyeecheung commented on May 3, 2023

    @joyeecheung
    Member

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

  3. added
    test_runnerIssues and PRs related to the test runner subsystem.
    on May 10, 2023
  4. changed the title [-]`Unknown external reference` error when building a snapshot that requires the `test` module[/-] [+]Support snapshotting node:test[/+] on Aug 11, 2023
  5. github-actions commented on Feb 8, 2024

    @github-actions
    Contributor

    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.

  6. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Feb 8, 2024
  7. github-actions commented on Mar 10, 2024

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions