-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Strange errors, segfaults when upgrading from v6.9.1 to v7.0.0 #9419
Comments
The segfault mentions |
I wouldn't know, but I don't think so. I don't think it would fit in with the "impossible bug" scenario I described, since the program I wrote runs all in one process (although it is started with With yarn (and the logs I included for it), npm seems to be segfaulting only after node (I'm assuming the test runner) segfaults, from what I'm seeing in the logs, which I think would make sense, unless that is a bug within itself. |
I think the |
|
|
@SEAPUNK That is more than reasonable – if you want to email it to me, that would be anna@addaleax.net. I don’t think we really have some kind of real collaborator-only storage for things like this… I mean, there’s the security email address and everything, but that obviously serves a different purpose. |
Yeah, I'm uploading the file to my web server, I'll email you the link to the download when it's uploaded. |
@SEAPUNK Awesome… I couldn’t really make out any problem is from just looking at the code location mentioned in the stack traces, but I assume having at least the register and/or stack content available will be helpful. If you want to take the time, you could also try to run the process under valgrind… it’s slow but if the source of this is some kind of memory corruption, it might turn out to be pretty useful. |
@addaleax Emailed. Running valgrind in the meantime. |
Valgrind's got node to the part of running the |
Valgrind output: https://gist.github.com/SEAPUNK/012420b1128019cc96c197f8cb84bdeb Did not segfault. |
Yeah, that might just be because it’s so slow… sigh. I’m in our weekly conference call rn, but from what I could make out from the core dump, it does look like some kind of memory corruption. I’ll keep you updated if and when I find out more |
Alright, cool. I'll use v6.9.1 in the meantime. |
Can you try to run the failing script with passing the |
/cc @nodejs/v8 |
Yeah, it segfaults. Here's the ZIP (100+MB uncompressed): https://media.sq10.net/xtremebike/__node_trace_ic.zip |
@SEAPUNK I am unable to repro on either linux or mac (I think you're on linux). I would be interested in looking at the core-dump too, if you can provide me the link. |
I already deleted the coredump, but I can see if I can repro it on my laptop (different computer, but same OS) Where should I email it to? |
ofrobots-at-google.com |
Yeah, I can't reproduce on my laptop. I'll play around some more and see if I can trigger some issue, otherwise I'll recreate a coredump tomorrow. |
Oh! It coredumped! I had to run the test a few times to get it to do that. Zipping and uploading. |
Emailed. |
Will try to reproduce it on OS X |
FYI, the coredump seems to happen more frequently when nothing else is using up the resources (particularly CPU) |
No crash on mac so far, running it in the loop. |
No crashes 😢 @SEAPUNK do you think you could try to install lldb and /~https://github.com/nodejs/llnode on that machine? |
It doesn't seem to be working correctly. I have lldb version 3.9 installed, and after |
No prob. 👍 |
Seems like v8 bug, indeed. cc @ofrobots |
@indutny From the core dump, I could tell that I had no luck finding out where that value came from, though. |
@SEAPUNK can you confirm that your node binary is the one you downloaded from http://nodejs.org/dist/v7.0.0/node-v7.0.0-linux-x64.tar.xz? I can't symbolize the core dump. Perhaps this is because my because my Linux system is a bit too different (I don't have an Arch linux box.) While the core doesn't give me proper backtrace or symbols, I can corroborate what @addaleax is observing. The |
fwiw, my inspection was based on the binary from the tarball you linked (with gdb on Ubuntu 16.04) |
I don't think my environment is special. Standard Linux kernel, standard core packages, etc... I might be able to provide an Arch VM. I'm setting one up right now; I'll see if I can securely tunnel the SSH to the outside world. |
I'm having trouble reproducing the issue on the VM and the laptop I created again. Sigh. The only machine I know is more-or-less consistently coredumping is the one I have at work; I'll generate and upload a coredump from that machine. |
Coredump and the binaries I used to run the tests with: http://files.sq10.net/node7coredump/ This time I'll make it public just because. Commands used: git clone ssh://git@github.com/yarnpkg/yarn
cd yarn
git checkout ebe899382fdb70222651380f299737c6625d87e4
wget https://nodejs.org/dist/v7.0.0/node-v7.0.0-linux-x64.tar.xz
tar xvf node-v7.0.0-linux-x64.tar.xz
yarn # I had node 7, npm 3.10.9, yarn 0.16.1 already globally installed w/ `sudo npm install -g yarn`
./node-v7.0.0-linux-x64/bin/node ./node-v7.0.0-linux-x64/bin/npm run build
./node-v7.0.0-linux-x64/bin/node node_modules/.bin/jest --coverage --verbose /cc @ofrobots |
Tests of /~https://github.com/electron-userland/electron-builder often failed with this error (https://circleci.com/gh/electron-userland/electron-builder/285) on macOS and Linux (I cannot say about Windows because nodejs 6 is used (to test that it is definitely NodeJS 7 issue)). Not always, but often. |
I was able to get a few segfaults out of the Arch Linux VM after changing the CPU cores from 1 to 4, but they were different in the sense of:
|
Anyways, I think I have the VM ready for external use; be sure to let me know (and give me an email to send the login to) if you want to access the VM, even though the segfaults are definitely different and seemingly unusable in lldb. |
I think you get bonus point for that. ;) (Sending you my SSH public key) |
So, what I’ve found out so far:
<details> tag in order not to spam the issue so you may have to click to see it): |
@addaleax this assembly code looks like an internal instance-of check for optimized code. |
Okay, so, I think I tracked things down as well as I can. Reproducing the bug was pretty easy, cloning yarn into a directory with a sufficiently long path name and running the above test suffices: mkdir /tmp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
cd /tmp/a* && git clone /~https://github.com/yarnpkg/yarn.git && cd yarn
npm install
node ./node_modules/.bin/jest -i __tests__/commands/remove.js # segfaults The segfault always occurs reliably by dereferencing The value seems to be read from some structure from code that looks like this:
Judging from that, it looks like it’s trying to access a field in a V8
I have no idea how it ended up there. Bisecting V8, v8/v8@2fec36d seems to be the offending commit, and reverting it makes everything pass without problems. /cc @nodejs/v8 |
I think that was fixed by commit v8/v8@c56222c. |
@bnoordhuis Sorry, doesn’t look like it. I did also try yesterday’s V8 |
I can reproduce with the latest node+v8 lkgr integration build as well. Opened upstream bug http://crbug.com/v8/5616. |
I also have strange SIGSEGV errors. But I found dependencies. I use WebStorm. I have code with async/await and global try/catch (it's oncetime script to execute). And when I run it without debug, I have this errors. Because I have error in my code. But my catch-block not catches errors (console.error is not executed). But when I run code with debugging, I can caught this exception and my catch-block is executed and I can see the exception in my logs with console.error. |
Merging #9640 to this issue as a duplicate. Latest update from @targos:
|
Does the update to V8 5.5 mean this issue is fixed now? |
Might be. I'll have to check it out later. |
I think the issue is fixed for me w/ 7.6+; if nobody else is having the issue I was having, then I think this can be closed. |
I'm not completely sure yet whether this is a v8 issue or a packaging issue w/ Arch Linux yet, but all I know is that when I install and use v7.0.0, I start getting weird errors, bugs and segfaults that I've never seen before with v6.9.1.
For example, one of the programs that I run had an impossible bug: It randomly left out some information that it's guaranteed to include when generating a feed. This bug has never happened before, and when I run it again, that time it just throws an error that it never threw before, something to do with accessing a missing property. When I switched back to v6.9.1, it starts working again just fine.
One consistent case I was able to find was cloning the yarn repo, and running tests on it. It gives me a segfault almost consistently at pretty much the same place, with the difference of npm sometimes segfaulting along with node in the journalctl logs: https://gist.github.com/SEAPUNK/652768e792f6f32bc8777230bc740a92
Again, switching back to v6.9.1 makes it work just fine.
I can't pinpoint the issue, but I'm pretty sure it's something to do with v8, or how nodejs was packaged for Arch Linux.
The text was updated successfully, but these errors were encountered: