Skip to content

dns.setServers() crash #894

Description

@BLeQuerrec

Hi,

In a Vagrant Ubuntu environment, io.js crashes with this code:

$ cat dns.js
var dns = require('dns');

dns.resolveSoa('example.org', function(err, soa){
    console.log(soa.nsname);
    dns.resolve4(soa.nsname, function (err, nameServers) {
        console.log(dns.getServers());
        dns.setServers(nameServers);
        console.log(dns.getServers());
    });
});

Expected result:

$ iojs dns.js
sns.dns.icann.org
[ '10.0.2.3' ]
[ '199.4.28.26' ]

Actual result:

$ iojs dns.js
sns.dns.icann.org
[ '10.0.2.3' ]
iojs: ../deps/cares/src/ares_destroy.c:102: ares__destroy_servers_state: Assertion `ares__is_list_empty(&server->queries_to_server)' failed.
Aborted (core dumped)

Other informations:

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04.1 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.1 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
$ iojs -v
v1.2.0

DNS test (in test/simple/test-dns.js) ends successfully. This bug can be fixed by removing line 102 in deps/cares/src/ares_destroy.c.
Node.js bug: nodejs/node-v0.x-archive#9243

Metadata

Metadata

Assignees

Labels

confirmed-bugIssues and PRs for confirmed bugs.dnsIssues and PRs related to the dns subsystem.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions