-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Linux: nsfw
watcher crashes when inotify
limit reached
#131957
Comments
nsfw
watcher crashes when inotify limit reachednsfw
watcher crashes when inotify
limit reached
Root issue is similar to #111288 and #106399 Lets try building the native module with |
|
Issue is different from originally thought to be #131957 (comment) JS callback from nsfw https://github.com/Axosoft/nsfw/blob/e8a6e953b5ec4ed09b1e73cea944fcfc6149ea3e/src/NSFW.cpp#L272 can throw via https://github.com/nodejs/node-addon-api/blob/da2e754a021e418a3ca36f3c10ea134c9541959f/napi-inl.h#L2217-L2225 because the default JS error callback throws https://github.com/Axosoft/nsfw/blob/e8a6e953b5ec4ed09b1e73cea944fcfc6149ea3e/js/src/index.js#L63 leading to the above crash. There are couple of fixes for this,
diff --git a/src/NSFW.cpp b/src/NSFW.cpp
index abd0bb0..d83e5b3 100644
--- a/src/NSFW.cpp
+++ b/src/NSFW.cpp
@@ -269,7 +269,11 @@ void NSFW::pollForEvents() {
const std::string &error = mInterface->getError();
mErrorCallback.NonBlockingCall([error](Napi::Env env, Napi::Function jsCallback) {
Napi::Value jsError = Napi::Error::New(env, error).Value();
- jsCallback.Call({ jsError });
+ try {
+ jsCallback.Call({ jsError });
+ } catch (const Napi::Error& e) {
+ e.ThrowAsJavaScriptException();
+ }
});
mRunning = false;
break; |
I can try upstreaming 2) in the next debt week but 1) should unblock us for #132483 |
1 works 👍 |
Steps:
/etc/sysctl.conf
by addingfs.inotify.max_user_watches=4096
.code-workspace
that has more than 1 large folder in it (so thatnsfw
is used), e.g. openvscode
I am positive this used to work in a way that we could catch the error and show it to the user via this code:
vscode/src/vs/platform/files/node/watcher/nsfw/nsfwWatcherService.ts
Lines 53 to 63 in ee1655a
But that is no longer the case it seems.
The text was updated successfully, but these errors were encountered: