Skip to content

electron 18 uses context aware plugin Napi::Addon. Sometimes Devtools reload for electron will lead to render process crash. Is there any way to locate the problem? #1232

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

Closed
Candylong opened this issue Nov 11, 2022 · 12 comments
Labels

Comments

@Candylong
Copy link

electron prompt:
Devtools was disconnected from this page........

Console output:
libc++abi: terminating with uncaught exception of type Napi::Error:
Renderer process crashed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.

@KevinEady
Copy link
Contributor

Hi @Candylong ,

Is it possible to provide some repository / minimal reproduction of your crash? It is difficult to diagnose why you are receiving a crash without knowing which Node API features / functions you are using.

Thanks, Kevin

@Candylong
Copy link
Author

Candylong commented Nov 13, 2022

Hi, @KevinEady ,There is a problematic context here,#1224

@mhdawson
Copy link
Member

Discussed in the Node-api team meeting, can you provide the updated version of the source you are using?

@Candylong
Copy link
Author

hello, @mhdawson ,I used [email protected]

@NickNaso
Copy link
Member

Hi @Candylong I think that @mhdawson asked also for the source code that causes the crash. Is it public? Could you report an example?

@Candylong
Copy link
Author

Candylong commented Nov 30, 2022

Hi, @NickNaso, @mhdawson addon.node uses a third party library called.DLL, which has multiple threads calling back to.node, and then using thread-safe functions, crashes occur in thread-safe functions when loading.node multiple times
image
image

Execute in a thread-safe function
auto jscallback = [=](Napi::Env env, Napi::Function jsCallback)
{
Napi::Object videoFrame = Napi::Object::New(env);
videoFrame .Set("width", Napi::Number::New(env, 1920)); //crash happens
}

@mhdawson
Copy link
Member

mhdawson commented Dec 2, 2022

What we were hoping for is a simple recreate, code that we can run to recreate the crash you were seeing. Is that something you can extract/provide?

@Candylong
Copy link
Author

Candylong commented Dec 3, 2022

@mhdawson , It is in thread-safe functions that an exception is thrown, as shown below, and when a exception occurs, can I use this interface [GetAndClearPendingException] to clear exceptions
image

@Candylong
Copy link
Author

I have arranged my demo and put it here(https://github.com/Candylong/napi-electron-demo). I mainly run it on windows, and it can be reproduced after about 5 operations. Can you have a try

@NickNaso , Hi, I have arranged my demo and put it here(https://github.com/Candylong/napi-electron-demo). I mainly run it on windows, and it can be reproduced after about 5 operations. Can you have a try

@Candylong
Copy link
Author

The relevant questions are as follows,#1244

@gabrielschulhof
Copy link
Contributor

I just tried to run your demo. It says "We are using Node.js 18.12.1, Chromium 110.0.5481.208, and Electron 23.2.2.", and it doesn not crash.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2023

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

@github-actions github-actions bot added the stale label Jul 8, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants