Browse Source

src: initialize c-ares task list on env init

Don't forget to initialize the c-ares task tree head when creating a
new Environment.  Oversight from the multi-context work that landed
in commit 756b622.

Fixes #6244.
v0.11.8-release
Ben Noordhuis 11 years ago
committed by Timothy J Fontaine
parent
commit
a0f79867dc
  1. 1
      src/env-inl.h
  2. 26
      test/simple/test-dns-regress-6244.js

1
src/env-inl.h

@ -165,6 +165,7 @@ inline Environment::Environment(v8::Local<v8::Context> context)
v8::HandleScope handle_scope(isolate());
set_binding_cache_object(v8::Object::New());
set_module_load_list_array(v8::Array::New());
RB_INIT(&cares_task_list_);
}
inline Environment::~Environment() {

26
test/simple/test-dns-regress-6244.js

@ -0,0 +1,26 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var common = require('../common');
var dns = require('dns');
// Should not segfault, see #6244.
dns.resolve4('127.0.0.1', common.mustCall(function() { }));
Loading…
Cancel
Save