# Slicer custom app crashing with --testing arg

**URL:** <https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209>\
**Category:** Development\
**Created:** [April 30, 2022, 11:25pm UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209 "2022-04-30T23:25:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [April 30, 2022, 11:25pm UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/1 "2022-04-30T23:25:09Z")

</div>

Using the latest of the [SlicerCustomAppTemplate](https://github.com/KitwareMedical/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:

```auto
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](http://salt.slicer.org/download/)(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.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 2, 2022, 9:07am UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/2 "2022-05-02T09:07:39Z")

</div>

For the record this is a ticket about the same problem in the GitHub repo: [Python automated tests crash · Issue #23 · KitwareMedical/SlicerCustomAppTemplate · GitHub](https://github.com/KitwareMedical/SlicerCustomAppTemplate/issues/23)

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [May 2, 2022, 1:25pm UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/3 "2022-05-02T13:25:46Z")

</div>

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

> **Launcher verbose output**
>
> ```auto
> 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>
> 
> ```

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [May 2, 2022, 6:30pm UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/4 "2022-05-02T18:30:43Z")

</div>

> [@jamesobutler](#):
>
> ```auto
> info: launcher-timeout (ms) [-1000]
> error: [C:/SA/Slicer-build/bin/Release/MyNameApp-real.exe] exit abnormally - Report the problem.
> 
> ```

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

> <https://github.com/commontk/AppLauncher/blob/7e87d4cf58c27d5d54477a9c22e2962714923f8b/Base/ctkAppLauncher.cpp#L696-L698>

* * *

> [@jamesobutler](#):
>
> `info: SettingsFileName [C:/SA/Slicer-build/./MyNameLauncherSettings.ini]`

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

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 3, 2022, 8:38am UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/5 "2022-05-03T08:38:14Z")

</div>

> [@jamesobutler](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [May 3, 2022, 12:51pm UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/6 "2022-05-03T12:51:49Z")

</div>

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.

```auto
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>

```

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 11, 2022, 6:49pm UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/7 "2022-05-11T18:49:05Z")

</div>

> [@jamesobutler](#):
>
> > [@jamesobutler](#):
> >
> > `info: SettingsFileName [C:/SA/Slicer-build/./MyNameLauncherSettings.ini]`
> 
> Re ^, this seems weird as the file is actually located at “C:/SA/Slicer-build/MyNameLauncherSettings.ini”.

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

Normal startup:

```auto
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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 12, 2022, 2:27am UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/8 "2022-05-12T02:27:54Z")

</div>

A post was merged into an existing topic: [Convert an extension into standalone application](https://discourse.slicer.org/t/convert-an-extension-into-standalone-application/23371/4)

---

<div class="post-metadata">

**Author:** ![hansmoda](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hansmoda/32/79453_2.png) [@hansmoda](https://discourse.slicer.org/u/hansmoda)\
**Post date:** [July 11, 2025, 2:52am UTC](https://discourse.slicer.org/t/slicer-custom-app-crashing-with-testing-arg/23209/11 "2025-07-11T02:52:20Z")

</div>

I also used slicerCustomAppTemplate and used same Qt version in windows. when I use ctest it will failed by the same reason.  
_error: [D:/DSI/slicer-build/bin/Release/CustomTestingApp-real.exe] exit abnormally - Report the problem._  
Is there a solution to this? We look forward to hearing from you.
