Permalink
Browse files

BUG: Disable ITK_AUTOLOAD_PATH/itkMRMLIDIOPlugin for executable CLIs

Follow up of commit r21440, unset environment variable ITK_AUTOLOAD_PATH
consistently:

Unset ITK_AUTOLOAD_PATH environment variable to prevent the CLI from
loading the itkMRMLIDIOPlugin plugin because executable CLIs read images
from file and not from shared memory. Worst the plugin in the CLI
could clash by loading libraries (ITK, VTK, MRML) other than the
statically linked to the executable.
Historically, there was an nvidia driver bug that causes the module
to fail on exit with undefined symbol.


// ------------------
This fixes the following error (Ubuntu 10.04 / gcc 4.4.3):

Error(s):
    CLI executable: /home/jchris/Projects/Slicer-AHM-Superbuild-Debug/Slicer-build/lib/Slicer-4.2/cli-modules/AddScalarVolumes
    /home/jchris/Projects/Slicer-AHM-Superbuild-Debug/Slicer-build/lib/Slicer-4.2/cli-modules/AddScalarVolumes: symbol lookup error: /home/jchris/Projects/QtSDK-1.2/Desktop/Qt/474/gcc/lib/libQtGui.so.4: undefined symbol: _ZN11QMetaObject11removeGuardEPP7QObject

    CLI executable: /home/jchris/Projects/Slicer-AHM-Superbuild-Debug/Slicer-build/lib/Slicer-4.2/cli-modules/AddScalarVolumes
    Failed to retrieve Xml Description

// ------------------
.. and also the following warnings (MacOSX 10.8.3 / Gcc 4.2.1):

Error(s):
    CLI executable: /Volumes/Dashboards/Experimental/Slicer-1-Superbuild-Release-cmake-2.8.11-rc1/Slicer-build/lib/Slicer-4.2/cli-modules/ProbeVolumeWithModel
    WARNING: In /Volumes/Dashboards/Experimental/Slicer-1-Superbuild-Release-cmake-2.8.11-rc1/ITKv4/Modules/Core/Common/src/itkObjectFactoryBase.cxx, line 514
/Volumes/Dashboards/Experimental/Slicer-1-Superbuild-Release-cmake-2.8.11-rc1/Slicer-build/lib/Slicer-4.2/ITKFactories/libMGHIOPlugin.so is already loaded

WARNING: In /Volumes/Dashboards/Experimental/Slicer-1-Superbuild-Release-cmake-2.8.11-rc1/ITKv4/Modules/Core/Common/src/itkObjectFactoryBase.cxx, line 514
/Volumes/Dashboards/Experimental/Slicer-1-Superbuild-Release-cmake-2.8.11-rc1/Slicer-build/lib/Slicer-4.2/ITKFactories/libMRMLIDIOPlugin.so is already loaded


// ------------------
This fixes the problem without explaining completely the underlying cause, more
investigation is required to have a clear understanding of the problem.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21853 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
1 parent 1c25297 commit f78a73432a9d0a4cb121f1a2b7eeee37157828e9 @jcfr jcfr committed Apr 1, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 Base/QTCLI/qSlicerCLIExecutableModuleFactory.cxx
@@ -55,6 +55,9 @@ qSlicerAbstractCoreModule* qSlicerCLIExecutableModuleFactoryItem::instanciator()
int cliProcessTimeoutInMs = 5000;
QProcess cli;
+ QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+ env.insert("ITK_AUTOLOAD_PATH", "");
+ cli.setProcessEnvironment(env);
cli.start(this->path(), QStringList(QString("--xml")));
bool res = cli.waitForFinished(cliProcessTimeoutInMs);
if (!res)

0 comments on commit f78a734

Please sign in to comment.