Slicer custom app crashing with --testing arg

Using the latest of the SlicerCustomAppTemplate and using a default configuration that uses Qt 5.15.2, I’m experiencing that it always crashes when running with the --testing command line argument. The output is like the following:

PS C:\SA\Slicer-build> ./MyName.exe --testing
libpng warning: iCCP: known incorrect sRGB profile
error: [C:/SA/Slicer-build/bin/Release/MyNameApp-real.exe] exit abnormally - Report the problem.
PS C:\SA\Slicer-build>

I tried using the base Slicer custom app configuration because I was originally running into this issue with my actual customized Slicer custom app that I use. I don’t run into that libpng warning with my real app, but I was experiencing the error of the application crashing when using --testing.

Additional Observations:
What I observe when running my custom application with the --testing command line argument is that the launcher splash screen appears to show and close normally, but it never gets to the splash screen that includes the “Loading modules…” type additional text. Instead it crashes and displays the exit abnormally on the command line.

Debugging Attempts:
This crash with the --testing argument does not seem to happen with a local regular Slicer build and also doesn’t happen with a version of Slicer download from the Slicer website. It seems specific to a Slicer custom application. I tried with Slicer Salt 3.0.0(a Slicer custom app) and did not run into the issue though notably that version is quite old and hasn’t been updated since July 2020.

Questions:
Any thoughts of why it is crashing early in the launcher process? Is this a known issue?

cc: @jcfr and @Sam_Horvath for their expertise with the Slicer Custom App.

For the record this is a ticket about the same problem in the GitHub repo: Python automated tests crash · Issue #23 · KitwareMedical/SlicerCustomAppTemplate · GitHub

Since it may be launcher related, here’s the full output when I use the --launcher-verbose flag.

Launcher verbose output
PS C:\SA\Slicer-build> ./MyName.exe --testing --launcher-verbose
info: AdditionalSettingsFilePath []
info: LauncherSplashImagePath [C:/MyName/Applications/MyNameApp/Resources/Images/SplashScreen.png]
info: LauncherSplashScreenHideDelayMs [3000]
info: ApplicationToLaunch [C:/SA/Slicer-build/bin/Release/MyNameApp-real.exe]
info: ApplicationToLaunchArguments []
info: AdditionalSettingsFilePath []
info: LauncherDir [C:/SA/Slicer-build]
info: LauncherName [MyName]
info: OrganizationDomain [myname.com]
info: OrganizationName []
info: ApplicationName [MyName]
info: ApplicationRevision [30811]
info: SettingsFileName [C:/SA/Slicer-build/./MyNameLauncherSettings.ini]
info: SettingsDir [C:/SA/Slicer-build]
info: UserAdditionalSettingsDir [C:/Users/JamesButler/AppData/Roaming/myname.com]
info: UserAdditionalSettingsFileName []
info: UserAdditionalSettingsFileBaseName []
info: AdditionalSettingsDir []
info: AdditionalSettingsExcludeGroups []
info: LauncherNoSplashScreen [0]
info: AdditionalLauncherHelpShortArgument [-h]
info: AdditionalLauncherHelpLongArgument [--help]
info: AdditionalLauncherNoSplashArguments [--no-splash,--help,--version,--home,--program-path,--no-main-window,--settings-path,--temporary-path]
info: DetachApplicationToLaunch [0]
info: LoadEnvironment [-1]
info: LauncherSplashImagePath [C:/MyName/Applications/MyNameApp/Resources/Images/SplashScreen.png]
info: LauncherSplashScreenHideDelayMs [3000]
info: ApplicationToLaunch [C:/SA/Slicer-build/bin/Release/MyNameApp-real.exe]
info: ApplicationToLaunchArguments []
info: <APPLAUNCHER_DIR> -> [C:/SA/Slicer-build]
info: <APPLAUNCHER_NAME> -> [MyName]
info: <APPLAUNCHER_SETTINGS_DIR> (RegularSettings) -> [C:/SA/Slicer-build]
info: <APPLAUNCHER_SETTINGS_DIR> (UserAdditionalSettings) -> [<APPLAUNCHER_SETTINGS_DIR-NOTFOUND>]
info: <APPLAUNCHER_SETTINGS_DIR> (AdditionalSettings) -> [<APPLAUNCHER_SETTINGS_DIR-NOTFOUND>]
info: <PATHSEP> -> [;]
info: Setting env. variable [PYTHONNOUSERSITE]:1
info: Setting env. variable [PIP_REQUIRE_VIRTUALENV]:0
info: Setting env. variable [SLICER_HOME]:C:/SA/Slicer-build
info: Setting env. variable [ITK_AUTOLOAD_PATH]:C:/SA/Slicer-build/lib/MyName-5.0/ITKFactories/Release
info: Setting env. variable [PYTHONHOME]:C:/SA/python-install
info: Setting env. variable [SSL_CERT_FILE]:C:/SA/Slicer-build/share/MyName-5.0/Slicer.crt
info: Setting env. variable [LibraryPaths]:C:/SA/Slicer-build/bin/Release;C:/Qt/5.15.2/msvc2019_64/bin;C:/SA/Slicer-build/../lib/MyName-5.0/qt-loadable-modules;C:/SA/Slicer-build/../lib/MyName-5.0/qt-loadable-modules/Release;C:/SA/Slicer-build/lib/MyName-5.0/cli-modules/Release;C:/SA/Slicer-build/lib/MyName-5.0/qt-loadable-modules/Release;C:/SA/OpenSSL-install/Release/bin;C:/SA/python-install/bin;C:/SA/tbb-install/tbb2019_20191006oss/bin/intel64/vc14;C:/SA/VTK-build/bin/Release;C:/SA/teem-build/bin/Release;C:/SA/DCMTK-build/bin/Release;C:/SA/ITK-build/bin/Release;C:/SA/CTK-build/CTK-build/bin/Release;C:/SA/CTK-build/PythonQt-build/Release;C:/SA/LibArchive-install/bin;C:/SA/SlicerExecutionModel-build/ModuleDescriptionParser/bin/Release;C:/SA/python-install/Lib/site-packages/numpy/core;C:/SA/python-install/Lib/site-packages/numpy/lib;C:/SA/JsonCpp-build/src/lib_json/Release
info: Setting env. variable [PYTHONPATH]:C:/SA/Slicer-build/bin/Release;C:/SA/Slicer-build/bin/Python;C:/SA/Slicer-build/lib/MyName-5.0/qt-loadable-modules/Release;C:/SA/Slicer-build/lib/MyName-5.0/qt-loadable-modules/Python;C:/SA/Slicer-build/lib/MyName-5.0/qt-scripted-modules;C:/SA/python-install/Lib;C:/SA/python-install/Lib/lib-dynload;C:/SA/python-install/Lib/site-packages;C:/SA/VTK-build/bin/Lib/site-packages;C:/SA/CTK-build/CTK-build/bin/Python;C:/SA/CTK-build/CTK-build/bin/Release
info: Setting env. variable [QT_PLUGIN_PATH]:C:/SA/Slicer-build/bin;C:/SA/CTK-build/CTK-build/bin;C:/Qt/5.15.2/msvc2019_64/plugins
info: Setting env. variable [Path]:C:/SA/Slicer-build/bin/Release;C:/Qt/5.15.2/msvc2019_64/bin;C:/SA/Slicer-build/lib/MyName-5.0/cli-modules/Release;C:/SA/python-install/bin;C:/SA/teem-build/bin/Release;C:/SA/Slicer-build/bin/Release;C:/Qt/5.15.2/msvc2019_64/bin;C:/SA/Slicer-build/../lib/MyName-5.0/qt-loadable-modules;C:/SA/Slicer-build/../lib/MyName-5.0/qt-loadable-modules/Release;C:/SA/Slicer-build/lib/MyName-5.0/cli-modules/Release;C:/SA/Slicer-build/lib/MyName-5.0/qt-loadable-modules/Release;C:/SA/OpenSSL-install/Release/bin;C:/SA/python-install/bin;C:/SA/tbb-install/tbb2019_20191006oss/bin/intel64/vc14;C:/SA/VTK-build/bin/Release;C:/SA/teem-build/bin/Release;C:/SA/DCMTK-build/bin/Release;C:/SA/ITK-build/bin/Release;C:/SA/CTK-build/CTK-build/bin/Release;C:/SA/CTK-build/PythonQt-build/Release;C:/SA/LibArchive-install/bin;C:/SA/SlicerExecutionModel-build/ModuleDescriptionParser/bin/Release;C:/SA/python-install/Lib/site-packages/numpy/core;C:/SA/python-install/Lib/site-packages/numpy/lib;C:/SA/JsonCpp-build/src/lib_json/Release
info: Starting [C:/SA/Slicer-build/bin/Release/MyNameApp-real.exe]
info: argument [--testing]
info: DisableSplash [0]
libpng warning: iCCP: known incorrect sRGB profile
info: launcher-timeout (ms) [-1000]
error: [C:/SA/Slicer-build/bin/Release/MyNameApp-real.exe] exit abnormally - Report the problem.
PS C:\SA\Slicer-build>

Re ^, the launcher appears to crash at the following point below when the process is started to launch the application.


Re ^, this seems weird as the file is actually located at “C:/SA/Slicer-build/MyNameLauncherSettings.ini”.

To me it seems to be the same path. Sometimes artifacts like this ./ may appear during path construction, but it should be still valid.

I also tried using the SlicerCustomAppTemplate to create a custom app that actually still had the same name “Slicer” to see if it was an issue related to the custom name, but it still runs into the same failure with the --testing arg.

PS C:\SA\Slicer-build> ./Slicer.exe --testing
libpng warning: iCCP: known incorrect sRGB profile
error: [C:/SA/Slicer-build/bin/Release/SlicerApp-real.exe] exit abnormally - Report the problem.
PS C:\SA\Slicer-build>

A new default ini file is created for testing (otherwise tests could mess up the actual settings file).

Normal startup:

c:\D\S4R\Slicer-build>Slicer.exe --python-code "print(slicer.app.userSettings().fileName())"
Switch to module:  "Welcome"
Loading Slicer RC file [C:/Users/andra/.slicerrc.py]
C:/Users/andra/AppData/Roaming/NA-MIC/Slicer.ini

Startup in testing mode:

c:\D\S4R\Slicer-build>Slicer.exe --python-code "print(slicer.app.userSettings().fileName())" --testing
Switch to module:  "Welcome"
C:/Users/andra/AppData/Roaming/NA-MIC/Slicer-tmp.ini

I would recommend to build the custom application in debug mode to find out what happens. You can add a 10s sleep or display a popup at application startup to pause the execution until you attach a debugger.

A post was merged into an existing topic: Convert an extension into standalone application