Skip to content

OpenBSD: Crash on dns.resolve()Β #52439

@VlkrS

Description

@VlkrS

Version

18.19.1

Platform

OpenBSD 7.5-current

Subsystem

src/cares-wrap.cc

What steps will reproduce the bug?

On OpenBSD 7.5-current,
with node 18.19.1, built with --shared-libuv, --shared-cares
and libuv 1.48.0, libcares 1.28.0

(same for node 18.20.1)

Welcome to Node.js v18.19.1.
Type ".help" for more information.
> const dns=require('dns');
undefined
> dns.resolve4('www.google.com','AAAA',(err, records) => {});
QueryReqWrap {
  bindingName: 'queryA',
  callback: [Function (anonymous)],
  hostname: 'www.google.com',
  oncomplete: [Function: onresolve],
  ttl: false
}
> node[11838]: ../src/cares_wrap.cc:685:static void node::cares_wrap::ChannelWrap::AresTimeout(uv_timer_t *): Assertion `(false) == (channel->task_list()->empty())' failed.
 1: 0x98b84fd21e0 node::Abort() [node]
 2: 0x98b84fd1eda node::Assert(node::AssertionInfo const&) [node]
 3: 0x98b84f097c4 node::cares_wrap::ChannelWrap::AresTimeout(uv_timer_s*) [node]
 4: 0x98e7c97adc8 uv_timer_get_due_in [/usr/local/lib/libuv.so.4.2]
 5: 0x98e7c9807c0 uv_run [/usr/local/lib/libuv.so.4.2]
 6: 0x98b84ef2605 node::SpinEventLoop(node::Environment*) [node]
 7: 0x98b850230a3 node::NodeMainInstance::Run() [node]
 8: 0x98b84f8d010 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) [node]
 9: 0x98b84f8d21f node::Start(int, char**) [node]
Abort trap (core dumped)

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

Occurs on every attempt

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

No crash :-)

What do you see instead?

A crash due to a failed assertion, see above.

Additional information

I realize that node v18.x chose to revert libuv to 1.44.2 and that the project cannot support non-tested setups such as this one, but since I confirmed that on FreeBSD with the same versions of node, libuv and libcares the problem does not occur, I was hoping that you might be able to suggest under which conditions the assertion in cares-wrap.cc:685 might fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnsIssues and PRs related to the dns subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions