From a0b6df080d210c5035574f378843aabd5074151c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 25 Jun 2013 12:47:24 +0200 Subject: [PATCH 01/10] Revert "configure: fix cross-compilation host_arch_cc()" Several people have reported cross-compiling build breakage, see e.g. https://groups.google.com/forum/#!topic/nodejs/k8HzqpqPkJQ Message-Id: <823c3bd1-e104-4409-86ad-0ab6de936fec@googlegroups.com> Subject: [nodejs] nodejs 0.10.12 and Angstrom issues This reverts commit acbdabb74b1b8484671fd3c44cd9eb9a7ea11f41. --- configure | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/configure b/configure index eb91def793..77add2b42c 100755 --- a/configure +++ b/configure @@ -296,14 +296,11 @@ def pkg_config(pkg): return (libs, cflags) -def cc_macros(cc=None): - """Checks predefined macros using the C compiler command.""" - - if cc is None: - cc = CC +def cc_macros(): + """Checks predefined macros using the CC command.""" try: - p = subprocess.Popen(shlex.split(cc) + ['-dM', '-E', '-'], + p = subprocess.Popen(shlex.split(CC) + ['-dM', '-E', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -378,9 +375,7 @@ def arm_hard_float_abi(): def host_arch_cc(): """Host architecture check using the CC command.""" - # use 'cc', as CC may be set to a target arch compiler command - # in case of cross-compilation - k = cc_macros('cc') + k = cc_macros() matchup = { '__x86_64__' : 'x64', From c1bf89df2e93c72f7dd22a8399d6f8734888916d Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 27 Jun 2013 01:37:29 +0200 Subject: [PATCH 02/10] doc: tls: ECDH ciphers are not supported --- doc/api/tls.markdown | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index b9d22d0135..92a2bcd7fa 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -117,14 +117,13 @@ automatically set as a listener for the [secureConnection][] event. The conjunction with the `honorCipherOrder` option described below to prioritize the non-CBC cipher. - Defaults to - `ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH`. + Defaults to `AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH`. Consult the [OpenSSL cipher list format documentation] for details on the - format. + format. ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported. - `ECDHE-RSA-AES128-SHA256` and `AES128-GCM-SHA256` are used when node.js is - linked against OpenSSL 1.0.1 or newer and the client speaks TLS 1.2, RC4 is - used as a secure fallback. + + `AES128-GCM-SHA256` is used when node.js is linked against OpenSSL 1.0.1 + or newer and the client speaks TLS 1.2, RC4 is used as a secure fallback. **NOTE**: Previous revisions of this section suggested `AES256-SHA` as an acceptable cipher. Unfortunately, `AES256-SHA` is a CBC cipher and therefore From 2a8c5ddc468670498b98231ea5c2464fd7e5c858 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 26 Jun 2013 17:06:40 -0700 Subject: [PATCH 03/10] blog: v0.11.3 release --- doc/blog/release/v0.11.3.md | 101 ++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 doc/blog/release/v0.11.3.md diff --git a/doc/blog/release/v0.11.3.md b/doc/blog/release/v0.11.3.md new file mode 100644 index 0000000000..4bc89efc36 --- /dev/null +++ b/doc/blog/release/v0.11.3.md @@ -0,0 +1,101 @@ +date: Wed Jun 26 16:55:29 PDT 2013 +version: 0.11.3 +category: release +title: Node v0.11.3 (Unstable) +slug: node-v0-11-3-unstable + +2013.06.26, Version 0.11.3 (Unstable) + +* uv: Upgrade to v0.11.5 + +* c-ares: upgrade to 1.10.0 + +* v8: upgrade to v3.19.13 + +* punycode: update to v1.2.3 (Mathias Bynens) + +* debugger: break on uncaught exception (Miroslav Bajtos) + +* child_process: emit 'disconnect' asynchronously (Ben Noordhuis) + +* dtrace: enable uv's probes if enabled (Timothy J Fontaine) + +* dtrace: unify dtrace and systemtap interfaces (Timothy J Fontaine) + +* buffer: New API for backing data store (Trevor Norris) + +* buffer: return `this` in fill() for chainability (Brian White) + +* build: fix include order for building on windows (Timothy J Fontaine) + +* build: add android support (Linus MÃ¥rtensson) + +* readline: strip ctrl chars for prompt width calc (Krzysztof Chrapka) + +* tls: introduce TLSSocket based on tls_wrap binding (Fedor Indutny) + +* tls: add localAddress and localPort properties (Ben Noordhuis) + +* crypto: free excessive memory in NodeBIO (Fedor Indutny) + +* process: remove maxTickDepth (Trevor Norris) + +* timers: use uv_now instead of Date.now (Timothy J Fontaine) + +* util: Add debuglog, deprecate console lookalikes (isaacs) + +* module: use path.sep instead of a custom solution (Robert Kowalski) + +* http: don't escape request path, reject bad chars (Ben Noordhuis) + +* net: emit dns 'lookup' event before connect (Ben Noordhuis) + +* dns: add getServers and setServers (Timothy J Fontaine) + + +Source Code: http://nodejs.org/dist/v0.11.3/node-v0.11.3.tar.gz + +Macintosh Installer (Universal): http://nodejs.org/dist/v0.11.3/node-v0.11.3.pkg + +Windows Installer: http://nodejs.org/dist/v0.11.3/node-v0.11.3-x86.msi + +Windows x64 Installer: http://nodejs.org/dist/v0.11.3/x64/node-v0.11.3-x64.msi + +Windows x64 Files: http://nodejs.org/dist/v0.11.3/x64/ + +Linux 32-bit Binary: http://nodejs.org/dist/v0.11.3/node-v0.11.3-linux-x86.tar.gz + +Linux 64-bit Binary: http://nodejs.org/dist/v0.11.3/node-v0.11.3-linux-x64.tar.gz + +Solaris 32-bit Binary: http://nodejs.org/dist/v0.11.3/node-v0.11.3-sunos-x86.tar.gz + +Solaris 64-bit Binary: http://nodejs.org/dist/v0.11.3/node-v0.11.3-sunos-x64.tar.gz + +Other release files: http://nodejs.org/dist/v0.11.3/ + +Website: http://nodejs.org/docs/v0.11.3/ + +Documentation: http://nodejs.org/docs/v0.11.3/api/ + +Shasums: + +``` +8320d6167f4c49d85b42bde41a201dabc125540d node-v0.11.3-darwin-x64.tar.gz +df9a540da0f5eb80682b5f63a8f7c841876ae9b2 node-v0.11.3-darwin-x86.tar.gz +76839ea31e90046c80af088b36c619eae622a6c0 node-v0.11.3-linux-x64.tar.gz +fd571ebfcdf5d7e35a2fbd972967ac24326ecb39 node-v0.11.3-linux-x86.tar.gz +85c03b89d61245ddfc911784a358e32a8a801c4f node-v0.11.3-sunos-x64.tar.gz +58f7824fdbe8b57e13865630c11100ac920474f9 node-v0.11.3-sunos-x86.tar.gz +507bbb003c755865f2b9cfc7a656ec9b142624fd node-v0.11.3-x86.msi +613ac2e985738ac06859394daf64347594b1e073 node-v0.11.3.pkg +4b82d58ed3ce38fa67a8484b42cfd47179b6a4a5 node-v0.11.3.tar.gz +e8628e45ee979ed0e666ff4ddce82444251afc85 node.exe +e883f3f4b110e78cd11d03848003829fd7377ddb node.exp +5e82f6ef29379d8d39fb0661a0533bdbed412432 node.lib +cc3ee23230b947159282161481491f39f9a36c85 node.pdb +2f7adfe4cfb69efc5d9f0b94b18787a0e14c3021 x64/node-v0.11.3-x64.msi +625fd4ab66816e57b08d73853a9438ea9e16f720 x64/node.exe +dbc8cc48c651b342980b408fdc07da01e6e3e67e x64/node.exp +9203d66c50a34c1658928d525d1f1d2eaae9718c x64/node.lib +9b1261772868734a7962848e1d1db55efde2bce9 x64/node.pdb +``` From cf6acf2a1a8717eb55aec8df79121ee6a75611f4 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 27 Jun 2013 03:18:41 +0200 Subject: [PATCH 04/10] buffer: add comment explaining buffer alignment Avoids alignment issues (unaligned loads/stores) on ARM. Originally added in commit 285d8c6. Fixes #3030. --- lib/buffer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index 000c54b3a8..51406b6ed6 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -199,8 +199,8 @@ function Buffer(subject, encoding, offset) { if (!pool || pool.length - pool.used < this.length) allocPool(); this.parent = pool; this.offset = pool.used; - pool.used += this.length; - if (pool.used & 7) pool.used = (pool.used + 8) & ~7; + // Align on 8 byte boundary to avoid alignment issues on ARM. + pool.used = (pool.used + this.length + 7) & ~7; } else { // Zero-length buffer From 92903850579727d404916ccb39a65ed8beafc7a6 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 28 Jun 2013 12:31:37 +0200 Subject: [PATCH 05/10] doc: vm: update github issues link --- doc/api/vm.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/vm.markdown b/doc/api/vm.markdown index b454c7308c..1b184c40de 100644 --- a/doc/api/vm.markdown +++ b/doc/api/vm.markdown @@ -14,7 +14,7 @@ JavaScript code can be compiled and run immediately or compiled, saved, and run The `vm` module has many known issues and edge cases. If you run into issues or unexpected behavior, please consult [the open issues on -GitHub](https://github.com/joyent/node/search?q=vm+state%3Aopen&type=Issues). +GitHub](https://github.com/joyent/node/issues?labels=vm&state=open). Some of the biggest problems are described below. ### Sandboxes From 95dcd11dde4fff1ad69b5b5bd9e6c55a9ff1c4a0 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 1 Jul 2013 05:42:19 -0400 Subject: [PATCH 06/10] zlib: allow zero values for level and strategy This is a back-port of commit c9644fb from the master branch. --- lib/zlib.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/zlib.js b/lib/zlib.js index c9263142de..a1896baeb8 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -298,10 +298,16 @@ function Zlib(opts, mode) { self.emit('error', error); }; + var level = exports.Z_DEFAULT_COMPRESSION; + if (typeof opts.level === 'number') level = opts.level; + + var strategy = exports.Z_DEFAULT_STRATEGY; + if (typeof opts.strategy === 'number') strategy = opts.strategy; + this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, - opts.level || exports.Z_DEFAULT_COMPRESSION, + level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, - opts.strategy || exports.Z_DEFAULT_STRATEGY, + strategy, opts.dictionary); this._buffer = new Buffer(this._chunkSize); From dc3c2d12c850e88de3fe352e5ac9bbea911a66d7 Mon Sep 17 00:00:00 2001 From: Brian White Date: Mon, 1 Jul 2013 05:42:36 -0400 Subject: [PATCH 07/10] zlib: level can be negative This is a back-port of commit e945903 from the master branch. --- src/node_zlib.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_zlib.cc b/src/node_zlib.cc index ebaba6bb11..9acbfcb75a 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -329,7 +329,7 @@ class ZCtx : public ObjectWrap { int windowBits = args[0]->Uint32Value(); assert((windowBits >= 8 && windowBits <= 15) && "invalid windowBits"); - int level = args[1]->Uint32Value(); + int level = args[1]->Int32Value(); assert((level >= -1 && level <= 9) && "invalid compression level"); int memLevel = args[2]->Uint32Value(); From 16b59cbc74c8fe2f8b30f3af4c2f885b7bfb6030 Mon Sep 17 00:00:00 2001 From: Peter Rust Date: Mon, 1 Jul 2013 15:46:49 -0700 Subject: [PATCH 08/10] http: use an unref'd timer to fix delay in exit There was previously up to a second exit delay when exiting node right after an http request/response, due to the utcDate() function doing a setTimeout to update the cached date/time. Fixing this should increase the performance of our http tests. --- lib/http.js | 9 +++-- test/simple/test-http-exit-delay.js | 60 +++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 test/simple/test-http-exit-delay.js diff --git a/lib/http.js b/lib/http.js index ab36cd7491..2dc1dabb0b 100644 --- a/lib/http.js +++ b/lib/http.js @@ -22,6 +22,7 @@ var util = require('util'); var net = require('net'); var Stream = require('stream'); +var timers = require('timers'); var url = require('url'); var EventEmitter = require('events').EventEmitter; var FreeList = require('freelist').FreeList; @@ -274,12 +275,14 @@ function utcDate() { if (!dateCache) { var d = new Date(); dateCache = d.toUTCString(); - setTimeout(function() { - dateCache = undefined; - }, 1000 - d.getMilliseconds()); + timers.enroll(utcDate, 1000 - d.getMilliseconds()); + timers._unrefActive(utcDate); } return dateCache; } +utcDate._onTimeout = function() { + dateCache = undefined; +}; /* Abstract base class for ServerRequest and ClientResponse. */ diff --git a/test/simple/test-http-exit-delay.js b/test/simple/test-http-exit-delay.js new file mode 100644 index 0000000000..3643492735 --- /dev/null +++ b/test/simple/test-http-exit-delay.js @@ -0,0 +1,60 @@ +// 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 assert = require('assert'); +var common = require('../common.js'); +var http = require('http'); + +var start; +var server = http.createServer(function(req, res) { + req.resume(); + req.on('end', function() { + res.end('Success'); + }); + + server.close(function() { + start = process.hrtime(); + }); +}); + +server.listen(common.PORT, 'localhost', function() { + var interval_id = setInterval(function() { + if (new Date().getMilliseconds() > 100) + return; + + var req = http.request({ + 'host': 'localhost', + 'port': common.PORT, + 'agent': false, + 'method': 'PUT' + }); + + req.end('Test'); + clearInterval(interval_id); + }, 10); +}); + +process.on('exit', function() { + var d = process.hrtime(start); + assert.equal(d[0], 0); + assert(d[1] / 1e9 < 0.03); + console.log('ok'); +}); From 4c38742dd8a41f119b7113af6440014e25ae71c2 Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Mon, 1 Jul 2013 21:29:15 +0000 Subject: [PATCH 09/10] test: fix tls-hello-parser-failure on smartos Assert that when the client closes it has seen an error, this prevents the test from timing out. Also queue a second write in the case that we were able to send the buffer before the other side closed the connection. --- test/simple/test-tls-hello-parser-failure.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/simple/test-tls-hello-parser-failure.js b/test/simple/test-tls-hello-parser-failure.js index f7e1f741fa..cce94007f7 100644 --- a/test/simple/test-tls-hello-parser-failure.js +++ b/test/simple/test-tls-hello-parser-failure.js @@ -30,21 +30,32 @@ var options = { cert: fs.readFileSync(common.fixturesDir + '/test_cert.pem') }; +var bonkers = new Buffer(1024 * 1024); +bonkers.fill(42); + var server = tls.createServer(options, function(c) { }).listen(common.PORT, function() { var client = net.connect(common.PORT, function() { - var bonkers = new Buffer(1024 * 1024); - bonkers.fill(42); - client.end(bonkers); + client.write(bonkers); }); var once = false; - client.on('error', function() { + + var writeAgain = setTimeout(function() { + client.write(bonkers); + }); + + client.on('error', function(err) { if (!once) { + clearTimeout(writeAgain); once = true; client.destroy(); server.close(); } }); + + client.on('close', function (hadError) { + assert.strictEqual(hadError, true, 'Client never errored'); + }); }); From 806e300878478db0a6f3c39762f35eed6aae0fe1 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 5 Jul 2013 02:20:37 +0200 Subject: [PATCH 10/10] src: fix memory leak in UsingDomains() UsingDomains() assigned process_tickCallback when it had already been set by MakeCallback() a few frames down the call stack. Dispose the handle first or we'll retain whatever is in the lexical closure of the old process._tickCallback function. Fixes #5795. --- src/node.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node.cc b/src/node.cc index 9b27bfd5b0..94af50941b 100644 --- a/src/node.cc +++ b/src/node.cc @@ -919,6 +919,7 @@ Handle UsingDomains(const Arguments& args) { Local ndt = ndt_v.As(); process->Set(String::New("_tickCallback"), tdc); process->Set(String::New("nextTick"), ndt); + process_tickCallback.Dispose(); // Possibly already set by MakeCallback(). process_tickCallback = Persistent::New(tdc); return Undefined(); }