View Issue Details

IDProjectCategoryView StatusLast Update
0000488Slicer3Base Codepublic2009-04-14 12:04
Reporterfedorov Assigned Tomillerjv  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Summary0000488: Crash of Slicer/RigidRegistration execution on Mac during fresh Slicer startup
Description

As of nightly build March 03 for darwin-x86 binary, under certain conditions execution of RigidRegistration will fail crashing Slicer and producing message "child process exited abnormally".

To reproduce, remove /var/tmp/Slicer3<your_username>. Run Slicer from binary release, load two volumes (I used images Testing/Data/Input/MRMeningioma*.nrrd. Go to RigidRegistration module, use default parameters, select the two meningioma images as fixed and floating, and choose to create new transform and volume. Run registration. This can be reproduced with 100% consistency on lefty mac.

Additional Information

I suspect the problem was there as early as beginning of February. To debug this I turned off console redirect in CommandLineModule to get error messages. What I am getting is the following before the crash. Looks like something goes very wrong in (or before) PARSE_ARGS. Was memory corrupted somewhere earlier? Why does it abort?

PARSE ERROR: Argument: -i (--iterations)
Couldn't read argument value from string '100,100,50,20'

Brief USAGE:
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'SIZE', 'XML', 'builtins', 'doc', 'file', 'name', 'numpy', 'numpy_nrrd_names', 'numpy_sizes', 'numpy_vtk_types', 'os', 'recvVolume', 'sendVolume', 'socket', 'time', 'vtk_types']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
Module: ['Execute', 'XML', 'builtins', 'doc', 'file', 'name']
Found XML!
slicer:0xe66c292 [--processinformationaddress <std::string>] [--xml]
[--echo] [--resampledmovingfilename <std::string>]
[--outputtransform <std::string>] [--initialtransform
<std::string>] [-t <double>] [-i <int>] [-s <int>] [-b
<int>] [--movingsmoothingfactor <int>]
[--fixedsmoothingfactor <int>] [--] [--version] [-h]
<std::string> <std::string>

For complete USAGE and HELP type:
slicer:0xe66c292 --help

child process exited abnormally

TagsNo tags attached.

Relationships

child of 0000440 closedfedorov ChangeTracker crash on mac nightly build 

Activities

fedorov

fedorov

2009-03-04 07:33

developer   ~0000687

This bug can be reproduced on mac with debug build, and with the release build consistently when Slicer is run with --clear_module_cache. --no_module_stream_redirect will allow to see the error messages before Slicer exits.

fedorov

fedorov

2009-03-23 07:06

developer   ~0000742

The problem is not specific to "Rigid registration" module. A similar crash happens when I try to do "Histogram matching" under the same startup conditions.

Something wrong is going on when Slicer starts with clear cache.

pieper

pieper

2009-04-07 12:21

administrator   ~0000783

Jim - what's the status?

Andriy - is this still a bug? Can you bug Jim until he fixes it?

fedorov

fedorov

2009-04-07 13:47

developer   ~0000797

I can reproduce this problem on lefty as of Slicer3-3.3-alpha-2009-04-07-darwin-x86 build.

millerjv

millerjv

2009-04-09 11:13

developer   ~0000814

I have been able to reproduce this issue once I updated my builds. So it is definitely an issue that was introduced in the past few weeks.

fedorov

fedorov

2009-04-09 11:59

developer   ~0000815

Jim, I have reasons to believe this bug was there as of Feb 4, when Ron first reported the problem to me.

It was definitely there on March 3 when I submitted it, because I could reproduce it at that time consistently.

millerjv

millerjv

2009-04-10 09:43

developer   ~0000828

This was a good one.

Turns out that Mac OS X defaults to RTLD_GLOBAL in dlopen(). This exposes all symbols in a shared library to the main program and other plugins. When there was no module cache, RigidRegistration was calling some other module's DoIt() method and crashing. When there was a cache, the shared libraries are not opened until they are used. So RigidRegistration would usually call its own DoIt() method. But this was just by luck. If other plugins had be used before RigidRegistration, there would still be a chance that RigidRegistration could call the wrong DoIt().

Unfortunately, there is no way to override the parameters to dlopen() through kwsys (itksys) DynamicLoader. So I hard coded the call to dlopen where Slicer uses itksys::DynamicLoader::OpenLibrary() for Mac OS X.

Issue History

Date Modified Username Field Change
2009-03-03 13:36 fedorov New Issue
2009-03-03 13:37 fedorov Relationship added child of 0000440
2009-03-04 07:33 fedorov Note Added: 0000687
2009-03-16 08:13 pieper Assigned To => millerjv
2009-03-16 08:13 pieper Status new => assigned
2009-03-17 07:59 pieper Tag Attached: 3.4 Targeted fix
2009-03-23 07:06 fedorov Note Added: 0000742
2009-04-07 12:21 pieper Note Added: 0000783
2009-04-07 13:47 fedorov Note Added: 0000797
2009-04-09 11:13 millerjv Note Added: 0000814
2009-04-09 11:59 fedorov Note Added: 0000815
2009-04-10 09:43 millerjv Note Added: 0000828
2009-04-10 09:43 millerjv Status assigned => resolved
2009-04-10 09:43 millerjv Resolution open => fixed
2009-04-14 12:04 pieper Status resolved => closed
2009-05-18 11:37 wjp Tag Detached: 3.4 Targeted fix