Giter Club home page Giter Club logo

node-v0.x-archive's Introduction

This repository is an archive of Node.js before the move to nodejs/node.

It still contains issues and pull requests that are relevant to Node versions v0.10 and v0.12, and that were opened before the move to nodejs/node. New issues and pull requests, for all branches, should be opened at nodejs/node. New issues and pull requests opened here will automatically be rejected.

The pre-convergence version of the README is available here.

node-v0.x-archive's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-v0.x-archive's Issues

posix.cat hangs when reading multiple large files

This error only seems to appear when using posix.cat to read multiple files (or the same file multple times) using posix.cat. strace shows that it's hanging on epoll_wait.

var sys = require('sys');
var posix = require('posix');
var doc = '/etc/hosts';
for(var i=0;i<30;i++) {
posix.cat(doc).addCallback(
function(data) {
sys.puts("beep");
});
}

Segmentation fault

Node rev: e801f42

I'm getting a segfault in an app that makes few dozen http requests + serving few requests locally http://github.com/ncr/flickr_spy/commit/a1528373b0e454cfb9e2a640661f0502b730fb51

The segfault happens consistently when I connect 2 clients to my server (responses are streamed and take about 1-2 mins), when I connect only 1 client it works ok.

Here's the stacktrace fragment from node_g:


#
# Fatal error in /Users/ncr/dev/node/deps/v8/src/objects-inl.h, line 1585
# CHECK(object->IsProxy()) failed
#


==== Stack trace ============================================

Security context: 0x649205 #0#
    2: flushMessageQueue(this=0x649281 #1#,connection=0x78bde1 >#2#,queue=0x78ee9d #3#)
    3: /* anonymous */(this=0x78eee9 >#4#)
    7: flush(this=0x78eee9 >#4#)
    8: sendBody(this=0x78eee9 >#4#,chunk=0x1a69155 ,encoding=0x65a12d )
    9: arguments adaptor frame: 1->2
   10: /* anonymous */(this=0x78bdc5 >#5#,data=0x1a61219 #6#)
   14: /* anonymous */(this=0x649281 #1#,user_ids=0x1a60999 #7#)
   15: /* anonymous */(this=0x1814121 >#8#,data=0x1a5f0c9 >#9#)
   16: arguments adaptor frame: 2->1
   20: _respond(this=0x1814121 >#8#,type=0x65fbed ,data=0x1a5f0c9 >#9#,response=0x18140a9 >#10#)
   21: /* anonymous */(this=0x18140a9 >#10#)
   25: /* anonymous */(this=0x18006bd >#11#)
   29: /* anonymous */(this=0x649281 #1#)
   30: /* anonymous */(this=0x649281 #1#)

How can I help more (not being c coder for 10 years now)?

req.uri.queryKey is undefined in latest version

The following code works in 0.0.2 but not the latest commit

new node.http.Server(function (req, res) {
  res.sendHeader(200, [["Content-Type", "text/plain"]]);
  res.sendBody("Hello "+req.uri.queryKey.name);
  res.finish();
}).listen(8000);
puts("Server running at http://127.0.0.1:8000/");

with request http://127.0.0.1:8000/?name=Connor you get

test.js:3: TypeError: Cannot read property 'name' of undefined
  res.sendBody("Hello "+req.uri.queryKey.name);
  ^

Writing to files in loops seems to be capped at 250 file.write calls.

I wrote a simple loop last night to test File I/O and noticed the following behavior. If I created a loop like so:

var times = [];
for (var i=0,j=251; i<j; i++) {
    var t1 = Date.now();
    var file = new node.fs.File();
    file.open('test.log', 'a+');
    file.write(i + ' ' + new Date() + ' Hello World!\n');
    file.close();
    times.push((Date.now() - t1));
}

'file' would contain only 250 new lines of text, while the array 'times' would show it's length to be 1000. The number of new lines added to the file seems fixed at 250. Setting the loop to 249 produced a times array with 249 items and a file with 249 new lines. Setting the loop to 251 produced a times array with 251 items and a file with 250 new lines.

My C++ is very poor, but my guess is that each event has a queue which is hard coded at 250 and my loop over flowed the queue.

Expected:
In a loop you should be able to write to files as much as you like. A web-server that is getting hit many times per second might overflow a 250 limit.

process.watchFile() triggers twice

process.watchFile() triggers twice for one file change. It doesn't happen on all changes (seems random) and only starts after repeated calls.

#!/usr/bin/env node

var sys = require('sys');

process.watchFile('foo', {interval: 1000}, function(curr,prev){
  sys.puts("prev mtime: " + prev.mtime);
  sys.puts("curr mtime: " + curr.mtime);
  sys.puts("-------------------------");
});

on node 0.1.24, ubuntu

No AI_NUMERICSERV on OSX

6e4e228 uses AI_NUMERICSERV which doesn't exist on OSX:

[ 9/17] cxx: src/net.cc -> build/default/src/net_5.o
../src/net.cc:42: error: ‘AI_NUMERICSERV’ was not declared in this scope
../src/net.cc:49: error: ‘AI_NUMERICSERV’ was not declared in this scope
Build failed
-> task failed (err #1):
{task: cxx net.cc -> net_5.o}
make: *** [all] Error 1

Segmentation fault under FreeBSD 8.0

The helloworld.js works fine. But other project like node_chat or benchmarks/static_http_server.js
get this error:
Segmentation fault: 11 (core dumped)

$>uname -a
FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009     [email protected]:/usr/obj/usr/src/sys/GENERIC  i386

$>node -v
0.1.20

$>gdb -c node.core

This GDB was configured as "i386-marcel-freebsd".
Core was generated by `node'.
Program terminated with signal 11, Segmentation fault.
#0  0x080c18cf in ?? ()

http.parseUri is broken

http.parseUri("http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=")

parsedUri = {
  "host": "114&hl=en&src=api&x=2&y=2&z=3&s=",
  "user": "mt0.google.com/vt/lyrs=m",
  "userInfo": "mt0.google.com/vt/lyrs=m",
  "authority": "mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=",
  "protocol": "http",
  "source": "http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=",
  "params": {}
}

Correct parse:
Addressable::URI.parse("http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=").to_hash
# => {
:scheme=>"http",
:user=>nil,
:password=>nil,
:host=>"mt0.google.com",
:port=>nil,
:path=>"/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=",
:query=>nil,
:fragment=>nil
}

make require() override-able

This would be handy for my "kiwi" package management system since I want to take a rubygem-ish approach to the requiring so that it transparently supports modules already in the loadpath, as well as those installed by kiwi

importing and requiring behavior

I'm a bit confused by node's importing and requiring behavior. It's not clear why one must assign functions to a special 'exports' object. This could severely limit a library author's ability to reuse code between the server and client.

In my mind it would be more useful if importing behaved more similarly to Python's importing, where the assumption was that all files in a module are namespaced with the module's name if using 'require' ("import foo" in python) while everything is imported into the current scope if using 'import' ("from foo import *" in python). Of course, this is just in my mind and I don't understand the intricacies of what's happening under node's hood.

require and include do not like files that end in }

The message is
at #.Scaffold
at [object global].[anonymous]
at [object global].[anonymous]
./pubsub.js:83: SyntaxError: Unexpected token }
this.__onLoad = onLoad;};

Adding a ; or something similar fixes the issue.

Test Failure Mac OS 10.6 test/mjsunit/test-tcp-many-clients.js

node-v0.1.24> make test
Waf: Entering directory /Users/taf2/work/captico/node-v0.1.24/build' Waf: Leaving directory/Users/taf2/work/captico/node-v0.1.24/build'
'build' finished successfully (0.254s)
python tools/test.py --mode=release
=== release test-tcp-many-clients ===
Path: mjsunit/test-tcp-many-clients
cccccccccccccccc################................
Command: build/default/node /Users/taf2/work/captico/node-v0.1.24/test/mjsunit/test-tcp-many-clients.js
--- TIMEOUT ---

make: *** [test] Error 1

res.finish() doesn't properly closes the connection when streaming.

Server script is:

var http = require('http');

var server = http.createServer(function(req, res) {
  res.sendHeader(200, {'Content-Type': 'text/plain'});

  var counter = 5;
  setTimeout(function() {

    if (counter--) {  
      res.sendBody("HELLO....\n");
      setTimeout(arguments.callee, 1000);

    } else {
      // should closes the connection
      res.finish();
    }

  }, 1000);
});

server.listen(8000);
//  should fetches 50 bytes of HELLOs

Executing wget 0.0.0.0:8000 should fetch 50 bytes of HELLOs from the server in approximately 5 seconds and then the connection should be closed.

node.http.Client doesn't seem to work on a Mac

Env: Mac 10.5
Example code:

var google = new node.http.Client(80, "google.com");
var req = google.get("/");
req.flush();
req.finish(function (res) {
  puts("STATUS: " + res.statusCode);
  puts("HEADERS: " + JSON.stringify(res.headers));
  res.setBodyEncoding("utf8");
  res.onBody = function (chunk) {
    puts("BODY: " + chunk);
  };
});

Running the http.Client never returns any data, just hangs and a bump in cpu usage is noted.

problem with IPv6?

=== release test-tcp-pingpong ===                             
Path: mjsunit/test-tcp-pingpong
/home/boogie/work/ry-node-a623d763c189749ff8ce1f0cc25225be95686110/test/mjsunit/mjsunit.js:62: Failure: expected <1001> found <0>
  throw new MjsUnitAssertionError(start + " expected <" + expected + "> found 
        ^
socket(): Address family not supported by protocol
socket(): Address family not supported by protocol
Command: build/default/node /home/boogie/work/ry-node-a623d763c189749ff8ce1f0cc25225be95686110/test/mjsunit/test-tcp-pingpong.js
[00:05|% 100|+  17|-   1]: Done                          
make: *** [test] Error 1

Building on OSX is failing.

Currently on OSX configure/building Node.js is failing.

$ ./configure

...

---- deps/udns ----

sh: ./configure: No such file or directory

Configuring deps/udns failed.

...

$ make

...

[7/21] ...

Build failed

-> task failed (err #2):

{task: deps/udns/libudns.a -> libudns.a}

problem running "waf build" on OSX 10.4

Python 2.3.5
tiger-x86 0 ~/projects/node > ./waf build
Traceback (most recent call last):
File "./waf", line 127, in ?
Scripting.prepare(t, cwd, VERSION, wafdir)
File "/Users/ryan/projects/node/.waf-1.5.2-9bdedb7508a3a68a9e2e89a73bed6d5b/wafadmin/Scripting.py", line 12
prepare_impl(t,cwd,ver,wafdir)
File "/Users/ryan/projects/node/.waf-1.5.2-9bdedb7508a3a68a9e2e89a73bed6d5b/wafadmin/Scripting.py", line 11
main()
File "/Users/ryan/projects/node/.waf-1.5.2-9bdedb7508a3a68a9e2e89a73bed6d5b/wafadmin/Scripting.py", line 17
f(bld)
File "/Users/ryan/projects/node/wscript", line 142, in build
native_cc.clone("debug")
File "/Users/ryan/projects/node/.waf-1.5.2-9bdedb7508a3a68a9e2e89a73bed6d5b/wafadmin/TaskGen.py", line 150,
setattr(newobj,x,copy.copy(getattr(self,x)))
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/copy.py", line 108, in copy
return _reconstruct(x, rv, 0)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/copy.py", line 354, in _recons
y = callable(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/copy_reg.py", line 92, in __ne
return cls.new(cls, *args)
TypeError: function() takes at least 2 arguments (0 given)

Writing API Docs for mjsunit

I've noticed that the testing framework that node uses is severly lacking documentation, and I feel that in any solid web platform should have good documentation on how to test it.

ARGV[0] weirdness

Is this the intended behavior for ARGV[0] ?

cibook% which node
/opt/nodejs/bin/node
cibook% node main.js
/Users/atmos/p/irccat-nodejs/node /Users/atmos/p/irccat-nodejs/main.js port username channel

Force header not to be set with node.http.Client get()

Currently if you don't set Transfer-Encoding or Content-Length then Transfer-Encoding gets set to chunked, it would be nice if I could set Transfer-Encoding to null or similar to force it not to be set.

While I was playing with this I also noticed if you set Content-Length-Something it matches Content-Length as being set, probably not going to cause any problems but not sure if there could be better behaviour?

Segfault on helloworld.js with no socket input

This crash is 100% repeatable for me, node 39ca935 on Linux openSUSE 11.1 x86_64:

Start helloworld.js, open a plain TCP socket to it, then close it. Boom - segfault.

http://gist.github.com/273892

I also noticed that the behaviour is the same (although the backtrace is slightly different) if I send some bytes before closing the socket.

No crash if I send data followed by a carriage-return before closing, even if the data is not a valid HTTP request. No subsequent crash on that running instance of helloworld.js even if I open and close sockets without sending any bytes.

waf version

Although WAF was recently upgraded, bin/node-waf still reports version 1.5.9. This produces an error when the file is used to build some external module:
$ node-waf configure build
Error: Version mismatch: waf 1.5.9 <> wafadmin 1.5.10 (wafdir /usr/local/bin/../lib/node)

Bug in require("../foo")

I noticed a bug introduced in ry@3b8e47755a16c72d7b3509685a89c834c42a9342
whereby require("../foo") fails to work. The problem is that paths
like "foo/bar/../baz" get turned into "foobaz" instead of "foo/baz".

Discussion thread here: http://groups.google.com/group/nodejs/browse_thread/thread/34779f8c10098c5e

Isaac Schlueter kindly took my original fix (jasondavies@79efd868c460df001b2602e133e6f3f57c337356) and rewrote it to avoid using regexps and added tests: http://gist.github.com/260278

Create git tag for v0.1.25

It appears that the website & Changelog are offering a v0.1.25, which isn't available as a tag download.

node-waf configure fails

node-waf
Error: Version mismatch: waf 1.5.9 <> wafadmin 1.5.10 (wafdir /Users/taf2/work/builds/bin/../lib/node)

version 0.2.4 and prior 0.2.3

Exceptions don't propagate from addErrback()

not sure about the rest but when you throw the error passed as an arg it does not
seem to propagate out for whatever reason.

This is needed personally because JSpec's assertion lookup routine catches an error then proceeds to try other possible fixture paths

Segmentation Fault when cURL-ing with random method

I could not reproduce this behavior in pure node javascript so I resorted to using curl instead, anyway here's the server code:

require("http").createServer(function(req, resp) {
  resp.sendHeader(200, { "Content-Type": "text/plain" });
  resp.sendBody("ASDF");
  resp.finish();
}).listen(8080);

executing curl -X ASDF 0.0.0.0:8080/abc --verbose then proceeds to crash the server with the following message printed:

Segmentation fault

Here's the relevant lines from curl

> ASDF / HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: 0.0.0.0:8080
> Accept: */*
> 
* Empty reply from server
* Connection # 0 to host 0.0.0.0 left intact
curl: (52) Empty reply from server

Just having a sending a random arbitary method shouldn't be able to crash the server. I couldn't reproduce this in pure JS so didn't take the time to touch the test-http-malformed test file.

I'm using commit 3d24e11

Hope this helps.

Useful stack traces.

I'm not sure if this is really a node problem or a problem of v8, but there don't seem to be useful stack traces. For example, this is all I get for a syntax error:

testInsertedJSCode: SyntaxError: Unexpected string

Posix: A call to wait on mkdir inside a callback from stat appears to deadlock

Whilst experimenting with node.js I (briefly) wanted to do the following:

posix.mkdir("someDir", 0755).wait();

This code seems to work fine when used alone but causes the node.js process to 'hang' when used within the callback of a call to e.g.:

posix.stat("/tmp").addCallback( function(stats) {
sys.puts("BEFORE");
posix.mkdir("/tmp/foo", 0755).wait();
sys.puts("AFTER");
});

Will output 'BEFORE' to the console and then just sit there. It has been suggested on the mailing list that I should raise this as an issue. I appreciate wait shouldn't be used (and it no longer is in my particular code) but its certainly worth drawing attention to this for others :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.