Crash when initializing app built and run from Ubuntu 20.04

Operating system: Ubuntu 20.04.1 LTS
Slicer version: [v4.11]
Expected behavior: To load Slicer
Actual behavior: Failed Loading Slicer

I finally succeeded in building Slicer, but the software is not loading. I have no clue what the error is.

This is the message I get:

atabak@atabak-X550JX:~/Slicer/Slicer-SuperBuild-Debug/Slicer-build$ ./Slicer
error: [/home/atabak/Slicer/Slicer-SuperBuild-Debug/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.

Slicer-4.10.2 is almost two years old. I would recommend the latest Slicer master for any developments.

I’m not an experienced linux developer, but managed to build and run it a few days ago without any issues on Ubuntu 20.04 just by closely following the build instructions.

Hi Andras,

Thank you for your response. I mistyped the version. I’ve built the latest version (i.e. Slicer-4.11). I had some problems building it on ubuntu 18 and got some qt randomgenerator errors and I saw in some forum that ubuntu 20 surpassed that problem. So, I built the whole thing on ubuntu 20. but, I still couldn’t load Slicer.

I did run the following command to see what’s going on

./Slicer --launcher-verbose

I only found that there is some missing directory for the following:

info: <APPLAUNCHER_SETTINGS_DIR> (UserAdditionalSettings) → [<APPLAUNCHER_SETTINGS_DIR-NOTFOUND>]
info: <APPLAUNCHER_SETTINGS_DIR> (AdditionalSettings) → [<APPLAUNCHER_SETTINGS_DIR-NOTFOUND>]

I’m have no idea what the problem could be. I even spent hours browising through these forums but only found this https://github.com/Slicer/Slicer/issues/5000
which is somewhat similar but not totally.

AdditionalSettings are options. It is not a problem that they are not found.

Output of ./Slicer --launcher-verbose for me is the following:

info: AdditionalSettingsFilePath []
info: LauncherSplashImagePath [/home/osboxes/D/Slicer/Applications/SlicerApp/Resources/Images/Slicer-SplashScreen.png]
info: LauncherSplashScreenHideDelayMs [3000]
info: ApplicationToLaunch [/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/bin/./SlicerApp-real]
info: ApplicationToLaunchArguments []
info: AdditionalSettingsFilePath []
info: LauncherDir [/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build]
info: LauncherName [Slicer]
info: OrganizationDomain [www.na-mic.org]
info: OrganizationName [NA-MIC]
info: ApplicationName [Slicer]
info: ApplicationRevision [29321]
info: SettingsFileName [/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/./SlicerLauncherSettings.ini]
info: SettingsDir [/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build]
info: UserAdditionalSettingsDir [/home/osboxes/.config/NA-MIC]
info: UserAdditionalSettingsFileName [/home/osboxes/.config/NA-MIC/Slicer-29321.ini]
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 [/home/osboxes/D/Slicer/Applications/SlicerApp/Resources/Images/Slicer-SplashScreen.png]
info: LauncherSplashScreenHideDelayMs [3000]
info: ApplicationToLaunch [/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/bin/./SlicerApp-real]
info: ApplicationToLaunchArguments []
info: <APPLAUNCHER_DIR> -> [/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build]
info: <APPLAUNCHER_NAME> -> [Slicer]
info: <APPLAUNCHER_SETTINGS_DIR> (RegularSettings) -> [/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build]
info: <APPLAUNCHER_SETTINGS_DIR> (UserAdditionalSettings) -> [/home/osboxes/.config/NA-MIC]
info: <APPLAUNCHER_SETTINGS_DIR> (AdditionalSettings) -> [<APPLAUNCHER_SETTINGS_DIR-NOTFOUND>]
info: <PATHSEP> -> [:]
info: Setting env. variable [SLICER_HOME]:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build
info: Setting env. variable [PIP_REQUIRE_VIRTUALENV]:0
info: Setting env. variable [ITK_AUTOLOAD_PATH]:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/lib/Slicer-4.11/ITKFactories/.
info: Setting env. variable [PYTHONNOUSERSITE]:1
info: Setting env. variable [PYTHONHOME]:/home/osboxes/D/Slicer-SuperBuild-Release/python-install
info: Setting env. variable [SSL_CERT_FILE]:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/share/Slicer-4.11/Slicer.crt
info: Setting env. variable [LD_LIBRARY_PATH]:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/bin/.:../lib/Slicer-4.11/qt-loadable-modules:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/lib/Slicer-4.11/cli-modules/.:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/lib/Slicer-4.11/qt-loadable-modules/.:/home/osboxes/D/Slicer-SuperBuild-Release/OpenSSL:/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib:/home/osboxes/D/Slicer-SuperBuild-Release/VTK-build/lib/.:/home/osboxes/D/Slicer-SuperBuild-Release/teem-build/bin/.:/home/osboxes/D/Slicer-SuperBuild-Release/DCMTK-build/lib/.:/home/osboxes/D/Slicer-SuperBuild-Release/ITK-build/lib/.:/home/osboxes/D/Slicer-SuperBuild-Release/CTK-build/CTK-build/bin/.:/home/osboxes/D/Slicer-SuperBuild-Release/CTK-build/QtTesting-build/.:/home/osboxes/D/Slicer-SuperBuild-Release/CTK-build/PythonQt-build/.:/home/osboxes/D/Slicer-SuperBuild-Release/LibArchive-install/lib:/home/osboxes/D/Slicer-SuperBuild-Release/SimpleITK-build/SimpleITK-build/lib/.:/home/osboxes/D/Slicer-SuperBuild-Release/SlicerExecutionModel-build/ModuleDescriptionParser/bin/.:/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/site-packages/numpy/core:/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/site-packages/numpy/lib:/home/osboxes/D/Slicer-SuperBuild-Release/JsonCpp-build/src/lib_json/.
info: Setting env. variable [PATH]:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/bin/.:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/lib/Slicer-4.11/cli-modules/.:/home/osboxes/D/Slicer-SuperBuild-Release/python-install/bin:/home/osboxes/D/Slicer-SuperBuild-Release/teem-build/bin/.
info: Setting env. variable [QT_PLUGIN_PATH]:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/bin:/home/osboxes/D/Slicer-SuperBuild-Release/CTK-build/CTK-build/bin:/usr/lib/plugins
info: Setting env. variable [PYTHONPATH]:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/bin/.:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/bin/Python:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/lib/Slicer-4.11/qt-loadable-modules/.:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/lib/Slicer-4.11/qt-loadable-modules/Python:/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/lib/Slicer-4.11/qt-scripted-modules:/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6:/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/lib-dynload:/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/site-packages:/home/osboxes/D/Slicer-SuperBuild-Release/VTK-build/lib/python3.6/site-packages:/home/osboxes/D/Slicer-SuperBuild-Release/CTK-build/CTK-build/bin/Python:/home/osboxes/D/Slicer-SuperBuild-Release/CTK-build/CTK-build/bin/.
info: Starting [/home/osboxes/D/Slicer-SuperBuild-Release/Slicer-build/bin/./SlicerApp-real]
info: launcher-timeout (ms) [-1000]
info: DisableSplash [0]
Switch to module:  "Welcome"

Do you see any difference compared to yours?

I’ve just use this Ubuntu 20.04 image on virtualbox: https://www.osboxes.org/ubuntu/
Is your computer a physical linux computer that you use for other developments, too?

Can you run a simple OpenGL application, such as glxgears?

Yes I can run a simple OpenGL application, such as glmark2 (as demonstrated in the image below)

There are some differences between your output and mine:

These are yours:

info: ApplicationRevision [29321]
info: <APPLAUNCHER_SETTINGS_DIR> (UserAdditionalSettings) -> [/home/osboxes/.config/NA-MIC]

These are mine:

info: ApplicationRevision [29335]
info: <APPLAUNCHER_SETTINGS_DIR> (UserAdditionalSettings) -> [<APPLAUNCHER_SETTINGS_DIR-NOTFOUND>]

These are the only 2 differences that I found.

And, yes I have my Linux installed on my SSD. I use Windows 10 on the oracle VM virtual box though.

Can you get a stack trace of the crash?

Yes, the following was generated in my syslog:

Aug 31 13:54:20 atabak-X550JX gnome-shell[2071]: Window manager warning: Invalid WM_TRANSIENT_FOR window 0x3a00004 specified for 0x3a00002.

Aug 31 13:54:21 atabak-X550JX kernel: [22784.692296] SlicerApp-real[30426]: segfault at 0 ip 00007f8421bfe9ee sp 00007ffd48fbe448 error 4 in libc-2.31.so[7f8421a9d000+178000]

Aug 31 13:54:21 atabak-X550JX kernel: [22784.692302] Code: 0f 84 fd fe ff ff e9 91 81 f3 ff 90 f3 0f 1e fa 89 f8 31 d2 c5 c5 ef ff 09 f0 25 ff 0f 00 00 3d 80 0f 00 00 0f 8f 52 03 00 00 fe 6f 0f c5 f5 74 06 c5 fd da c1 c5 fd 74 c7 c5 fd d7 c8 85 c9

Knowing that the crash occurred in libc is not very useful. Can you get a stack trace? This may help: https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/Debug_Instructions#Analyze_a_segmentation_fault

I’ve tried to start Slicer in gdb on Linux by following these instructions, I get the error below. When I try to debug using VS Code, I get the same error.

osboxes@osboxes:~/D/Slicer-SuperBuild-Release/Slicer-build$ ./Slicer --launch /usr/bin/gnome-terminal
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
  File "/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/site.py", line 553, in <module>
    main()
  File "/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/site.py", line 539, in main
    known_paths = addusersitepackages(known_paths)
  File "/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/site.py", line 282, in addusersitepackages
    user_site = getusersitepackages()
  File "/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/site.py", line 258, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/site.py", line 248, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/sysconfig.py", line 601, in get_config_var
    return get_config_vars().get(name)
  File "/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/sysconfig.py", line 550, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/home/osboxes/D/Slicer-SuperBuild-Release/python-install/lib/python3.6/sysconfig.py", line 421, in _init_posix
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata__linux_x86_64-linux-gnu'

@jcfr Do you know how to fix this?

I did as you asked and I got the same error as you have!

atabak@atabak-X550JX:~/Slicer/Slicer-SuperBuild-Debug/Slicer-build$ ./Slicer --launch /usr/bin/gnome-terminal
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File “/home/atabak/Slicer/Slicer-SuperBuild-Debug/python-install/lib/python3.6/site.py”, line 553, in
main()
File “/home/atabak/Slicer/Slicer-SuperBuild-Debug/python-install/lib/python3.6/site.py”, line 539, in main
known_paths = addusersitepackages(known_paths)
File “/home/atabak/Slicer/Slicer-SuperBuild-Debug/python-install/lib/python3.6/site.py”, line 282, in addusersitepackages
user_site = getusersitepackages()
File “/home/atabak/Slicer/Slicer-SuperBuild-Debug/python-install/lib/python3.6/site.py”, line 258, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File “/home/atabak/Slicer/Slicer-SuperBuild-Debug/python-install/lib/python3.6/site.py”, line 248, in getuserbase
USER_BASE = get_config_var(‘userbase’)
File “/home/atabak/Slicer/Slicer-SuperBuild-Debug/python-install/lib/python3.6/sysconfig.py”, line 601, in get_config_var
return get_config_vars().get(name)
File “/home/atabak/Slicer/Slicer-SuperBuild-Debug/python-install/lib/python3.6/sysconfig.py”, line 550, in get_config_vars
_init_posix(_CONFIG_VARS)
File “/home/atabak/Slicer/Slicer-SuperBuild-Debug/python-install/lib/python3.6/sysconfig.py”, line 421, in _init_posix
_temp = import(name, globals(), locals(), [‘build_time_vars’], 0)
ModuleNotFoundError: No module named ‘_sysconfigdata__linux_x86_64-linux-gnu’

Until @jcfr gets back to us with a solution for gdb, you can use systemd for getting the stack trace.

I often get debugging hints by running SlicerApp-real with strace to see the last system calls before it dies. You can start with Slicer --xterm and run it in that shell so you have the environment.

I have also recently built on ubuntu 20.04 with no problems.

I think this is what you were after. I’m not sure though. Is this it?

OpenSSL error, as usual… There have been lots of problems with OpenSLL, especially on Linux. Search for error reports on this topic on this forum and the Slicer issue tracker (both are indexed in Google), and try the proposed solutions.

The error occurred while executing an avx2 instruction. Is it possible that your computer does not support __strcmp_avx2 instruction? (not very likely, as then the error should have been invalid instruction, but just in case) How old is your computer? What CPU does it have?

My Laptop is about 6 years old. This is the processor:
Intel® Core™ i7-4720HQ CPU @ 2.60GHz × 8

That CPU already supports avx2 (https://ark.intel.com/content/www/us/en/ark/products/78934/intel-core-i7-4720hq-processor-6m-cache-up-to-3-60-ghz.html) so the instruction set should not be an issue.

So, most likely it is one of the other OpenSSL related problems that others have reported before.

Do the official Slicer builds run well?

By “official” if you mean the user one. yes I used to work with that 4 months ago. But I need the “Developer”.
or by “official Slicer build” you mean the complete slicer-developer build explained here : https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/linux.html

Yes after upgrading my linux to ubuntu 20 it worked very well.

I hope I answered your question.

So, packages that you get from download.slicer.org work well, but that you build yourself crash on startup? Have you built in debug or release mode?

Yes those worked very well. And, yes after a successful build of the “developer” in ubuntu 20 I get a crash in the startup when I try to load Slicer.

No, I haven’t built in the debug or release mode. Will that solve my problem stated in the beginning of this thread? I think you are trying to point out that it might be a hard-ware problem. Correct?

You always build in “Debug” or “Release” (or “DebWithRelInfo” or “MinSizeRel”) configuration. If you don’t specify build mode then I think the default is “Debug” (more verbose debug information but slower execution time).

Your CPU is quite old but it should still be able to build and run Slicer, so it is not a hardware problem.

I did a quick search. There used to be such errors at startup but they have all been fixed. Are you using the latest master version? What is your linux kernel, Qt, OpenSSL, and gcc compiler versions? (you may find some version information in your build log of top-level CMakeCache.txt file)

Hi Andras,

I am sorry for the late response. I came to a conclusion yesterday that upgrading my ubuntu from 18 to 20 wasn’t a good idea and I decided to build Ubuntu 20 from scratch. And, I successfully built the Slicer-Developer without any errors.

FYI, all the versions of Qt, etc that you asked were based on this instruction:

https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/linux.html

So for other users out there, I would suggest not to upgrade their Linux- ubuntu version from 18 to 20 for the purpose of building Slicer cause they won’t be able to load the software itself, probably because of the versions of qt and other necessary softwares that are required for the build.

cd Slicer-SuperBuild-Debug/Slicer-build
ctest -j4

There is one more point that I want to mention. When I tried to test Slicer in ubuntu 20 that was upgraded from ubuntu 18 with the instruction mentioned above I had about 240 tests failed out of 680. But in ubuntu 20 that I installed from scratch, I only had 9 tests failed out of 680!

Andras - Thank you for your help throughout the troubleshooting. Your guidance was the main reason I got the intuition to reinstall ubuntu 20 from scratch.

Cheers,
Atabak

1 Like