SlicerRT built from source cannot start

I’ve built Slicer and then SlicerRT from source several times in the past. I followed the online instructions.

In the same computer, I recently updated (via git pull) the Slicer and SlicerRT repositories to master, and then rebuilt from scratch.

The build of Slicer works fine, and I can start Slicer-build/Slicer without problems. The GUI shows perfectly fine, both directly within the computer as well as via ssh -X.

If I call directly /home/user/builds/build-Slicer_src-Desktop-Debug/Slicer-build/bin/SlicerApp-real that works fine, too.

The build of SlicerRt works fine, however, when I now start inner-build/SlicerWithSlicerRT, (no difference if locally or via ssh -X), I get the following error:

SlicerRT_bld/inner-build$ ./SlicerWithSlicerRT 
qt.network.ssl: QSslSocket: cannot resolve SSL_get1_peer_certificate
qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_get_base_id
qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_load_verify_dir
error: [/home/user/builds/build-Slicer_src-Desktop-Debug/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.

so the GUI does not pop up and the program stops.

Note that GLX works fine, glxinfo and glxgears show the right output.

Could you let me know what can I do to debug this issue? Is there a way to get more verbose erro information? Some logfile to check? Any idea why this is happening?

If I start with --verbose-module-discovery --launcher-verbose I get:

Loading module "Endoscopy"
Loading module "Markups"
Loading module "EventBroker"
Loading module "ExecutionModelTour"
Loading module "ExtensionWizard"
Loading module "ExternalBeamPlanning"
error: [/home/user/builds/build-Slicer_src-Desktop-Debug/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.

I am at git commit d4a3d8ef1ccc76f49b7532b63b6bd456f8d752f0 of SlicerRt and c22540839cb55c206331579fc4757b65a2d2540a of Slicer

If I run /home/user/builds/build-Slicer_src-Desktop-Debug/Slicer-build/bin/./SlicerApp-real --additional-module-paths /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-scripted-modules /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-loadable-modules /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/cli-modules --no-splash --verbose-module-discovery

the GUI pops up, but with some warnings:

  File "<string>", line 5, in <module>
  File "<string>", line 5, in <module>
ModuleNotFoundError: No module named 'ctk'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'getSlicerRCFileName' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'slicer'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'slicer'
qSlicerScriptedLoadableModuleFactory - Failed to import module "NA" python extensions
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<frozen importlib._bootstrap_external>", line 999, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/user/builds/build-Slicer_src-Desktop-Debug/Slicer-build/lib/Slicer-5.9/qt-scripted-modules/AddManyMarkupsFiducialTest.py", line 3, in <module>
    import ctk
....

Loading module "ExternalBeamPlanning"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-scripted-modules/DoseEngines/__init__.py", line 1, in <module>
    from .AbstractScriptedDoseEngine import *
  File "/opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-scripted-modules/DoseEngines/AbstractScriptedDoseEngine.py", line 2, in <module>
    import vtk, qt, ctk, slicer, logging
ModuleNotFoundError: No module named 'vtk'

....

and DICOM import and many other things are not working.

This looks very similar to 2018-10-15 Windows nightly build "unable to import VTK" so maybe @jcfr has an idea on what’s happening.

There has been various build issues during this recent period of dependency upgrades.

You may want to actually try latest Slicer main (BUG: Fix crashes caused by range-based loops over temporary Qt contai… · Slicer/Slicer@3f4cd76 · GitHub) where the current factory build results are showing it to be successful (SlicerPreview).

SlicerRT currently has known build errors with latest Slicer main. See SlicerPreview - Build Errors. So you may actually want to try latest Slicer Stable 5.8.1 if you are trying to find a configuration that can build SlicerRT successfully. See SlicerStable.

Thanks, I was actually just doing that since a couple of hours, but now I see that I get a build error in SlicerRt:

[ 29%] Building CXX object DicomRtImportExport/ConversionRules/CMakeFiles/vtkSlicerDicomRtImportExportConversionRules.dir/vtkPlanarContourToClosedSurfaceConversionRule.cxx.o
/opt/SlicerRT_src/DicomRtImportExport/ConversionRules/vtkPlanarContourToClosedSurfaceConversionRule.cxx: In member function ‘void vtkPlanarContourToClosedSurfaceConversionRule::TriangulateContourInterior(vtkLine*, vtkCellArray*, bool)’:
/opt/SlicerRT_src/DicomRtImportExport/ConversionRules/vtkPlanarContourToClosedSurfaceConversionRule.cxx:1594:23: error: no matching function for call to ‘vtkPolygon::Triangulate(vtkSmartPointer<vtkIdList>&)’
 1594 |   polygon->Triangulate(polygonIds);
      |   ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /opt/SlicerRT_src/DicomRtImportExport/ConversionRules/vtkPlanarContourToClosedSurfaceConversionRule.cxx:34:
/opt/Slicer_bld/VTK/Common/DataModel/vtkPolygon.h:182:7: note: candidate: ‘virtual int vtkPolygon::Triangulate(int, vtkIdList*, vtkPoints*)’
  182 |   int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override
      |       ^~~~~~~~~~~
/opt/Slicer_bld/VTK/Common/DataModel/vtkPolygon.h:182:7: note:   candidate expects 3 arguments, 1 provided
make[5]: *** [DicomRtImportExport/ConversionRules/CMakeFiles/vtkSlicerDicomRtImportExportConversionRules.dir/build.make:92: DicomRtImportExport/ConversionRules/CMakeFiles/vtkSlicerDicomRtImportExportConversionRules.dir/vtkPlanarContourToClosedSurfaceConversionRule.cxx.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:3726: DicomRtImportExport/ConversionRules/CMakeFiles/vtkSlicerDicomRtImportExportConversionRules.dir/all] Error 2
make[3]: *** [Makefile:166: all] Error 2
make[2]: *** [CMakeFiles/inner.dir/build.make:87: inner-prefix/src/inner-stamp/inner-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:896: CMakeFiles/inner.dir/all] Error 2
make: *** [Makefile:101: all] Error 2

You could try:

polygon->NonDegenerateTriangulate(polygonIds);

It seems VTK 9.5 has made this incompatible change.

I’m having that on Arch Linux too, plus other encoding error messages; I’m using this brute force hack:

diff --git a/Base/Python/slicer/__init__.py b/Base/Python/slicer/__init__.py
index 1443f9b7f8..fbcb831339 100644
--- a/Base/Python/slicer/__init__.py
+++ b/Base/Python/slicer/__init__.py
@@ -183,6 +183,11 @@ except ImportError as detail:
 
 import os
 import sys
+import locale
+
+# 'ANSI_X3.4-1968' codec is being enforced since july 2025.
+# Dumb but needed. Don't use getlocale(). A literal is good also.
+locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())
 
 standalone_python = "python" in str.lower(os.path.split(sys.executable)[-1])

If you don’t want to patch the Slicer source tree, you may update __init__.py in your installed tree:

./bin/Python/slicer/__init__.py

Unfortunately, still nothing for Linux…

Thanks a lot! That solved it partly, but I am getting further errors:


/opt/SlicerRT_src/DoseComparison/Logic/vtkMRMLDoseComparisonNode.cxx: In member function ‘virtual void vtkMRMLDoseComparisonNode::ReadXMLAttributes(const char**)’:
/opt/SlicerRT_src/DoseComparison/Logic/vtkMRMLDoseComparisonNode.cxx:108:59: error: cannot convert ‘vtkStdString’ to ‘const char*’
  108 |       this->SetMaskSegmentID(vtkVariant(attValue).ToString());
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                           |
      |                                                           vtkStdString

I will try adding .c_str()

Ok, I managed to compile now. Still aborts when starting the ExternalBeamPlanning module. Even if I edit by hand the init.py file you mentioned.

It’s perhaps time to run in a debugger. The mentioned hack addresses a locale problem in Python, it’s doubtful it would lead to a crash.

Update:

With this hack, Slicer starts but files are badly read (NRRD, DICOM…).

This fix yields a functional Slicer:

locale.setlocale(locale.LC_ALL, "C.UTF-8")

NOTE: this is just a temporary hack for my Linux build at the moment. It should not be needed at all and things should bet back to normal when the library/toolkit/infrastructure upgrade phase is over.

I just came back from vacation. I’m planning on working on SlicerRT related stuff later this week, at least fixing the build error. Please note that I’ll not be able to address Mac specific stuff, but hopefully it won’t come up.

Can you give me more information on how to reproduce the crash when entering the EBP module? Thanks!

Hi, thanks!

The crash does not happen when entering the EBP module, but rather when loading it at startup.

In my case, I just do:

/opt/SlicerRT_bld/inner-build$ ./SlicerWithSlicerRT
the splash screen shows up, and then after a couple of seconds, it crashes.

Thanks! It may be due to loading the dependencies (especially IECTransformLogic). I have seen this, but since there is no working debug build for Slicer I cannot debug it currently.

1 Like

Thanks for the info.
By setting LD_DEBUG variable on Linux, I found:

1724316: find library=libvtkIECTransformLogic.so [0]; searching
1724316: search path=/opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/cli-modules/.:/opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-loadable-modules/.:/opt/SlicerRT_bld/lib/Slicer-5.9/.:/opt/Slicer_bld/Slicer-build/bin/.:/opt/Slicer_bld/Slicer-build/lib/Slicer-5.9/cli-modules/.:/opt/Slicer_bld/Slicer-build/lib/Slicer-5.9/qt-loadable-modules/. (LD_LIBRARY_PATH)
1724316: trying file=/opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/cli-modules/./libvtkIECTransformLogic.so
1724316: trying file=/opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-loadable-modules/./libvtkIECTransformLogic.so
1724316: trying file=/opt/SlicerRT_bld/lib/Slicer-5.9/./libvtkIECTransformLogic.so
1724316:

I checked

ldd ./lib/Slicer-5.9/libvtkIECTransformLogic.so

and it looks fine.

1 Like

I just run the debugger (linux) with latest Slicer and SlicerRT and I got (when loading the EBP module at startup):

(gdb) run

Starting program: /home/davide/Development/Slicer/Slicer-SuperBuild-Debug/Slicer-build/bin/SlicerApp-realPython Exception <class ‘AttributeError’>: module ‘_thread’ has no attribute ‘_set_sentinel’[Thread debugging using libthread_db enabled]Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.Python Exception <class ‘AttributeError’>: module ‘_thread’ has no attribute ‘_set_sentinel’could not find minimal symbol for typeinfo address 0x5555555db660

Catchpoint 1 (exception caught), Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing0x00007fffc6abfedb in __cxa_begin_catch () from /lib/x86_64-linux-gnu/libstdc++.so.6(gdb) btPython Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missingPython Exception <class ‘AttributeError’>: module ‘_thread’ has no attribute ‘_set_sentinel’#0 0x00007fffc6abfedb in __cxa_begin_catch () from /lib/x86_64-linux-gnu/libstdc++.so.6#1 0x00007fffc6e283e2 in tbb::detail::r1::gcc_rethrow_exception_broken () at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/exception.cpp:156Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#2 0x00007fffc6e29455 in tbb::detail::r1::governor::acquire_resources () at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/governor.cpp:72Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#3 0x00007fffc6e36423 in tbb::detail::r1::__TBB_InitOnce::add_ref () at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/main.cpp:94Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#4 0x00007fffc6e367dd in tbb::detail::r1::__TBB_InitOnce::__TBB_InitOnce (this=0x7fffc70a3460 <_INTERNALcc7d3d25::tbb::detail::r1::__TBB_InitOnceHiddenInstance>)at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/main.h:73Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#5 0x00007fffc6e365c6 in __sti___ZN17_INTERNALcc7d3d253tbb6detail2r128__TBB_InitOnceHiddenInstanceE ()at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/main.cpp:70Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#6 0x00007fffc6e36593 in sti$E () at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/main.cpp:45Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#7 0x00007ffff7fc64af in call_init (Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missingl=, argc=argc@entry=1, argv=argv@entry=0x7fffffffafe8, env=env@entry=0x7fffffffaff8) at ./elf/dl-init.c:74#8 0x00007ffff7fc65c4 in call_init (l=, argc=, argv=, env=) at ./elf/dl-init.c:120#9 _dl_init (Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missingmain_map=0x7ffff7ffe310, argc=1, argv=0x7fffffffafe8, env=0x7fffffffaff8) at ./elf/dl-init.c:121#10 0x00007ffff7fe2760 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#11 0x0000000000000001 in ?? ()Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#12 0x00007fffffffb5c8 in ?? ()Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#13 0x0000000000000000 in ?? ()Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing

It seems some conflicts with tbb, but I have no further insight

EBP module seems to link to the right tbb Slicer installation:
davide@davide-MS-7C77:~/Development/Slicer/Extensions/SlicerRT-build/inner-build/lib/Slicer-5.9/qt-loadable-modules$ ldd /home/davide/Development/Slicer/Extensions/SlicerRT-build/inner-build/lib/Slicer-5.9/qt-loadable-modules/libqSlicerExternalBeamPlanningModule.so | grep -i tbb
libtbb_debug.so.12 => /home/davide/Development/Slicer/Slicer-SuperBuild-Debug/tbb-install/lib/intel64/gcc4.8/libtbb_debug.so.12 (0x00007983ffe00000)

commenting out:

add_subdirectory(ExternalBeamPlanning)

add_subdirectory(PlmProtonDoseEngine)

remove the crash

1 Like

Thanks for trying!

Sorry, one question, how do you run gdb?
I tried with
gdb --args ./inner-build/SlicerWithSlicerRT --no-splash
and then run, but I did not get extra info.

(I could not figure out how to call gdb SlicerAppReal and at the same time initialize the SlicerRT part.)

Just to see if I get the same onetbb error.

for running the debbuger, you can use QtCreator as descrived in C++ debugging with Qt Creator — 3D Slicer documentation (but with latest Slicer I am having issues with both QtCreator 17 and QtCreator 14.0.2: debugger does not start)

using gdb from terminal (from the inner Slicer-build folder):

./Slicer --launch gdb ./bin/SlicerApp-real
(for extensions, you would need to add the modules path manually)

full guide is at C++ debugging on GNU/Linux systems — 3D Slicer documentation

Yes, I was seeing that with QtCreator, too, which is why I was trying instead directly from gdb. Good to see I’m not the only one :slight_smile: (I had read the Guide you linked)

Regarding extensions, do you mean adding the following flags after SlicerApp-real? Or do I need to add them in the GUI?

–launcher-additional-settings /opt/SlicerRT_bld/inner-build/AdditionalLauncherSettings.ini --additional-module-paths /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-scripted-modules /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-loadable-modules /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/cli-modules

1 Like