-
Notifications
You must be signed in to change notification settings - Fork 30k
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
async-hooks/test-fseventwrap - Flaky on AIX #13577
Comments
@nodejs/platform-aix |
/cc @nodejs/async_hooks |
Recreated (intermittent) the crash in the compiler:
|
Still a thing... https://ci.nodejs.org/job/node-test-commit-aix/6522/nodes=aix61-ppc64/console not ok 13 async-hooks/test-fseventwrap
---
duration_ms: 0.173
severity: crashed
stack: |-
oh no!
exit code: CRASHED (Signal: 11) |
there are three mutually exclusive issues:
Debugging item 3. at the moment. |
Why would only this test fail when there are other tests that check directory watch. |
@trevnorris - this test did not fail due to (1) above (yet) - the test progress is masked off by the crash |
The other test files that check directory watch should already be skipped for AIX. |
Ah yup. I see the |
Failing instruction corresponds to string_table_.LookupOrInsert
r23 is I verified that the object was proper after the construction, looks like later its fields were overlaid by this pattern:
Pattern |
Just got the same error - https://ci.nodejs.org/job/node-test-commit-aix/6559/nodes=aix61-ppc64/console |
Again today: https://ci.nodejs.org/job/node-test-commit-aix/6663/nodes=aix61-ppc64/console not ok 13 async-hooks/test-fseventwrap
---
duration_ms: 0.183
severity: crashed
stack: |-
oh no!
exit code: CRASHED (Signal: 11) |
Watching directories has limited support on AIX. This is documented. Watch a file in test/async-hooks/test-fseventwrap.js to accommodate AIX. Refs: nodejs#13577 (comment)
Watching directories has limited support on AIX. This is documented. Watch a file in test/async-hooks/test-fseventwrap.js to accommodate AIX. PR-URL: #13766 Ref: #13577 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Watching directories has limited support on AIX. This is documented. Watch a file in test/async-hooks/test-fseventwrap.js to accommodate AIX. PR-URL: #13766 Ref: #13577 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Watching directories has limited support on AIX. This is documented. Watch a file in test/async-hooks/test-fseventwrap.js to accommodate AIX. PR-URL: #13766 Ref: #13577 (comment) Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
reduced test case that crashes occasionally in AIX: const fs = require('fs')
const watcher = fs.watch(__dirname, () => {})
watcher.close()
console.log('done') The Debugging further. |
Even with single-thread, memory corruption seem to be a hard thing to crack. At the end of a number of attempts, DEBUGMALLOC finally reported a bad free on a pointer which it never allocated into, at uv__fs_event_close:
|
In uv__path_is_a_directory the variable |
@gireeshpunathil What does |
This one resolves the issue consistently. I ran it a 3K times, and saw no failures. diff --git a/deps/uv/src/unix/aix.c b/deps/uv/src/unix/aix.c
index 388c9cc..6314096 100644
--- a/deps/uv/src/unix/aix.c
+++ b/deps/uv/src/unix/aix.c
@@ -855,6 +855,7 @@ int uv_fs_event_start(uv_fs_event_t* handle,
uv__io_init(&handle->event_watcher, uv__ahafs_event, fd);
handle->path = uv__strdup(filename);
handle->cb = cb;
+ handle->dir_filename = NULL;
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
@@ -874,8 +875,10 @@ int uv_fs_event_stop(uv_fs_event_t* handle) {
uv__handle_stop(handle);
if (uv__path_is_a_directory(handle->path) == 0) {
- uv__free(handle->dir_filename);
- handle->dir_filename = NULL;
+ if (handle->dir_filename != NULL) {
+ uv__free(handle->dir_filename);
+ handle->dir_filename = NULL;
+ }
}
uv__free(handle->path); Leaving it for a while for some review and then come up with a PR. |
@bnoordhuis - I overwrote the core file. (will get it once again.) |
@gireeshpunathil |
@bnoordhuis - Looks like the values are optimized out in the release build. Does the raw offsets reveal / confirm anything?
Thanks for the info on the uv__free. So that means the only change is the initializer for the uninitialized field. |
In AIX, fs watch close call was corrupting memory in the compiler. The handle->dir_filename field can be un-initialized, if the watch is initiated but not event got fired. But the uv_fs_event_stop was freeing this pointer as if it was malloc'ed, leading to the crash. Properly initialize handle-dir_filename to avoid a garbage pointer. Fixes: nodejs#13577
item no. 3 is being addressed through libuv PR 1400 |
|
Looks like test-fseventwrap fails intermitently on AIX:
https://ci.nodejs.org/job/node-test-commit-aix/nodes=aix61-ppc64/6463/console
I believe I've seen it on at least one other PR unrelated to fswatch/asyncwrap.
@gireeshpunathil can you take a look.
The text was updated successfully, but these errors were encountered: