Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upsrc,worker: display remaining handles if `uv_loop_close` fails #21238
Conversation
addaleax
added
the
worker
label
Jun 9, 2018
addaleax
requested a review
from
danbev
Jun 9, 2018
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
C++
lib / src
labels
Jun 9, 2018
This comment has been minimized.
This comment has been minimized.
addaleax
added
the
work in progress (WIP)
label
Jun 10, 2018
addaleax
force-pushed the
addaleax:worker-handle-leaks
branch
from
197b8c3
to
542e4a4
Jun 10, 2018
TimothyGu
approved these changes
Jun 10, 2018
This comment has been minimized.
This comment has been minimized.
|
LGTM when the testing issues get ironed out. |
jasnell
approved these changes
Jun 10, 2018
devsnek
approved these changes
Jun 10, 2018
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Some failures in Alpine Linux on CI. Re-run: https://ci.nodejs.org/job/node-test-pull-request/15385/ |
This comment has been minimized.
This comment has been minimized.
|
Same failures again on Alpine. 20:55:58 not ok 2114 abort/test-addon-uv-handle-leak
20:55:58 ---
20:55:58 duration_ms: 0.955
20:55:58 severity: fail
20:55:58 exitcode: 1
20:55:58 stack: |-
20:55:58 assert.js:270
20:55:58 throw err;
20:55:58 ^
20:55:58
20:55:58 AssertionError [ERR_ASSERTION]: uv loop at [0x562f2861e130] has active handles
20:55:58 [0x562f286a6080] timer
20:55:58 Close callback: 0x7f99924f80f0
20:55:58 Data: 0x7f99926f9060
20:55:58 [0x562f286ba640] timer
20:55:58 Close callback: 0x7f99924f80f0
20:55:58 Data: 0
20:55:58 [0x562f286ba700] timer
20:55:58 Close callback: 0x7f99924f80f0
20:55:58 Data: 0x42
20:55:58 /home/iojs/build/workspace/node-test-commit-linux/nodes/alpine-latest-x64/out/Release/node[4614]: ../src/debug_utils.cc:219:void node::CheckedUvLoopClose(uv_loop_t*): Assertion `0 && "uv_loop_close() while having open handles"' failed.
20:55:58
20:55:58 at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux/nodes/alpine-latest-x64/test/abort/test-addon-uv-handle-leak.js:53:5)
20:55:58 at Module._compile (internal/modules/cjs/loader.js:702:30)
20:55:58 at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
20:55:58 at Module.load (internal/modules/cjs/loader.js:612:32)
20:55:58 at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
20:55:58 at Function.Module._load (internal/modules/cjs/loader.js:543:3)
20:55:58 at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
20:55:58 at startup (internal/bootstrap/node.js:267:19)
20:55:58 at bootstrapNodeJSCore (internal/bootstrap/node.js:600:3)
20:55:58 ... |
This comment has been minimized.
This comment has been minimized.
|
Yeah, this is still |
bnoordhuis
approved these changes
Jun 11, 2018
|
Apropos checking for musl libc, it's complicated... You can check
It's easier to check if That's not strictly correct (all alpine is musl but not all musl is alpine) but it's much less brittle. |
| public: | ||
| Win32SymbolDebuggingContext() { | ||
| current_process_ = GetCurrentProcess(); | ||
| (void)SymInitialize(current_process_, nullptr, true); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| bool IsMapped(void* address) override { | ||
| void* page_aligned = reinterpret_cast<void*>( | ||
| // NOLINTNEXTLINE(whitespace/operators) | ||
| reinterpret_cast<uintptr_t>(address) &~ (pagesize_ - 1)); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
addaleax
Jun 11, 2018
Author
Member
I’m getting a déjà vu with that review comment … &~ for masking operations
| void* page_aligned = reinterpret_cast<void*>( | ||
| // NOLINTNEXTLINE(whitespace/operators) | ||
| reinterpret_cast<uintptr_t>(address) &~ (pagesize_ - 1)); | ||
| return msync(page_aligned, pagesize_, 0) == 0; |
This comment has been minimized.
This comment has been minimized.
bnoordhuis
Jun 11, 2018
Member
I'm surprised this works; passing in no flags is technically an error (they're non-zero on linux and macos.)
This comment has been minimized.
This comment has been minimized.
addaleax
Jun 11, 2018
Author
Member
@bnoordhuis I guess this could be made MS_ASYNC? Reading the Linux man page, it seems like that’s how Linux interprets 0 anyway …
I’m switching and seeing how that fares in CI.
addaleax
added some commits
Jun 7, 2018
addaleax
force-pushed the
addaleax:worker-handle-leaks
branch
from
42efda4
to
24e7701
Jun 11, 2018
This comment has been minimized.
This comment has been minimized.
|
I’ve tried the CI: https://ci.nodejs.org/job/node-test-commit/19160/ (Edit: 15 green |
addaleax commentedJun 9, 2018
This is refactoring our native stack trace code, and adding support for a better error message when a
uv_loop_close()for a worker fails because there are still active handles.Example output in that case (taken from test failures on the current
canarybranch while looking into nodejs/node-v8#66):As opposed to the previous error message:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes