Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to force the occurance of a problem. #1083

Closed
martinheidegger opened this issue Jan 28, 2018 · 6 comments
Closed

How to force the occurance of a problem. #1083

martinheidegger opened this issue Jan 28, 2018 · 6 comments

Comments

@martinheidegger
Copy link

I am hunting down a tricky error in Node.js's core for Win. Its about the following lines:

https://github.com/nodejs/node/blob/02fef8ad5a6c0e5c1ce0d4b46aa3a762935c981c/lib/internal/child_process.js#L571-L579

target._send({ cmd: 'NODE_HANDLE_ACK' }, null, true);
var obj = handleConversion[message.type];

// Update simultaneous accepts on Windows
if (process.platform === 'win32') {
  handle._simultaneousAccepts = false;
  net._setSimultaneousAccepts(handle);
}

it seems that under the right circumstances ._send( might trigger the closing of the handle which then later lets net._setSimultaneousAccepts throw a memory access error (in c-code: triggering a hard-close of node)

That behavior has been hard for me to reproduce so I wonder: How could I force trigger the error in a simple example, worthy of an issue to the node repository.

@addaleax
Copy link
Member

How frequently does that problem occur? Enough to get it to fail in a C/C++ debugger after a couple attempts?

@martinheidegger
Copy link
Author

Hmm, yes : in a complex system. I have a test case failing constantly but only if the whole of the suite is run - not some single test. Which made it hard to triangulate. Not sure how to attach a C/C++ debugger to the node process (not a windows person; not a c person)

@addaleax
Copy link
Member

I have a test case failing constantly but only if the whole of the suite is run - not some single test.

That’s interesting. How are you running the single test? Using python tools/test.py <path-to-test> or node <path-to-test>? What happens if you use something like python tools/test.py --repeat=1000 -j 16 to push up load on your machine?

Not sure how to attach a C/C++ debugger to the node process (not a windows person; not a c person)

If you’re using VSCode, there are some things you can look up to make that happen.

@martinheidegger
Copy link
Author

It's the spectron testcase of an dat-desktop. Tbh. It had been kinda rough to track the issue - also because I use a Mac - which is why I thought the opposite road: trying to dump a socket during ACK might be easier to reproduce, pinpoint and test... I will need to look at it more in the office

@gireeshpunathil
Copy link
Member

@martinheidegger - is this still outstanding?

@gireeshpunathil
Copy link
Member

inactive, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants