Commit Graph

7941 Commits (95862b23802175b5d6b509d6a6f83fa5fd53b474)

Author SHA1 Message Date
isaacs 95862b2380 core: Mark exit() calls with status codes
Also, exit with 128+n for signal exit n, as is The Unix Way.
2013-02-27 14:47:01 -08:00
Ben Noordhuis c6e2db2f14 crypto: clear error stack
Clear OpenSSL's error stack on return from Connection::HandleSSLError().
This stops stale errors from popping up later in the lifecycle of the
SSL connection where they would cause spurious failures.

This commit causes a 1-2% performance regression on `make bench-tls`.
We'll address that in follow-up commits if possible but let's ensure
correctness first.

Fixes #4771.
2013-02-27 23:31:40 +01:00
Scott Blomquist f054fec535 openssl: regenerate asm files for openssl 1.0.1e 2013-02-26 22:56:54 -08:00
isaacs 86433979c6 stream: Writables are not pipe()able
This handles the fact that stream.Writable inherits from the Stream class,
meaning that it has the legacy pipe() method.  Override that with a pipe()
method that emits an error.

Ensure that Duplex streams ARE still pipe()able, however.

Since the 'readable' flag on streams is sometimes temporary, it's probably
better not to put too much weight on that.  But if something is an instanceof
Writable, rather than of Readable or Duplex, then it's safe to say that
reading from it is the wrong thing to do.

Fix #3647
2013-02-26 18:54:05 -08:00
isaacs 586e160a25 test: Use common.PORT in simple/test-http-timeout 2013-02-26 17:54:18 -08:00
isaacs 1b870b6127 test: Move test-net-connect-timeout to test/internet
It is not a valid test unless you're connected to the internet, and causes
a lot of spurious failures on Linux anyway, as it's highly dependent on
timing of things that we don't have any control over.
2013-02-26 17:39:04 -08:00
isaacs 937662b03e test: Use common.PORT to determine debugger port 2013-02-26 17:33:30 -08:00
isaacs ec378aaa69 test: Fix debugger repl tests
This makes the output of simple/test-debugger-repl and
simle/test-debugger-repl-utf8 mirror an actual debugger session, so it's
a bit easier to reason about.

Also, it uses the same code for both, and fixes it so that it doesn't
leave zombie processes lying around when it crashes.

Run 1000 times without any failures or zombies.
2013-02-26 16:49:17 -08:00
isaacs 57f9f048d3 test: catch break in simple/test-debugger-client
Handle break events that come out sometimes, by telling it to continue.

Also, send the child a SIGTERM when it times out.
2013-02-26 16:48:44 -08:00
isaacs 30e5366b29 core: Use a uv_signal for debug listener
Starting the debugger directly in the SIGUSR1 signal handler results in
a malloc lock contention ~1% of the time.  It hangs the test, which is
annoying on a daily basis to all of us, but it also is pretty terrible
if you actually want to debug a node process that has gone sideways.

Credit to @bnoordhuis for most of this.  I just added the unref which
keeps it from messing up the event loop for other stuff.
2013-02-26 16:46:26 -08:00
Ben Noordhuis 7bc449c063 deps: upgrade libuv to a0c1d84 2013-02-26 20:30:12 +01:00
Ben Noordhuis e505f91266 test: merge environment, don't overwrite
The CI system requires that some environment variables are set so merge
our variables into the current environment instead of blindly replacing
it.

This will probably have to be repeated for other tests. C'est la vie.
2013-02-26 19:42:08 +01:00
yangguo@chromium.org cfacde3ac6 v8: Hardfloat does not imply VFPv3, only VFPv2.
Raspberry Pi is an example.

BUG=v8:2393

Review URL: https://chromiumcodereview.appspot.com/11570061
Patch from Chi-Thanh Christopher Nguyen <nguyenchithanh@gmail.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

This is a backport of v8/v8@44419ad089.
2013-02-26 18:44:02 +01:00
Ben Noordhuis c80bde1781 v8: work around String::WriteAscii segfault
See http://code.google.com/p/v8/issues/detail?id=2493 for details.

This commit reapplies 9668df8. The issue has been fixed upstream but
reappeared after last night's downgrade to V8 3.14.5 in commit b15a10e.

Conflicts:
	test/simple/test-buffer.js
2013-02-26 18:27:30 +01:00
Timothy J Fontaine 17a812618d test: optionally set common.PORT via env variable 2013-02-26 08:07:46 -08:00
Andrei Sedoi 17c6fe2e22 mips: fix openssl build 2013-02-26 17:03:07 +01:00
Timothy J Fontaine 8fe72a7f27 build: automatically add tag for nightly builds 2013-02-26 15:33:13 +01:00
Ben Noordhuis d4a297ccb0 http: fix case in 505 response status line
Fixes #4850.
2013-02-26 15:18:40 +01:00
Fedor Indutny aa98539277 v8: fix postmortem and dtrace helper build
Regardless of previous @bnoordhuis' changes
2013-02-26 08:17:21 +00:00
Fedor Indutny 3d913fec83 Revert "sunos: unbreak build after v8 downgrade"
This reverts commit f80f3c5f62.
2013-02-26 07:57:12 +00:00
isaacs 88befa6021 bench: Make http easier to profile
Do not run the http/simple.js server in a child process.

Fix #4831
2013-02-25 17:47:28 -08:00
Ben Noordhuis f80f3c5f62 sunos: unbreak build after v8 downgrade
Commit 3d67f89 ("fix generation of v8 constants on freebsd") is an
unfortunate victim of this rollback.

Revert "dtrace: fix generation of v8 constants on freebsd"
Revert "dtrace: More style"
Revert "dtrace: Make D style more D-ish"
Revert "dtrace: x64 ustack helper"
Revert "dtrace: fix style in ustack helper"
Revert "dtrace: SeqAsciiString was renamed to SeqOneByteString in v8"

This reverts commit 3d67f89552.
This reverts commit 321b8eec08.
This reverts commit 38df9d51a2.
This reverts commit f9afb3f010.
This reverts commit 13296e4b13.
This reverts commit 3b715edda9.
2013-02-26 01:30:44 +01:00
Ben Noordhuis 51f6e6a9b3 src, test: downgrade to v8 3.14 api 2013-02-25 23:45:02 +01:00
Ben Noordhuis 03fe7fb55c v8: reapply floating patches
Reapply floating patches. Special mention: also reapplies 017009f but
with the extra change of removing DescriptorArray::kTransitionsIndex
from the postmortem metadata generator because said field no longer
exists in V8 3.14.
2013-02-25 23:45:02 +01:00
Ben Noordhuis b15a10e7a0 deps: downgrade v8 to 3.14.5
V8 3.15 and newer have stability and performance issues. Roll back to
a known-good version.
2013-02-25 23:45:02 +01:00
isaacs 34046084c0 stream: Do not switch to objectMode implicitly
Only handle objects if explicitly told to do so in the options
object.  Non-buffer/string chunks are an error if not already in
objectMode.

Close #4662
2013-02-25 07:38:10 -08:00
isaacs e03bc472f0 stream: Start out in sync=true state
The Readable and Writable classes will nextTick certain things
if in sync mode.  The sync flag gets unset after a call to _read
or _write.  However, most of these behaviors should also be
deferred until nextTick if no reads have been made (for example,
the automatic '_read up to hwm' behavior on Readable.push(chunk))

Set the sync flag to true in the constructor, so that it will not
trigger an immediate 'readable' event, call to _read, before the
user has had a chance to set a _read method implementation.
2013-02-25 07:38:10 -08:00
Ben Noordhuis 4231dab39f crypto: fix base64 padding regression
Commit 9901b69c introduces a small regression where the trailing base64
padding is no longer written out when Cipher#final is called. Rectify
that.

Fixes #4837.
2013-02-25 15:21:52 +01:00
Ben Noordhuis 8df893c62e test: re-enable simple/test-setproctitle on darwin
The functionality is available again per joyent/libuv@14eb8b0
and joyent/libuv@e89aced.

Fixes #3687.
2013-02-24 04:07:42 +01:00
Ben Noordhuis de9ee2a483 deps: upgrade libuv to e89aced 2013-02-24 04:03:49 +01:00
isaacs 74c08403d8 lint 2013-02-22 16:30:27 -08:00
isaacs 27d1babaae streams: Pre-emptively buffer readables up to the highWaterMark
Also, this adds a test that guarantees that the ordering of several
push() calls in a row is always preserved in synchronous readable streams
2013-02-22 11:24:05 -08:00
isaacs a63c28e6eb stream: Return false from push() more properly
There are cases where a push() call would return true, even though
the thing being pushed was in fact way way larger than the high
water mark, simply because the 'needReadable' was already set, and
would not get unset until nextTick.

In some cases, this could lead to an infinite loop of pushing data
into the buffer, never getting to the 'readable' event which would
unset the needReadable flag.

Fix by splitting up the emitReadable function, so that it always
sets the flag on this tick, even if it defers until nextTick to
actually emit the event.

Also, if we're not ending or already in the process of reading, it
now calls read(0) if we're below the high water mark.  Thus, the
highWaterMark value is the intended amount to buffer up to, and it
is smarter about hitting the target.
2013-02-21 15:23:18 -08:00
isaacs 3b2e9d2648 stream: remove lowWaterMark feature
It seems like a good idea on the face of it, but lowWaterMarks are
actually not useful, and in practice should always be set to zero.

It would be worthwhile for writers if we actually did some kind of
writev() type of thing, but actually this just delays calling write()
and the overhead of doing a bunch of Buffer copies is not worth the
slight benefit of calling write() fewer times.
2013-02-21 15:23:18 -08:00
isaacs 089ec58613 path: Throw TypeError on non-string args to path.resolve 2013-02-21 15:18:44 -08:00
Nathan Rajlich 50c88e0ff2 test: modify async native test.js to test for #4820 2013-02-21 13:14:07 -08:00
Nathan Rajlich 4b61522f16 test: add an "async-hello-world" native addon test 2013-02-21 13:14:07 -08:00
Arianit Uka 055110dab0 path: join throws TypeError on non-string args
lib/path.js:
  - throws a TypeError on the filter if the argument is not a string.

test/simple/test-path.js:
  - removed the test to check if non-string types are filtered.
  - added a test to check if path.join throws TypeError on arguments that
    are not strings.
2013-02-21 11:50:47 -08:00
Fedor Indutny ebc95f0716 tls: _handle.readStart/readStop for CryptoStream
lib/http.js is using stream._handle.readStart/readStop to control
data-flow coming out from underlying stream. If this methods are not
present - data might be buffered regardless of whether it'll be read.

see #4657
2013-02-21 23:29:18 +04:00
Trevor Norris 7301ba3969 process: fix bug where spinner wasn't called
Apperently there is a case where calling the spinner was required after
passing a callback to nextTick(). This fixes that issue.
2013-02-21 10:31:01 -08:00
isaacs bbcb8b3ae0 path: Do not coerce paths to strings on Windows
Fix #4795
2013-02-20 14:04:30 -08:00
Ben Noordhuis 9d10bf58a3 stream_wrap: remove superfluous buffer len check
It's a buffer so it's never bigger than Buffer::kMaxLength bytes,
which in turn is always < INT_MAX.
2013-02-20 22:17:36 +01:00
Ben Noordhuis 6ad792610b deps: upgrade libuv to 26fa6f8 2013-02-20 21:29:52 +01:00
Trevor Norris d69a26b965 buffer: check logic simplification
Checks have been simplified and optimized for most-used cases.

Calling Buffer with another Buffer as the subject will now use the
SlowBuffer Copy method instead of the for loop.

No need to call for value coercion, just place the ternary inline.
2013-02-20 20:34:34 +01:00
isaacs 053e02ef8e benchmark: Fix alignment issues on --html compare output 2013-02-20 09:17:29 -08:00
Ben Noordhuis 57ef65916b node: code cleanup, make tick_infobox static
It's not used outside of src/node.cc so make it static.
2013-02-20 14:15:11 +01:00
Ben Noordhuis 0dcbecd32b crypto: fix uninitialized memory access in openssl
ASN1_STRING_to_UTF8() passes an ASN1_STRING to ASN1_STRING_set() but forgot to
initialize the `length` field.

Fixes the following valgrind error:

  $ valgrind -q --track-origins=yes --num-callers=19 \
      out/Debug/node test/simple/test-tls-client-abort.js
  ==2690== Conditional jump or move depends on uninitialised value(s)
  ==2690==    at 0x784B69: ASN1_STRING_set (asn1_lib.c:382)
  ==2690==    by 0x809564: ASN1_mbstring_ncopy (a_mbstr.c:204)
  ==2690==    by 0x8090F0: ASN1_mbstring_copy (a_mbstr.c:86)
  ==2690==    by 0x782F1F: ASN1_STRING_to_UTF8 (a_strex.c:570)
  ==2690==    by 0x78F090: asn1_string_canon (x_name.c:409)
  ==2690==    by 0x78EF17: x509_name_canon (x_name.c:354)
  ==2690==    by 0x78EA7D: x509_name_ex_d2i (x_name.c:210)
  ==2690==    by 0x788058: ASN1_item_ex_d2i (tasn_dec.c:239)
  ==2690==    by 0x7890D4: asn1_template_noexp_d2i (tasn_dec.c:746)
  ==2690==    by 0x788CB6: asn1_template_ex_d2i (tasn_dec.c:607)
  ==2690==    by 0x78877A: ASN1_item_ex_d2i (tasn_dec.c:448)
  ==2690==    by 0x7890D4: asn1_template_noexp_d2i (tasn_dec.c:746)
  ==2690==    by 0x788CB6: asn1_template_ex_d2i (tasn_dec.c:607)
  ==2690==    by 0x78877A: ASN1_item_ex_d2i (tasn_dec.c:448)
  ==2690==    by 0x787C93: ASN1_item_d2i (tasn_dec.c:136)
  ==2690==    by 0x78F5E4: d2i_X509 (x_x509.c:141)
  ==2690==    by 0x7C9B91: PEM_ASN1_read_bio (pem_oth.c:81)
  ==2690==    by 0x7CA506: PEM_read_bio_X509 (pem_x509.c:67)
  ==2690==    by 0x703C9A: node::crypto::SecureContext::AddRootCerts(v8::Arguments const&) (node_crypto.cc:497)
  ==2690==  Uninitialised value was created by a stack allocation
  ==2690==    at 0x782E89: ASN1_STRING_to_UTF8 (a_strex.c:560)
2013-02-20 17:01:47 +04:00
Bert Belder da945a7376 openssl: make perlasm target pentium or newer for masm outputs
When perlasm generates MASM code it sets the assembler target to 468.
In this mode MASM refuses to assemble a couple of instructions. Bumping
the target to 686 solves this problem.
2013-02-20 17:00:29 +04:00
Bert Belder eb29c4b2e6 openssl: disable HT sidechannel attack mitigation
It used to be off before. It's extremely unlikely that such an attack
would be a viable attack against node. And it makes AES much slower.
2013-02-20 16:49:03 +04:00
Fedor Indutny f317f5aee9 openssl: update to 1.0.1e 2013-02-20 16:48:20 +04:00