-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Update Node to 8.10.0 and npm to 5.7.1. #9725
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
Conversation
|
Oof, those test failures are mid-test segmentation faults, so this is definitely going to require some additional investigation. |
b1f8621 to
dee83b1
Compare
|
Some findings. I was able to reproduce the segmentation fault locally by running Of course, the segfault error message isn't very useful by itself, so what I really needed was to run the tests with a debug build of Node 8.10.0, and hopefully examine the core dump. In order to get Node to write core dump files, you have to run ulimit -c unlimitedor else What about running a debug build of Node? When you run /path/to/dev_bundle/bin/node --expose-gc /Users/ben/meteor/tools/index.js self-testso (after building Node with --debug) I simply ran /path/to/src/node/node_g --expose-gc /Users/ben/meteor/tools/index.js self-testOnce the tests failed, I used ~/meteor% lldb /Users/ben/src/node/node_g -c /cores/core.7819
(lldb) target create "/Users/ben/src/node/node_g" --core "/cores/core.7819"
Core file '/cores/core.7819' (x86_64) was loaded.
(lldb) bt
* thread #1, stop reason = signal SIGSTOP
* frame #0: 0x0000131b7ff5dd9c
frame #1: 0x0000131b7fd04259
frame #2: 0x0000131b7fd04101
frame #3: 0x0000000100e05d4b node_g`v8::internal::(anonymous namespace)::Invoke(isolate=0x0000000106000000, is_construct=false, target=Handle<v8::internal::Object> @ 0x00007ffeefbf4fd0, receiver=Handle<v8::internal::Object> @ 0x00007ffeefbf4fc8, argc=0, args=0x0000000000000000, new_target=Handle<v8::internal::Object> @ 0x00007ffeefbf4fc0, message_handling=kReport) at execution.cc:145
frame #4: 0x0000000100e05694 node_g`v8::internal::(anonymous namespace)::CallInternal(isolate=0x0000000106000000, callable=Handle<v8::internal::Object> @ 0x00007ffeefbf5080, receiver=Handle<v8::internal::Object> @ 0x00007ffeefbf5078, argc=0, argv=0x0000000000000000, message_handling=kReport) at execution.cc:181
frame #5: 0x0000000100e05556 node_g`v8::internal::Execution::Call(isolate=0x0000000106000000, callable=Handle<v8::internal::Object> @ 0x00007ffeefbf50d0, receiver=Handle<v8::internal::Object> @ 0x00007ffeefbf50c8, argc=0, argv=0x0000000000000000) at execution.cc:191
frame #6: 0x00000001004a8e8e node_g`v8::Function::Call(this=0x000000010580c8a0, context=(val_ = 0x0000000106045d08), recv=(val_ = 0x000000010580c380), argc=0, argv=0x0000000000000000) at api.cc:5330
frame #7: 0x00000001004a8ff1 node_g`v8::Function::Call(this=0x000000010580c8a0, recv=(val_ = 0x000000010580c380), argc=0, argv=0x0000000000000000) at api.cc:5339
frame #8: 0x000000010173098f node_g`node::InternalCallbackScope::Close(this=0x00007ffeefbf53f0) at node.cc:1469
frame #9: 0x0000000101730e46 node_g`node::InternalMakeCallback(env=0x00007ffeefbfdbb0, recv=(val_ = 0x00000001068335c0), callback=(val_ = 0x0000000106045cf8), argc=2, argv=0x00007ffeefbf55f0, asyncContext=(async_id = 36389, trigger_async_id = 0)) at node.cc:1499
frame #10: 0x00000001016f535d node_g`node::AsyncWrap::MakeCallback(this=0x0000000104b1e2c0, cb=(val_ = 0x0000000106045cf8), argc=2, argv=0x00007ffeefbf55f0) at async_wrap.cc:769
frame #11: 0x00000001016fef57 node_g`node::AsyncWrap::MakeCallback(this=0x0000000104b1e2c0, symbol=(val_ = 0x00000001060479a8), argc=2, argv=0x00007ffeefbf55f0) at async_wrap-inl.h:54
frame #12: 0x000000010182288b node_g`node::(anonymous namespace)::ProcessWrap::OnExit(handle=0x0000000104b1e310, exit_status=0, term_signal=15) at process_wrap.cc:304
frame #13: 0x0000000101a51b94 node_g`uv__chld(handle=0x0000000102a08080, signum=20) at process.c:109
frame #14: 0x0000000101a5302a node_g`uv__signal_event(loop=0x0000000102a07d60, w=0x0000000102a08040, events=1) at signal.c:459
frame #15: 0x0000000101a646d9 node_g`uv__io_poll(loop=0x0000000102a07d60, timeout=0) at kqueue.c:349
frame #16: 0x0000000101a44aef node_g`uv_run(loop=0x0000000102a07d60, mode=UV_RUN_DEFAULT) at core.c:368
frame #17: 0x0000000101751b4a node_g`node::Start(isolate=0x0000000106000000, isolate_data=0x00007ffeefbfe290, argc=3, argv=0x0000000104d001d0, exec_argc=1, exec_argv=0x0000000104d002d0) at node.cc:4782
frame #18: 0x000000010174122c node_g`node::Start(event_loop=0x0000000102a07d60, argc=3, argv=0x0000000104d001d0, exec_argc=1, exec_argv=0x0000000104d002d0) at node.cc:4849
frame #19: 0x00000001017408e0 node_g`node::Start(argc=3, argv=0x0000000104d001d0) at node.cc:4906
frame #20: 0x00000001017d898e node_g`main(argc=4, argv=0x00007ffeefbfeb88) at node_main.cc:106
frame #21: 0x0000000100001634 node_g`start + 52Unfortunately, as far as I can tell, this is just a stack trace for the Fortunately, it's possible to run Node and Meteor from within after the process has started, as early as possible (before the crash happens). The trick is to set a breakpoint on the ~/meteor% lldb /Users/ben/src/node/node_g
(lldb) target create "/Users/ben/src/node/node_g"
Current executable set to '/Users/ben/src/node/node_g' (x86_64).
(lldb) br s -n main
Breakpoint 1: where = node_g`main + 38 at node_main.cc:104, address = 0x00000001017d8956
(lldb) process handle SIGSEGV --notify true --pass true --stop true
error: No current process; cannot handle signals until you have a valid process.
(lldb) run --expose-gc /Users/ben/meteor/tools/index.js self-test autoupdate
Process 14725 launched: '/Users/ben/src/node/node_g' (x86_64)
Process 14725 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001017d8956 node_g`main(argc=5, argv=0x00007ffeefbfeaa0) at node_main.cc:104
101 #endif
102 // Disable stdio buffering, it interacts poorly with printf()
103 // calls elsewhere in the program (e.g., any logging from V8.)
-> 104 setvbuf(stdout, nullptr, _IONBF, 0);
105 setvbuf(stderr, nullptr, _IONBF, 0);
106 return node::Start(argc, argv);
107 }
Target 0: (node_g) stopped.
(lldb) process handle SIGSEGV --notify true --pass true --stop true
NAME PASS STOP NOTIFY
=========== ===== ===== ======
SIGSEGV true true true
(lldb) c
Process 14725 resumingUnfortunately, I haven't been able to reproduce the crash while running under Sorry that's a bit anti-climactic. We'll have to keep digging. |
|
Other people including myself are experiencing this issue with node.js 8.10 as well See nodejs/node#19274 and RocketChat/Rocket.Chat#10060 for details, looks like V8 issue? |
|
Just as an update: I currently have a Each build from source takes quite some time, and there are a number of Node.js releases in that range that just will not build, but there are currently 19 revisions remaining. 😄 🤞 |
|
I experienced this issue too. My Meteor 1.6.1 app was running on now with v8.10.0 by mistake and crashed every few minutes without an error message. See jkrup/meteor-now#101. |
|
After working through a number of transitional non-buildable commits in the Node source bisection, my These 22 commits translate almost exactly to commits which appeared in the V8 upgrade to 6.2 which occurred in nodejs/node#16413. That PRs commit hashes landed in the Unfortunately, I think this means that the problem is related to the way that V8 6.2 landed in Node v8.10.0 (not to be confused with V8). It's yet to be determined if that's because of a change in V8 that will cause us problems or because of incorrect application of the V8 updates to the Node source (V8 upgrades are intentionally grafted in a somewhat piecemeal manner onto the Node.js source, which maintains its own copy of V8). This will require further investigation, but we are working on this. |
dee83b1 to
64dbd6f
Compare
|
I’ve just finished manually bisecting tagged V8 revisions between 6.1.534 (the version used by Node 8.9.4) and 6.2.414 (the version used by Node 8.10.0), a range that spans 948 commits. At each step I ran tools/release/update_node.py /Users/ben/src/v8 /Users/ben/src/nodeto copy the V8 source code into my Node repository, which I first reset to I then built the resulting Node code using Ninja, which is considerably faster than ./configure --ninja
ninja -C out/ReleaseEspecially in the beginning, many of these builds would fail because the V8 revision I had copied was in some weird limbo between working commits, but I gradually built up a script that git cherry-pick <revision> --strategy=recursive -X theirsProvided the cd /path/to/meteor/dev_bundle/lib
../../meteor npm rebuild --build-from-sourceI then ran meteor self-test --file '^[a-c]'to see if I could reproduce the segmentation fault, which occurred reliably during the This bisection had to be manual because I was only considering tagged V8 commits, in an attempt to reduce the chances that a commit chosen automatically by As you can see from those notes, the problem appears to have been introduced between V8 versions 6.2.27 and 6.2.270. That's good news! Bad news: there are 539 commits between those tags, which is more than half of the original 948 commits. So where does that leave us? I will continue bisecting this range using the following command: ~/src/v8% git bisect start 6.2.270~1 6.2.27~1
Bisecting: 268 revisions left to test after this (roughly 8 steps)
[744b901d414be2b38a1053f498da3b711d97d2ca] [heap] Implement write barrier in code stub assemblyShould be fun! |
|
And here it is! Now we need to develop a theory as to why v8/v8@ea0e1e2 introduces this problem, or at least find something upstream that further refines/fixes this logic. My theory: if I can think of several ways to mitigate this problem, but we need to confirm that's what's happening before we try to implement any solutions. |
|
The commit message on v8/v8@ea0e1e2 indicates that it was meant to fix a bug originally introduced in v8/v8@e15f554, but that commit was actually reverted by v8/v8@a193fde. I may be misreading the commit history, but if that follow-up commit is still in place, but the code which introduced the bug it was fixing was reverted, then v8/v8@ea0e1e2 should have also been reverted, but I don't see that ever happening — up until and including the current state of What appears like another attempt to re-land the changes originally committed in v8/v8@e15f554 showed up in v8/v8@a01ac7c however that too was reverted in v8/v8@3138850. Honestly, I think the change in v8/v8@ea0e1e2 should have been reverted, at least at the point and time we're at on V8, barring any future updates to V8 that made it acceptable. Looking at the commit, it appears to have been moved outside an |
|
I can confirm that reverting v8/v8@ea0e1e2 starting from the |
|
Oh geez, I just realized why there were so many commits between 6.2.27 and 6.2.270… the release tags were sorted lexicographically here, even though they should be interpreted numerically, like any reasonable versioning system. 🤦♂️ Update: the problem was actually introduced between 6.2.145 and 6.2.146, a range that only contains 42 commits. Updated nodejs/node#19274 (comment) to remove any confusion about this mistake. |
|
We're going to jump to Node 8.11.1 instead of 8.10.0, because of the segmentation fault problem. New PR for updating |
Fairly self-explanatory, though there are a number of notable changes, since it's been a while since either of these projects released a new version: