Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Node exiting with errorlevel -1073741819 in with EventEmitter on process. #4256

Closed
tracker1 opened this Issue · 10 comments

4 participants

@tracker1

From what it looks like, it's when you bind EventEmitter to process and do anything asynchronously.

//test.js
require('events').EventEmitter.call(process);
setTimeout(function(){ console.log("done"); }, 100);

From a cmd file...

rem test.cmd
node test.js
echo returned %ERRORLEVEL%

Not sure if this is only in windows, or presents itself on other platforms. This issue presents itself starting with 0.8.13, it wasn't present in 0.8.12

@TooTallNate
require('events').EventEmitter.call(process);

^ why are you doing that? or more precisely, process is already an EventEmitter, so you're probably overwriting some internal state when you do that.

@tracker1

Didn't know it was already an EventEmitter... Was in one of the first pieces of code I'd written in node... was a postbuild script to do less and min/merge css and js files. I was raising critical errors via process.emit('error', ...)

@piscisaureus

This exit code means node crashed with a segmentation fault. I can reproduce it.

What's weird is that it crashes somewhere in the CRT, where it tries to read from (void*) (intptr_t) -1 ...

@tracker1

@piscisaureus, @TooTallNate I'm not really adept enough with C or Node's internals to help much in that regard.. just figured it was a critical issue, and should probably be looked into... was already going to work around it.

@piscisaureus

@tracker1

Actually, I was running into another issue, and I cannot reproduce. Which node version are you using exactly, and are you using the x86 or the x64 version?

@trevnorris
Owner

@piscisaureus

He's using Windows x64, v0.8.14. Also I think he said the problem popped up since v0.8.12.

I also have a seg fault on linux x64 on v0.8.14. I'm going to give a whirl at v0.8.12 and report back.

@trevnorris
Owner

@piscisaureus

Just tested with v0.8.12. No seg fault occurred.

@trevnorris
Owner

The issue comes from changes in lib/events.js between versions v0.8.12 and v0.8.14. At least, when I checkout v0.8.14 and revert lib/events.js to v0.8.12 state, the problem doesn't occur.

@trevnorris
Owner

The seg fault is happening between versions v0.8.12 and v0.8.14 with the following code change:

diff --git a/lib/events.js b/lib/events.js
index 017df75..e0af380 100644
--- a/lib/events.js
+++ b/lib/events.js
@@ -23,7 +23,6 @@ var isArray = Array.isArray;
 var domain;

 function EventEmitter() {
-  this.domain = null;
   if (exports.usingDomains) {
     // if there is an active domain, then attach to it.
     domain = domain || require('domain');             

So, if process is already an EventEmitter then it would make sense that this.domain is already set, but the change assumes otherwise.

@piscisaureus

Thanks for reporting. This will be fixed in node v0.8.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.