Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

connect + pause + resume = assertion failure #3118

Closed
jcmf opened this issue Apr 15, 2012 · 4 comments
Closed

connect + pause + resume = assertion failure #3118

jcmf opened this issue Apr 15, 2012 · 4 comments
Assignees
Labels
Milestone

Comments

@jcmf
Copy link

jcmf commented Apr 15, 2012

% node -v
v0.6.15
% uname -a
Darwin toastbook.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:48:32 PST 2012; root:xnu-1699.24.23~1/RELEASE_I386 i386
% node -e 'c = require("net").connect(1234, "localhost"); c.pause(); c.resume()'
Assertion failed: (stream->fd >= 0), function uv__read_start_common, file src/unix/stream.c, line 937.
zsh: abort      node -e 'c = require("net").connect(1234, "localhost"); c.pause(); c.resume()

Happens every time for me, during the resume(). Note that it doesn't seem to matter what I try to connect to, or whether anything is listening there. Originally discovered this under 0.6.14 where the symptoms are identical (though the line number is off by 3).

@bnoordhuis
Copy link
Member

Confirmed, will fix. Thanks for the bug report.

@ghost ghost assigned bnoordhuis Apr 15, 2012
@isaacs isaacs closed this as completed in 8d5c120 Jun 16, 2012
@isaacs
Copy link

isaacs commented Jun 16, 2012

Landed on 8d5c120. Thanks!

@skomski
Copy link

skomski commented Jun 16, 2012

@isaacs JFYI I didn't create a pull request because I am not sure if my fix is the best solution. #3402 is about the same issue and contains maybe better solutions like fixing it directly in libuv.

@isaacs
Copy link

isaacs commented Jun 17, 2012

Yeah, it caused problems for Windows, so @piscisaureus reverted it.

@piscisaureus piscisaureus reopened this Jun 18, 2012
@isaacs isaacs closed this as completed in de65ba7 Jun 18, 2012
isaacs added a commit that referenced this issue Jun 19, 2012
* npm: Upgrade to 1.1.29
- Improved 'npm init'
- Fix the 'cb never called' error from 'oudated' and 'update'
- Add --save-bundle|-B config
- Fix isaacs/npm#2465: Make npm script and windows shims cygwin-aware
- Fix isaacs/npm#2452 Use --save(-dev|-optional) in npm rm
- `logstream` option to replace removed `logfd` (Rod Vagg)
- Read default descriptions from README.md files

* Shims to support deprecated ev_* and eio_* methods (Ben Noordhuis)

* #3118 net.Socket: Delay pause/resume until after connect (isaacs)

* #3465 Add ./configure --no-ifaddrs flag (isaacs)

* child_process: add .stdin stream to forks (Fedor Indutny)

* build: fix `make install DESTDIR=/path` (Ben Noordhuis)

* tls: fix off-by-one error in renegotiation check (Ben Noordhuis)

* crypto: Fix diffie-hellman key generation UTF-8 errors (Fedor Indutny)

* node: change the constructor name of process from EventEmitter to process (Andreas Madsen)

* net: Prevent property access throws during close (Reid Burke)

* querystring: improved speed and code cleanup (Felix Böhm)

* sunos: fix assertion errors breaking fs.watch() (Fedor Indutny)

* unix: stat: detect sub-second changes (Ben Noordhuis)

* add stat() based file watcher (Ben Noordhuis)
isaacs added a commit that referenced this issue Jun 19, 2012
* npm: Upgrade to 1.1.30
  - Improved 'npm init'
  - Fix the 'cb never called' error from 'oudated' and 'update'
  - Add --save-bundle|-B config
  - Fix isaacs/npm#2465: Make npm script and windows shims cygwin-aware
  - Fix isaacs/npm#2452 Use --save(-dev|-optional) in npm rm
  - `logstream` option to replace removed `logfd` (Rod Vagg)
  - Read default descriptions from README.md files

* Shims to support deprecated ev_* and eio_* methods (Ben Noordhuis)

* #3118 net.Socket: Delay pause/resume until after connect (isaacs)

* #3465 Add ./configure --no-ifaddrs flag (isaacs)

* child_process: add .stdin stream to forks (Fedor Indutny)

* build: fix `make install DESTDIR=/path` (Ben Noordhuis)

* tls: fix off-by-one error in renegotiation check (Ben Noordhuis)

* crypto: Fix diffie-hellman key generation UTF-8 errors (Fedor Indutny)

* node: change the constructor name of process from EventEmitter to process (Andreas Madsen)

* net: Prevent property access throws during close (Reid Burke)

* querystring: improved speed and code cleanup (Felix Böhm)

* sunos: fix assertion errors breaking fs.watch() (Fedor Indutny)

* unix: stat: detect sub-second changes (Ben Noordhuis)

* add stat() based file watcher (Ben Noordhuis)
@piscisaureus piscisaureus reopened this Aug 3, 2012
piscisaureus added a commit that referenced this issue Aug 3, 2012
Calling resume() on a net connection for which the IP address is still
being resolved crashes node with an assertion error inside libuv.
Calling pause() before the socket is connected doesn't crash, but it
doesn't work either. This patch fixes it.

Ref: #3118
piscisaureus added a commit that referenced this issue Aug 3, 2012
This fixes the problem that calling pause() on a socket would not
actually prevent 'data' events from being emitted. It also replaces
the existing test by a more elaborate one.

Ref: #3118
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants