-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
EFAULT, EPIPE errors on Big Sur on Apple Silicon (M1) #36826
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
Comments
Only other mention of this I could find is here: desktop/desktop#11258 which is also from an Electron app. Electron uses node ~12 though. I don't believe it to be isolated to 15. |
Similar error when a file change event restarts tsc compilation (using tsc-watch): (using yarn v2 here, hence the unusual stack trace)
Seems to be the same underlying problem. |
Possibly also related, via the official eslint extension in vscode (I'm not sure if this runs via Electron and its node 12.18.3 or the locally installed node 15.5):
|
(friendly ping @aduh95, noticed some relevant nodejs macOS arm64 commits) |
Sorry I can't really help you there, I haven't experience any of the problems described above 🤷♂️ |
Had to switch to pm2 for automatic restart on my development M1 Mac mini because the EFAULT happens so often. Might even go with cluster mode to ensure there's always and instance up. |
In my initial post I mentioned:
Perhaps we could help figure it out because it's fairly reproducible. It's possible it's a |
One other possibly relevant piece of information. I've seen relatively frequent crashes of various other executables with It seems that the crashes occur more frequently while memory pressure is high and swapping is occuring. I'm not sure if https://openradar.appspot.com/FB8922558 Also potentially relevant is this issue on the Go issue tracker: golang/go#42774 They were able to find a solution for it in golang/go@7f688d1 |
Update: I replaced my 8GB of RAM Mac Mini M1 with a 16GB one and I haven't seen any single crash in a couple of days. In particular I haven't seen any The issue reported in my comment above mentions:
Seems like a macOS bug, but it appears that node could implement a workaround if Apple doesn't fix it: libuv/libuv#3095 (comment) |
+1 to this issue, I'm facing this issue in |
I'm also having a seemingly related issue, with running this program in the background (on an M1 MacBook Pro - 16GB): https://github.com/karlhorky/do-not-disturb-during-zoom-macos Here's the error I get:
I find that it often has happened during sleep / wake cycles, but that could also just be coincidence. |
Wonder if the Big Sur 11.2 update that just appeared will help. Just installed now. |
@karlhorky you're going to have a bad time with 11.2: #37061 |
Ooh looks fancy, thanks for the link! Hopefully don't run into this! In any case, worth it to have Bluetooth working reliably again. |
Same here, long running node script produces this error on M1 Mac mini, Big Sur 11.1 and 11.2 and NodeJS 15.x. Recent crash: Tue Feb 02 2021 08:51:37 GMT+0100 (Mitteleuropäische Normalzeit): no updates detected.
|
I haven't recently seen this error at all, but I upgraded my M1 from an initial 8GB of RAM one, to 16. I have also been using early 11.2 betas, back before nodejs got broken completely in recent RCs (#37061) There was a bug reported in macOS 11.1 on M1 chips that occurs when memory pressure is high, which is much more likely on the 8GB versions. See discussion in: libuv/libuv#3095 (comment) So I think it is relevant to mention which version of the M1 everyone is using: 8GB or 16GB? |
16GB. Updated my post above: #36826 (comment) |
We are facing the same issue. A meteor application after some time is giving the same EFAULT error... being discussed here. |
EFAULT error currently happening in Node.js with Big Sur 11.1: nodejs/node#36826
8GB mac mini which produces this error. |
Increasing the memory limit has helped us immensely. Could it be that Rosetta uses much more memory to do its work? If so, this should help you all for now: #!/bin/bash
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
echo "Meteor: Rosetta2: Limitting memory to 2gb"
export NODE_OPTIONS="--max_old_space_size=2048"
else
echo "Meteor: Native-intel: Limitting memory to 512mb"
export NODE_OPTIONS="--max_old_space_size=512"
fi
your-cmd-here |
Is there someone who was able to fix this issue? |
I was able to get around this issue by adding |
Having the same issue, Macbook Air, m1 ship, 16gp ram. |
I can't reproduce this on macOS 11.4 anymore on 8GB/256GB with the isolated testcase that I got above in #36826 (comment), which reproduced this reliably on macOS 11.2.3. Unless there are or will be reports with this issue occuring on 11.4 setups, I think it's safe to assume that this was fixed in macOS. |
I'm going to close this shortly unless anyone objects. Will reopen if there would be any new cases reported with macOS 11.4 or newer. |
Hi @ChALkeR, I spent the last 2 days with 11.4 and no |
I've been on 11.4 for a couple weeks and haven't had the issue 😄 |
Awesome! I've been on 11.4 for a while also. I'll close this myself. Thanks everyone! |
I am still getting the issue on MacOS 11.4 ... |
events.js:377js Error: read EFAULT |
Same issue with Node:current (16.x.x) on similar Mac configuration. Several memory pressure tests on a route using Error: read EFAULT
at Pipe.onStreamRead (node:internal/stream_base_commons:211:20)
at Pipe.callbackTrampoline (node:internal/async_hooks:130:17)
[ERROR] 17:45:21 Error: read EFAULT Additional note: it seems it crashes only few minutes after the pressure test passed (without errors during the test). |
@vashisth00 @maximelafarie What do you use to reproduce this? |
I'm creating files massively with |
I'm having this issue with M1 Pro Chip since I got the new MacBook Pro 16". Anyone else having the same issue? Did anyone solve it for M1 Pro?
Node version: 14.18.1 (but happens with any version). |
|
@ChALkeR I'm not sure if this is directly related, but just going to add it here. I was recently troubleshooting a node crash inside docker builds on my M1 machine. Run it with: Basically when Docker is configured to the default on Mac (which is maximum 2GB of memory), the If I increase Docker memory to 4GB it builds properly every time. I believe this may be caused by memory pressure. I wasn't able to reproduce it with It could also be a docker bug of some sort, I'm not sure. I tried node 16 and 17 and it occurs on both. There was more discussion on this topic on the Yarn discord here: https://discord.com/channels/226791405589233664/910944274953175082/911221057732636672 |
I'm having this issue with MacBook Pro M1, 2020, 8Gb ram, 2020.
Node version |
@micaiah-effiong could you please share a testcase? Also see #36826 (comment) |
@ChALkeR I'm using Monterrey 12.0.1. Tried node v17.1.0, 16.13.0 and 14.18.1 with no success. The application I'm running is meteor framework and they launched a recent version 2.5.1 compatible with M1 chips, but didn't work anyways too. It doesn't seem to be a framework problem (I suppose). I have no idea how to solve this and it seems to be related to memory usage? Anyways I'm following up with this issue to see if someone shows up with the same issue. I also tried to use nvm and didn't solve my problem too. |
@marcotas Thanks for the OS info! Could you try to reproduce the issue on #36826 (comment)? If it doesn't reproduce, please try adding memory pressure (e.g. via the bottom part of that comment). Also: does the setup with Meteor spawn child processes at all or not? |
I using a macOS Big Sur
|
@micaiah-effiong This was known on 11.1 due to a macOS issue and it was previously thought that it was resolved in macOS 11.4. But there are new reports on 12 above, though I wasn't yet able to reproduce. |
@ChALkeR I wasn't able to reproduce the error with your comment you suggested. Nothing happened at all. It seems to me it's something related to websockets though. Meteor framework uses websockets a LOT so I think this might be the case. I also tried this solution in Safari but it still happening, also tried to use only chrome but didn't change anything. Unfortunately it's not something I'm able to reproduce, because I'm just facing this in a meteor framework application. I'll give any more updates if I figure out something more. |
@marcotas A repo which has some meteor setup triggering this might also help. Preferably without docker or any other extra parts. |
@ChALkeR after updating my MacOS to 12.1 it just stop with this error. I'm not facing this error anymore. It seems it was something on Apple's end. |
@marcotas to me upgrade to 12.1 fixed damn error for a while and then I started to get it again. Problem goes away after I restart my mac. So probably upgrade to 12.1 has nothing to do with problem. It's rather reboot made a difference for you and me. |
Hmm. I still couldn't reproduce this, but i didn't try keeping mac active for a while. @IlyaEremin A few qustions that might help:
|
@IlyaEremin I was facing the same issue sometimes until I figured out that the problem was with the |
@marcotas man.... this is a miracle. I'm using |
try this watchman watch-del-all |
Uh oh!
There was an error while loading. Please reload this page.
What steps will reproduce the bug?
Using node 15.5.0 compiled for arm64.
I'm baffled that I couldn't find anything related to this yet, and I'm not sure whether it's a nodejs bug or something else.
While running nodejs apps that use network or file streams it seems that they very frequently break with errors like EPIPE or EFAULT.
For example, a recent crash:
This also happens quite a lot in the nodejs subsystem used in VSCode: microsoft/vscode#113410 (see various screenshots attached there)
I haven't verified if it happens in Rosetta emulation.
How often does it reproduce? Is there a required condition?
Very often, at least once every 10-60 minutes.
I don't have a specific reproduction, but I've seen it happen when something like
tsc --watch
reinitiates a compilation based on file system changes. It also happens randomly in simple expressjs servers that don't watch the file system, but just keep a connection to a mongodb server.What is the expected behavior?
More stability.
What do you see instead?
Frequent errors.
Additional information
If I can run with some sort of flag that produces an useful crash dump, let me know of the instructions and I'll do it asap.
The text was updated successfully, but these errors were encountered: