-
Notifications
You must be signed in to change notification settings - Fork 7.3k
test: Incorrect end event callback invocation on socket #16805
Comments
How did you generate "heavy stress in the network - more read/writes over the ports"? If you have some code that reproduces that, it would allow more people to jump in and help fixing this. Also, does it happen with node v0.10, or just with node v0.12? Thank you! |
Here are the steps:
2.an input file whose content is being ping-ponged. I used a file with 100KB of junk characters. Not attaching here due it its size as well as being trivial to produce. 3.run.sh - the invocation script, which invokes this code as many times as required, in parallel. First argument indicates the instance count, and the second one, a base port number to start with. I used 40 as count and 20000 as starting port. If the 'stress' proves to be insufficient, the count value can be increased.
I am able to reproduce this both in 0.10 and 0.12 lines. Hope this helps. |
Thank you @gireeshpunathil for the detailed information 👍 I was actually able to reproduce the test failing without doing anything else than running it several times sequentially. |
How to debug .cc files? |
@saquibkhan You can use a debugger like gdb, lldb or Visual C++'s debugger. |
Hi, On running node with --abort-on-uncaught-exception option I got Exception: Illegal Instruction 4 On searching for this problem, which is specific to OS X i found the issue is because of mmacosx-version-min=10.5. I tried changing it to mmacosx-version-min=10.6 and mmacosx-version-min=10.7 but that didn’t help Am i missing something here? References: |
@saquibkhan Are you referring to the same problem? I don't think the link you mentioned are related to this specific issue, but I may be missing something. |
Yes I am referring to the same problem. See below: Uncaught Error: child died unexpectedly! Uncaught Error: [c] closing by accident! id: 6388 FROM Uncaught Error: child died unexpectedly! FROM |
The Illegal Instruction message usually means that there may be some binary which has invalid CPU instruction. This could be due to various reasons, few are below:
What is your opinion? are you able to see Illegal Instruction 4 ? |
@saquibkhan I can't reproduce the illegal instruction. I still believe it's a separate problem: this issue is about timing issues/race conditions in the code responsible for passing handles between processes, whereas the illegal instruction problem seems to be related to the Could you please see if you can reproduce this with a simple program that only throws an error, like Thank you! |
If you use below shell script you should see Illegal Instruction 4: x=100 |
@saquibkhan I still can't reproduce the illegal instruction. node dumps core, but I don't get the |
I was curious because i get Illegal Instruction 4 intermittently with the crash mentioned in this issue. NOTE: This is happening on OS X Yosemite 10.10.2 my logs on running ⮀ node ⮀ v0.12 + ⮀ sh run.sh 15 FROM FROM FROM FROM |
After debugging more, my analysis so far:
|
Hi, I found that there were 2 other scripts which were giving same issue on running multiple times I went back till changes done on _May 14 2012 commit: dceebbf_ and where above two scripts were added with relevant changes I could see the same issue when you run either of the above two test scripts multiple times. log1:
log2:
Note: I also traced back when test/simple/test-child-process-fork-getconnections.js was added _Jan 18 2013 commit: db5ee0b_ and i could see the same issue back then when running the script multiple times. |
Hi, in the above script I changed sockets[m.id].destroy(); to sockets[m.id].end(); Please find the backtrace below:
|
Hi, I am seeing this problem on my development machine (iMac from 2008 running OS 10.10.3). Best, |
On OSX we were seeing failures in the Node test
test-child-process-fork-getconnections.js
This is only reproducible under heavy stress in
the network - more read/writes over the ports.
throw new Error('[c] closing by accident!');
^
Error: [c] closing by accident!
at Socket. (test/simple/test-child-process-fork-getconnections.js:39:17)
at Socket.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
test/simple/test-child-process-fork-getconnections.js:57
throw new Error('child died unexpectedly!');
^
Error: child died unexpectedly!
at ChildProcess. (test/simple/test-child-process-fork-getconnections.js:57:13)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
12 clients connect to a server, the sockets passed to a forked child,
and each of the sockets are closed, through a message passing between
the parent and child. child registers a call back on 'end' event of the
socket which should have never called because the sockets are destroyed
directly, but due to unknown reason, this end call back is fired causing
this issue.
Whatever be the race condition is, it is causing the socket to be closed
before they are destroyed, and thereby the end callback is triggered.
The text was updated successfully, but these errors were encountered: