View Issue Details

IDProjectCategoryView StatusLast Update
0004617Slicer4Core: Building (CMake, Superbuild)public2018-10-16 07:17
ReportertorquilAssigned Tojcfr 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
PlatformLinuxOSDebianOS VersionSid
Product Version 
Target VersionFixed in VersionSlicer 4.9.0 
Summary0004617: Segmentation fault at startup related to OpenSSL
Description

There was a similar bug reported as 0004125, but it says that it has been fixed. This might be very similar.

Here is the gdb output from running SlicerApp-real:

  $ gdb Slicer-Superbuild-Debug/Slicer-build/bin/SlicerApp-real 
  GNU gdb (Debian 8.1-4+b1) 8.1
  Copyright (C) 2018 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-linux-gnu".
  Type "show configuration" for configuration details.
  For bug reporting instructions, please see:
  <http://www.gnu.org/software/gdb/bugs/>.
  Find the GDB manual and other documentation resources online at:
  <http://www.gnu.org/software/gdb/documentation/>.
  For help, type "help".
  Type "apropos word" to search for commands related to "word"...
  Reading symbols from Slicer-Superbuild-Debug/Slicer-build/bin/SlicerApp-real...done.
  (gdb) run
  Starting program: /home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/Slicer-build/bin/SlicerApp-real 
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
  [New Thread 0x7fffc893c700 (LWP 16265)]
  [New Thread 0x7fffc3a8a700 (LWP 16266)]

  Thread 1 "SlicerApp-real" received signal SIGSEGV, Segmentation fault.
  __strcmp_sse2_unaligned () at /build/glibc-hBZSf0/glibc-2.27/string/../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31
  31    /build/glibc-hBZSf0/glibc-2.27/string/../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: No such file or directory.
  (gdb) bt full
  #0  __strcmp_sse2_unaligned () at /build/glibc-hBZSf0/glibc-2.27/string/../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31
  No locals.
  0000001  0x00007fffef5cef1c in getrn () from /home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/OpenSSL/libcrypto.so.1.0.0
  No symbol table info available.
  0000002  0x00007fffef5cf230 in lh_insert () from /home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/OpenSSL/libcrypto.so.1.0.0
  No symbol table info available.
  0000003  0x00007fffef51e8f0 in OBJ_NAME_add () from /home/torquil/src/upstream/slicer/Slicer-Superbuild-Debug/OpenSSL/libcrypto.so.1.0.0
  No symbol table info available.
  0000004  0x00007fffc30a7cbe in openssl_add_all_ciphers_int () at ./build_shared/../crypto/evp/c_allc.c:83
  No locals.
  0000005  0x00007fffc30c2829 in ossl_init_add_all_ciphers () at ./build_shared/../crypto/init.c:216
  No locals.
  0000006  ossl_init_add_all_ciphers_ossl_ () at ./build_shared/../crypto/init.c:205
  No locals.
  0000007  0x00007fffebea4827 in __pthread_once_slow (once_control=0x7fffc321b7d4 <add_all_ciphers>, init_routine=0x7fffc30c2820 <ossl_init_add_all_ciphers_ossl_>)
      at /build/glibc-hBZSf0/glibc-2.27/nptl/pthread_once.c:116
          _buffer = {__routine = 0x7fffebea4880 <clear_once_control>, __arg = 0x7fffc321b7d4 <add_all_ciphers>, __canceltype = -11104, __prev = 0x0}
          val = <optimized out>
          newval = <optimized out>
  0000008  0x00007fffebea48e5 in __GI___pthread_once (once_control=once_control@entry=0x7fffc321b7d4 <add_all_ciphers>, 
      init_routine=init_routine@entry=0x7fffc30c2820 <ossl_init_add_all_ciphers_ossl_>) at /build/glibc-hBZSf0/glibc-2.27/nptl/pthread_once.c:143
          val = <optimized out>
  0000009  0x00007fffc312b329 in CRYPTO_THREAD_run_once (once=once@entry=0x7fffc321b7d4 <add_all_ciphers>, init=init@entry=0x7fffc30c2820 <ossl_init_add_all_ciphers_ossl_>)
      at ./build_shared/../crypto/threads_pthread.c:113
  No locals.
  0000010 0x00007fffc30c2d63 in OPENSSL_init_crypto (opts=opts@entry=76, settings=0x0) at ./build_shared/../crypto/init.c:585
          settings = 0x0
          opts = 76
          ret = <optimized out>
  0000011 0x00007fffc2edacd4 in OPENSSL_init_ssl (opts=0, settings=<optimized out>) at ./build_shared/../ssl/ssl_init.c:197
          stoperrset = 0
  0000012 0x00007fffef378a80 in QSslSocketPrivate::ensureLibraryLoaded() () at ./src/network/ssl/qsslsocket_openssl11.cpp:94
          locker = {val = 140737207174017}
  0000013 0x00007ffff70e3f4f in qSlicerCoreApplicationPrivate::init (this=0x555555ac4200) at /home/torquil/src/upstream/slicer/Slicer/Base/QTCore/qSlicerCoreApplication.cxx:271
          q = 0x7fffffffd8a0
          __PRETTY_FUNCTION__ = "virtual void qSlicerCoreApplicationPrivate::init()"
          appLauncherSettings = {<QObject> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7fffe3d45a40 <QObject::staticMetaObject>, 
                stringdata = 0x7ffff71a2740 <qt_meta_stringdata_ctkAppLauncherSettings>, data = 0x7ffff71a2780 <qt_meta_data_ctkAppLauncherSettings>, 
                static_metacall = 0x7ffff71572dc <ctkAppLauncherSettings::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, d_ptr = {
              d = 0x555555efae80}}
          envVars = {{d = 0x555555f47ae0, e = 0x555555f47ae0}}
          pathsEnvVars = {{d = 0x555555f557f0, e = 0x555555f557f0}}
          userInfo = 0x555555b649f0
          scene = {Object = 0x2ffe47294c563000}
          model = 0x2ffe47294c563000
          updatedExtensions = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {
                            static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x555555f44d50}, 
                d = 0x555555f44d50}}, <No data fields>}
          uninstalledExtensions = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {
                        _q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x555555ef6100}, 
                d = 0x555555ef6100}}, <No data fields>}
  0000014 0x00007ffff7afbcbe in qSlicerApplicationPrivate::init (this=0x555555ac4200) at /home/torquil/src/upstream/slicer/Slicer/Base/QTGUI/qSlicerApplication.cxx:205
          q = 0x7fffffffd8a0
          generalPanel = 0x7fffffffd8c8
          settingsModulesPanel = 0x555555ac4200
          settingsStylesPanel = 0x2ffe47294c563000
          settingsViewsPanel = 0x7fffffffd790
          settingsUserPanel = 
      0x7ffff7b00efc <qGetPtrHelper<QScopedPointer<qSlicerCoreApplicationPrivate> >(QScopedPointer<qSlicerCoreApplicationPrivate, QScopedPointerDeleter<qSlicerCoreApplicationPrivate> > const&)+39>
          settingsExtensionsPanel = 0x7fffffffd7c0
          cachePanel = 0x7fffffffd8c8
          developerPanel = 0x7fffffffda08
          eventSource = 0x2ffe47294c563000
  0000015 0x00007ffff7afcd10 in qSlicerApplication::qSlicerApplication (this=0x7fffffffd8a0, _argc=@0x7fffffffd85c: 1, _argv=0x7fffffffda08)
      at /home/torquil/src/upstream/slicer/Slicer/Base/QTGUI/qSlicerApplication.cxx:359
          d = 0x555555ac4200
          d = <optimized out>
  0000016 0x000055555555a8c9 in (anonymous namespace)::SlicerAppMain (argc=1, argv=0x7fffffffda08) at /home/torquil/src/upstream/slicer/Slicer/Applications/SlicerApp/Main.cxx:40
          app = {<qSlicerCoreApplication> = {<QApplication> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7fffe48e9a80 <QApplication::staticMetaObject>, 
                  stringdata = 0x7ffff716c0c0 <qt_meta_stringdata_qSlicerCoreApplication>, data = 0x7ffff716cd80 <qt_meta_data_qSlicerCoreApplication>, 
                  static_metacall = 0x7ffff7144c08 <qSlicerCoreApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, 
              MyQVTK = {<QObject> = {<No data fields>}, static staticMetaObject = {d = {superdata = 0x7fffe3d45a40 <QObject::staticMetaObject>, 
                    stringdata = 0x7fffef495fe0 <qt_meta_stringdata_ctkVTKObjectEventsObserver>, data = 0x7fffef496040 <qt_meta_data_ctkVTKObjectEventsObserver>, 
                    static_metacall = 0x7fffef491246 <ctkVTKObjectEventsObserver::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, 
                d_ptr = {d = 0x555555e91060}}, d_ptr = {d = 0x555555ac4200}}, static staticMetaObject = {d = {superdata = 0x7ffff71d0420 <qSlicerCoreApplication::staticMetaObject>, 
                stringdata = 0x7ffff7bcde40 <qt_meta_stringdata_qSlicerApplication>, data = 0x7ffff7bce340 <qt_meta_data_qSlicerApplication>, 
                static_metacall = 0x7ffff7b9e9d6 <qSlicerApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}}
          window = {d = 0x7fffdc602c48 <__internal_atexit+88>}
          splashScreen = {d = 0x7fffffffd8c0}
  0000017 0x000055555555abc1 in main (argc=1, argv=0x7fffffffda08) at /home/torquil/src/upstream/slicer/Slicer/Base/QTApp/qSlicerApplicationMainWrapper.cxx:56
  No locals.
  (gdb)

I will try to work around this by doing as described in 0004125, i.e. trying Slicer_USE_SYSTEM_OpenSSL=OFF and/or Slicer_USE_PYTHONQT_WITH_OPENSSL=OFF.

Steps To Reproduce

On Debian Sid with GCC 8.2.0, modify Slicer to use Python 2.7.15 to work around 0004612. Then work around 0004616 by changing to build libarchive in release mode as described in 0004558. Then,

cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=1 -DCMAKE_BUILD_TYPE:STRING=$BUILDTYPE -DSlicer_USE_SYSTEM_QT:BOOL=1 -DSlicer_USE_SYSTEM_QT:BOOL=1 -DQt5_DIR:PATH=$QTDIR ../Slicer

make VERBOSE=1 -j8

gdb Slicer-Superbuild-Debug/Slicer-build/bin/SlicerApp-real
(gdb) run

Additional Information

I have modified Slicer to use Python 2.7.15 and to build libarchive in release mode due to two other recent bugs that I reported (), but that's probably not related to this.

$ gcc --version
gcc (Debian 8.2.0-7) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ --version
g++ (Debian 8.2.0-7) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cmake --version
cmake version 3.12.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

TagsNo tags attached.

Activities

torquil

torquil

2018-09-20 08:00

reporter   ~0016038

It works when using -DSlicer_USE_SYSTEM_OpenSSL=1 -DSlicer_USE_SYSTEM_curl:BOOL=1.

My theory is that the problem was caused by me using the system libqt which is linked to the system openssl, which is different from the bunded openssl that slicer uses by default. Slicer_USE_SYSTEM_OpenSSL=1 fixed the problem but introduced another one involving libcurl. Also forcing to use the system libcurl fixed that issue.

So I guess this is perhaps not a Slicer bug? If I had not used the system libqt, the problem might not have arisen in the first place?

jcfr

jcfr

2018-10-16 07:15

administrator   ~0016146

Last edited: 2018-10-16 07:15

View 2 revisions

So I guess this is perhaps not a Slicer bug? If I had not used the system libqt, the problem might not have arisen in the first place?

On your system, in which folder Qt is installed ?

We try to detect this here and set Slicer_USE_SYSTEM_QT to ON automatically: https://github.com/Slicer/Slicer/blob/f91c9d6ac66941e6920783ab56707f52db4989d6/CMakeLists.txt#L629-L676 But in your case, you were already explicitly setting the option to ON.

Generally Qt is quite good at detecting the OpenSSL library available. Now, it also depends on how the Qt libraries were packaged for your system ..: with -openssl-runtime or with -openssl-linked option. If it is the second option ... you effectively need to set -DSlicer_USE_SYSTEM_OpenSSL=1 and -DSlicer_USE_SYSTEM_curl:BOOL=1.

Remark on the Slicer_USE_SYSTEM_* variables

Also worth noting that Slicer build system differentiate a custom build or install outside of Slicer, and a system install of a libraries. You can for example ask Slicer to find VTK on the system setting Slicer_USE_SYSTEM_VTK or in a custom build by setting VTK_DIR.

Setting Slicer_USE_SYSTEM_VTK will also imply that all VTK dependency (e.g python, ...) will be expected to be on the system.

jcfr

jcfr

2018-10-16 07:17

administrator   ~0016147

@torquil Since you manage to build Slicer, I am resolving this issue.

Issue History

Date Modified Username Field Change
2018-09-20 06:28 torquil New Issue
2018-09-20 06:28 torquil Status new => assigned
2018-09-20 06:28 torquil Assigned To => jcfr
2018-09-20 08:00 torquil Note Added: 0016038
2018-10-16 06:52 jcfr Description Updated View Revisions
2018-10-16 06:52 jcfr Description Updated View Revisions
2018-10-16 06:53 jcfr Description Updated View Revisions
2018-10-16 06:54 jcfr Description Updated View Revisions
2018-10-16 06:55 jcfr Description Updated View Revisions
2018-10-16 07:15 jcfr Note Added: 0016146
2018-10-16 07:15 jcfr Note Edited: 0016146 View Revisions
2018-10-16 07:17 jcfr Status assigned => resolved
2018-10-16 07:17 jcfr Resolution open => no change required
2018-10-16 07:17 jcfr Fixed in Version => Slicer 4.9.0
2018-10-16 07:17 jcfr Note Added: 0016147