View Issue Details

IDProjectCategoryView StatusLast Update
0004125Slicer4Core: Base Codepublic2017-08-06 18:42
ReportergregsharpAssigned Tojcfr 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformDebian TestingOSlinuxOS Version4.3.0-1-amd64
Product VersionSlicer 4.6.0 
Target VersionFixed in Version 
Summary0004125: Linux crash at startup on fresh build
Description

Fresh build from source causes crash. This is Debian Testing, another computer with Debian Stable does not exhibit this problem.

#0 0x00007f45a3fff000 in ?? ()
0000001 0x00007f454c8afb31 in init_hashlib () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/python2.7/lib-dynload/_hashlib.so
0000002 0x00007f46708cf597 in _PyImport_LoadDynamicModule () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000003 0x00007f46708ccf98 in import_submodule () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000004 0x00007f46708cddba in PyImport_ImportModuleLevel () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000005 0x00007f46708a7bb8 in builtin_import__ () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000006 0x00007f4670803633 in PyObject_Call () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000007 0x00007f46708a96f7 in PyEval_CallObjectWithKeywords () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000008 0x00007f46708ad00e in PyEval_EvalFrameEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000009 0x00007f46708b06ac in PyEval_EvalCodeEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000010 0x00007f46708b07c9 in PyEval_EvalCode () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000011 0x00007f46708cbc1c in PyImport_ExecCodeModuleEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000012 0x00007f46708cbf80 in load_source_module () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000013 0x00007f46708ccf98 in import_submodule () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000014 0x00007f46708cddba in PyImportImportModuleLevel () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000015 0x00007f46708a7bb8 in builtin
import () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000016 0x00007f4670803633 in PyObject_Call () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000017 0x00007f46708a96f7 in PyEval_CallObjectWithKeywords () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000018 0x00007f46708ad00e in PyEval_EvalFrameEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000019 0x00007f46708b06ac in PyEval_EvalCodeEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000020 0x00007f46708b07c9 in PyEval_EvalCode () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000021 0x00007f46708cbc1c in PyImport_ExecCodeModuleEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000022 0x00007f46708cbf80 in load_source_module () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000023 0x00007f46708ccf98 in import_submodule () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000024 0x00007f46708cddba in PyImport_ImportModuleLevel () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000025 0x00007f46708a7bb8 in builtin_import () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000026 0x00007f4670803633 in PyObject_Call () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000027 0x00007f46708a96f7 in PyEval_CallObjectWithKeywords () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000028 0x00007f46708ad00e in PyEval_EvalFrameEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000029 0x00007f46708b06ac in PyEval_EvalCodeEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000030 0x00007f46708b07c9 in PyEval_EvalCode () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000031 0x00007f46708cbc1c in PyImport_ExecCodeModuleEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000032 0x00007f46708cbf80 in load_source_module () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000033 0x00007f46708ccf98 in import_submodule () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000034 0x00007f46708ce1e6 in PyImport_ImportModuleLevel () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000035 0x00007f46708a7bb8 in builtin_import () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000036 0x00007f4670803633 in PyObject_Call () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000037 0x00007f46708a96f7 in PyEval_CallObjectWithKeywords () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000038 0x00007f46708ad00e in PyEval_EvalFrameEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000039 0x00007f46708b06ac in PyEval_EvalCodeEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000040 0x00007f46708b07c9 in PyEval_EvalCode () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000041 0x00007f46708cbc1c in PyImport_ExecCodeModuleEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000042 0x00007f46708cbf80 in load_source_module () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000043 0x00007f46708ccf98 in import_submodule () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000044 0x00007f46708cddba in PyImportImportModuleLevel () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000045 0x00007f46708a7bb8 in builtin
import () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000046 0x00007f4670803633 in PyObject_Call () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000047 0x00007f46708a96f7 in PyEval_CallObjectWithKeywords () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000048 0x00007f46708ad00e in PyEval_EvalFrameEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000049 0x00007f46708b06ac in PyEval_EvalCodeEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000050 0x00007f46708b07c9 in PyEval_EvalCode () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000051 0x00007f46708cbc1c in PyImport_ExecCodeModuleEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000052 0x00007f46708cbf80 in load_source_module () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000053 0x00007f46708cd514 in load_package () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000054 0x00007f46708ccf98 in import_submodule () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000055 0x00007f46708cddba in PyImportImportModuleLevel () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000056 0x00007f46708a7bb8 in builtin
import__ () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000057 0x00007f4670803633 in PyObject_Call () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000058 0x00007f46708a96f7 in PyEval_CallObjectWithKeywords () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000059 0x00007f46708ad00e in PyEval_EvalFrameEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000060 0x00007f46708b06ac in PyEval_EvalCodeEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000061 0x00007f46708b07c9 in PyEval_EvalCode () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000062 0x00007f46708cbc1c in PyImport_ExecCodeModuleEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000063 0x00007f46708cbf80 in load_source_module () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000064 0x00007f46708cc433 in imp_load_source () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
0000065 0x00007f46708af97e in PyEval_EvalFrameEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
#66 0x00007f46708b06ac in PyEval_EvalCodeEx () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
#67 0x00007f46708b07c9 in PyEval_EvalCode () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
#68 0x00007f46708ecc96 in PyRun_StringFlags () from /home/gsharp/build/slicer-4/Slicer-debug/python-install/lib/libpython2.7.so
#69 0x00007f4686fbd3d4 in qSlicerScriptedUtils::loadSourceAsModule (moduleName=..., fileName=..., global_dict=0x7f46592f2168, local_dict=0x7f45a81305c8) at /home/gsharp/build/slicer-4/Slicer/Base/QTCore/qSlicerScriptedUtils.cxx:41
#70 0x00007f468ad6709d in qSlicerScriptedLoadableModule::setPythonSource (this=0x2a8cca0, newPythonSource=...) at /home/gsharp/build/slicer-4/Slicer/Base/QTGUI/qSlicerScriptedLoadableModule.cxx:143
0000071 0x00007f468ad5f087 in ctkFactoryScriptedItem::instanciator (this=0x281b460) at /home/gsharp/build/slicer-4/Slicer/Base/QTGUI/qSlicerScriptedLoadableModuleFactory.cxx:80
0000072 0x00007f468b3dcc34 in ctkAbstractFactoryItem<qSlicerAbstractCoreModule>::instantiate (this=0x281b460) at /home/gsharp/build/slicer-4/Slicer-debug/CTK/Libs/Core/ctkAbstractFactory.tpp:137
0000073 0x00007f468b3dc0c3 in ctkAbstractFactory<qSlicerAbstractCoreModule>::instantiate (this=0x27599f0, itemKey=...) at /home/gsharp/build/slicer-4/Slicer-debug/CTK/Libs/Core/ctkAbstractFactory.tpp:218
#74 0x00007f4686f5c1e8 in qSlicerAbstractModuleFactoryManager::instantiateModule (this=0x1fc3860, moduleName=...) at /home/gsharp/build/slicer-4/Slicer/Base/QTCore/qSlicerAbstractModuleFactoryManager.cxx:381
0000075 0x00007f4686f5c01d in qSlicerAbstractModuleFactoryManager::instantiateModules (this=0x1fc3860) at /home/gsharp/build/slicer-4/Slicer/Base/QTCore/qSlicerAbstractModuleFactoryManager.cxx:358
0000076 0x0000000000406431 in (anonymous namespace)::SlicerAppMain (argc=2, argv=0x7ffd26a3f508) at /home/gsharp/build/slicer-4/Slicer/Applications/SlicerApp/Main.cxx:173
0000077 0x0000000000406d2a in main (argc=2, argv=0x7ffd26a3f508) at /home/gsharp/build/slicer-4/Slicer/Applications/SlicerApp/Main.cxx:254

Additional Information

Qt version is 4.8.7.
gcc version is 5.3.1.

TagsNo tags attached.

Activities

jcfr

jcfr

2016-01-29 18:47

administrator   ~0013803

From Isaiah
Originally posted on devel list: http://slicer-devel.65872.n3.nabble.com/Slicer-startup-crash-on-fresh-build-tt4036106.html

Hi Greg,

It looks like the crash happens during initialization of OpenSSL hashing routines for hashlib, which seems to be imported by Modules/Scripted/DICOMLib/DICOMPlugin.py on launch. A few suggestions:

  • did you happen to build with 'Slicer_USE_SYSTEM_OpenSSL' defined? If so, try removing that option and let Slicer build OpenSSL from scratch.
  • set Slicer_USE_PYTHONQT_WITH_OPENSSL=OFF. This should resolve the launch issue, but will likely lose some functionality. The Python DICOM plugins may still work because it only uses MD5.

As far as debugging:

  • The best option is to build a debug version of Python and run it under gdb. Unfortunately, this doesn't seem to be supported by the CMake Python build script (there is a TODO for Py_DEBUG support in the CMake file).
    --> You may be able to get debug symbols in an existing superbuild Python by running make OPT="-g" from $SUPERBUILD_DIR/python-build (possibly preceded by make clean).
    --> If that doesn't work, copy the "$SUPERBUILD/Python-2.7.11" directory somewhere else, and do an autoconf build. You'll need to do ./configure --with-pydebug, and hopefully it will pick up your local OpenSSL version. Then run

gdb ./python-dbg
gdb> b init_hashlib
gdb> r
python> import hashlib

... and see if you can reproduce the crash.

... you could revert to GCC 4.9 (or maybe install in parallel, not sure how hard that is in Debian), but you will need to do a clean superbuild in that case, and possibly tweak the compiler paths. Changing compilers is a bit on the risky side, so don't do this on a system you can't afford to brick :)

Best,
Isaiah

[1] https://packages.qa.debian.org/o/openssl.html

gregsharp

gregsharp

2016-02-08 10:29

developer   ~0013807

Confirmed that Slicer_USE_SYSTEM_OpenSSL to OFF does workaround this problem.

lassoan

lassoan

2017-06-11 10:02

developer   ~0014757

This is a build issue on a specific configuration and a workaround is available, so I change the severity to "minor" (it helps us focusing on real crashes in production code).

gregsharp

gregsharp

2017-08-06 11:50

developer   ~0015026

Last edited: 2017-08-06 11:52

View 2 revisions

Behavior of this problem has changed. Setting Slicer_USE_SYSTEM_OpenSSL no longer effective; crash occurs with Slicer-built OpenSSL. The backtrace is:

Program received signal SIGSEGV, Segmentation fault.
0x00007f69280681f7 in CRYPTO_add_lock () from /home/gsharp/build/slicer-4/Slicer-debug/OpenSSL/libcrypto.so.1.0.0
bt
#0 0x00007f69280681f7 in CRYPTO_add_lock () from /home/gsharp/build/slicer-4/Slicer-debug/OpenSSL/libcrypto.so.1.0.0
0000001 0x00007f69280fc869 in EVP_PKEY_free () from /home/gsharp/build/slicer-4/Slicer-debug/OpenSSL/libcrypto.so.1.0.0
0000002 0x00007f692844847b in ssl_cert_free () from /home/gsharp/build/slicer-4/Slicer-debug/OpenSSL/libssl.so.1.0.0
0000003 0x00007f692844520f in SSL_CTX_free () from /home/gsharp/build/slicer-4/Slicer-debug/OpenSSL/libssl.so.1.0.0
0000004 0x00007f68f941ce01 in SSL_free () from /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2
0000005 0x00007f69117df944 in ?? () from /usr/lib/x86_64-linux-gnu/libQtNetwork.so.4
0000006 0x00007f69117e11df in ?? () from /usr/lib/x86_64-linux-gnu/libQtNetwork.so.4
0000007 0x00007f69117d048d in ?? () from /usr/lib/x86_64-linux-gnu/libQtNetwork.so.4
0000008 0x00007f69117d0745 in QSslCertificate::fromData(QByteArray const&, QSsl::EncodingFormat) () from /usr/lib/x86_64-linux-gnu/libQtNetwork.so.4
0000009 0x00007f69117d0eb9 in QSslCertificate::fromPath(QString const&, QSsl::EncodingFormat, QRegExp::PatternSyntax) () from /usr/lib/x86_64-linux-gnu/libQtNetwork.so.4
0000010 0x00007f692956e081 in qSlicerCoreApplication::loadCaCertificates (slicerHome=...) at /home/gsharp/build/slicer-4/Slicer/Base/QTCore/qSlicerCoreApplication.cxx:1594
0000011 0x00007f6929566ddc in qSlicerCoreApplicationPrivate::init (this=0x56187d44d290) at /home/gsharp/build/slicer-4/Slicer/Base/QTCore/qSlicerCoreApplication.cxx:252
0000012 0x00007f692d30b1cc in qSlicerApplicationPrivate::init (this=0x56187d44d290) at /home/gsharp/build/slicer-4/Slicer/Base/QTGUI/qSlicerApplication.cxx:190
0000013 0x00007f692d30c1fc in qSlicerApplication::qSlicerApplication (this=0x7ffe97b66d80, _argc=@0x7ffe97b66c4c: 2, _argv=0x7ffe97b66f28) at /home/gsharp/build/slicer-4/Slicer/Base/QTGUI/qSlicerApplication.cxx:347
0000014 0x000056187b258e8a in (anonymous namespace)::SlicerAppMain (argc=2, argv=0x7ffe97b66f28) at /home/gsharp/build/slicer-4/Slicer/Applications/SlicerApp/Main.cxx:125
0000015 0x000056187b259edb in main (argc=2, argv=0x7ffe97b66f28) at /home/gsharp/build/slicer-4/Slicer/Applications/SlicerApp/Main.cxx:277

Debian testing
Qt 4.8.7
gcc 6.4.0

Is it possible that system Qt is not compatible with slicer-built OpenSSL? Note System Qt links with libssl.so.1.0.2 which calls Slicer-debug/OpenSSL/libssl.so.1.0.0.

gregsharp

gregsharp

2017-08-06 18:42

developer   ~0015027

Update: Setting Slicer_USE_PYTHONQT_WITH_OPENSSL=OFF does seem to work.

Issue History

Date Modified Username Field Change
2016-01-10 17:50 gregsharp New Issue
2016-01-10 17:50 gregsharp Status new => assigned
2016-01-10 17:50 gregsharp Assigned To => jcfr
2016-01-29 18:47 jcfr Note Added: 0013803
2016-02-08 10:29 gregsharp Note Added: 0013807
2017-06-11 10:02 lassoan Severity crash => minor
2017-06-11 10:02 lassoan Note Added: 0014757
2017-08-06 11:50 gregsharp Note Added: 0015026
2017-08-06 11:52 gregsharp Note Edited: 0015026 View Revisions
2017-08-06 18:42 gregsharp Note Added: 0015027