-
Notifications
You must be signed in to change notification settings - Fork 1k
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
StubExecutable crashes on update / uninstall #1500
Comments
@Glebka Nice research! I'm sure a PR would be much appreciated. |
…of NULL. Related to Squirrel#1500
@Thieum I've posted a PR, please review |
This reminds me of #1355 - perhaps it's related? |
I think, that given that we understand the underlying issue, this fix could be improved, we're kind of paving over the actual issue instead of just fixing the cause. The correct fix is either:
|
Squirrel version(s)
1.9.1
Description
AppName_ExecutionStub.exe
crashes during autoupdate / uninstall of our Electron app.More details in
Additional information
section.Steps to recreate
Trigger update of Electron App from older to newer version.
Expected behavior
AppName_ExecutionStub.exe
should not crash. It should exit with some error code, for example-1
.Actual behavior
AppName_ExecutionStub.exe
crashes with core dump generation.Additional information
This happens because installer treats
AppName_ExecutionStub.exe
as a Squirrel Aware app and starts executing hooks on it (calling it with additional command line arguments such as "--squirrel-updated 19.6.1-beta").Well, actually,
AppName_ExecutionStub.exe
is Squirrel Awarebecause during the release build process Squirrel copies resources from the main app to the StubExecutable.
Squirrel.Windows/src/Update/Program.cs
Line 634 in bdfcd72
When StubExecutable starts, it tries to find the main executable and run it with passed arguments. In this particular case installer calls StubExecutable that is already located in
AppData/Local/AppName/app-VERSION
, thus it fails to find main executable.I collected a core dump of the StubExecutable. So here some variable values ad call stack that reflects the state of executable when it crashed:
Variables
Call stack
I found here
Squirrel.Windows/src/StubExecutable/StubExecutable.cpp
Line 43 in bdfcd72
that
FindLatestAppDir()
may return NULL in some cases, but defined return type isstd::wstring
. That is the root cause of the crash. I think we need to replace NULL with emptystd::wstring
. I can create a PR later for this.The text was updated successfully, but these errors were encountered: