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
[Bug]: After v18, an app using requestSingleInstanceLock() will crash if a lower version also starts. #33566
Comments
@rooklift what is the use case where you are running into this? eg why would two different versions of the same application be running? |
Rather niche circumstances I suppose - I could accept things not being compatible, but it really shouldn't crash imo... The actual reason I ran into this was that I tend to develop using the latest Electron version (i.e. I just run Still, I'm sure there are other circumstances where someone could run into this. Electron is very flexible after all, so the idea of someone having 2 different versions of something installed isn't very far-fetched. |
#34139 should probably resolve this issue. |
Tested in 18.2.2, which I think includes that fix? It still crashes. |
@rooklift Do you happen to have a dmp file or stack trace of the crash that's occurring? I'm curious whether or not it's also happening on the check for |
Just to be clear (forgive me if this is an unneeded clarification), it's not happening when the v18 app calls
As for dump files, I'm afraid I don't know how to create those (well, I can dump memory via the task manager, but I don't know how to read them...) |
Oh no worries, I appreciate being as clear as possible! 🙂 Sorry for not specifying this too - you should be able to generate a crash dump by adding the following snippet to your main process code, before app.whenReady:
If you then reproduce the crash, zip up the crash dumps directory and attach it here. I'm not entirely sure if this sort of main process crash will produce a dump file, to be honest, just trying to find more information on where in the call to the single instance lock it's actually crashing. I'm trying to reproduce this on my end now as well. |
Hmm I tried it but no significant files were produced at the location. |
We actually can repro this (thanks @dsanders11!) Repro steps below, I'm looking into it now and will report back. Thanks for trying to generate a dmp file! Repro Steps:
|
Here's a minimal gist repro: https://gist.github.com/dsanders11/72c74ab34e2832c3c272602d2570661b The only thing added to the default Fiddle is explicitly setting As @VerteDinde said, load the gist in two Fiddle windows, run one on v18 first and the other on v17. In my testing once starting the second one on v17, the v18 app becomes immediately unresponsive, but doesn't hard crash. |
I'm seeing something similar when moving from 18.2.0 -> 18.2.2, not sure if this is the same issue you are seeing or not. Basically when it happened the update just finished installing (via Squirrel.Windows) and the app was about to prompt to restart. But instead the window froze and it's contents went blank. It seemed like the main process may have crashed based on what one of my other team members said there were 2 processes instead of the normal 3 running. I'm not sure which one was gone but based on what a few people said here I'm guessing it was the main process. Sentry reported this stack trace:
|
Seeing the same issue going from 18.2.2 -> 18.2.4, the conditions are the same. Auto update just finished installing then hard lock. Interestingly the window's render process seems to be still refreshing but you can't interact with the window. This time the processes expected were all there but one was listed as "not responding" by windows which appeared to be the renderer as it's title in the task manager seemed to indicate that. Perhaps this hang is related to #34297?
|
Preflight Checklist
Electron Version
18.0.2
What operating system are you using?
Windows
Operating System Version
Windows 10 version 21H2
What arch are you using?
x64
Last Known Working Electron version
17.3.1
Expected Behavior
requestSingleInstanceLock()
should not cause crashes when using different versions of Electron.Actual Behavior
When an app is built with Electron 18, if it uses
requestSingleInstanceLock()
and an older version attempts to start, the v18 app crashes in the Main process.To reproduce:
requestSingleInstanceLock()
At this point (on Windows 10 at least) a crash will occur in the Main process of v18, likely leading to an unresponsive window.
Testcase Gist URL
https://github.com/rooklift/electron_lock_test
The text was updated successfully, but these errors were encountered: