MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
290 stars 179 forks source link

tckgen from updated_syntax branch segfaults #349

Closed bjeurissen closed 8 years ago

bjeurissen commented 9 years ago

I encountered the following segfault when performing iFOD2 ACT tracking with a brain mask and gmwm seeding. Same command works on the master branch. Not sure what is going on. Below is the output from gdb:

(gdb) r -mask dwi_brainmask.mif.gz fodf.mif.gz tracks.tck -act anat_5tt.mif.gz -seed_gmwmi anat_gmwmi.mif.gz -force Starting program: /Users/ben/msdwi2fod/release/bin/tckgen -mask dwi_brainmask.mif.gz fodf.mif.gz tracks.tck -act anat_5tt.mif.gz -seed_gmwmi anat_gmwmi.mif.gz -force warning: `/BinaryCache/coreTLS/coreTLS-35.40.1~1/Objects/coretls.build/coretls.build/Objects-normal/x86_64/system_coretls_vers.o': can't open to read symbols: No such file or directory. warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_ciphersuites.a" warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_handshake.a" warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_record.a" warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_stream_parser.a" tckgen: [WARNING] existing output files will be overwritten tckgen: [100%] uncompressing image "anat_5tt.mif.gz"... tckgen: [100%] uncompressing image "anat_gmwmi.mif.gz"... tckgen: [100%] uncompressing image "odf_wm.mif.gz"... tckgen: [100%] preloading data for "odf_wm.mif.gz" tckgen: [100%] uncompressing image "anat_5tt.mif.gz"... [New Thread 0x170b of process 429] [New Thread 0x2327 of process 429] [New Thread 0x2407 of process 429] [New Thread 0x2503 of process 429] [New Thread 0x2603 of process 429] [New Thread 0x2703 of process 429] tckge[New Thread 0x2803 of process 429] n: [ 0%[New Thread 0x2903 of process 429] ] 0 generated[New Thread 0x2b03 of process 429]

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x2327 of process 429] 0x000000010005f15a in MR::DWI::Tractography::ROI::contains(Eigen::Matrix<float, 3, 1, 0, 3, 1> const&) const ()

(gdb) backtrace

0 0x000000010005f15a in MR::DWI::Tractography::ROI::contains(Eigen::Matrix<float, 3, 1, 0, 3, 1> const&) const ()

1 0x000000010005f47b in MR::DWI::Tractography::Tracking::MethodBase::check_seed() ()

2 0x00000001000899b6 in MR::DWI::Tractography::Tracking::ExecMR::DWI::Tractography::Algorithms::iFOD2::gen_track(MR::DWI::Tractography::Tracking::GeneratedTrack&) ()

3 0x0000000100049287 in MR::Thread::(anonymous namespace)::Source<MR::DWI::Tractography::Tracking::GeneratedTrack, MR::Thread::(anonymous namespace)::Multi<MR::DWI::Tractography::Tracking::Exec > >::execute() ()

4 0x0000000100049751 in std::1::async_assoc_state<void, std::1::asyncfunc<void (MR::Thread::(anonymous namespace)::Source<MR::DWI::Tractography::Tracking::GeneratedTrack, MR::Thread::(anonymous namespace)::Multi<MR::DWI::Tractography::Tracking::Exec > >::)(), MR::Thread::(anonymous namespace)::Source<MR::DWI::Tractography::Tracking::GeneratedTrack, MR::Thread::(anonymous namespace)::Multi<MR::DWI::Tractography::Tracking::Exec > >_> >::__execute() ()

5 0x0000000100049621 in void* std::1::thread_proxy<std::1::tuple<void (std::1::async_assoc_state<void, std::1::__async_func<void (MR::Thread::(anonymous namespace)::Source<MR::DWI::Tractography::Tracking::GeneratedTrack, MR::Thread::(anonymous namespace)::Multi<MR::DWI::Tractography::Tracking::Exec > >::*)(), MR::Thread::(anonymous namesp---Type to continue, or q to quit---

ace)::Source<MR::DWI::Tractography::Tracking::GeneratedTrack, MR::Thread::(anonymous namespace)::Multi<MR::DWI::Tractography::Tracking::Exec > >> >::)(), std::1::async_assoc_state<void, std::1::asyncfunc<void (MR::Thread::(anonymous namespace)::Source<MR::DWI::Tractography::Tracking::GeneratedTrack, MR::Thread::(anonymous namespace)::Multi<MR::DWI::Tractography::Tracking::Exec > >::)(), MR::Thread::(anonymous namespace)::Source<MR::DWI::Tractography::Tracking::GeneratedTrack, MR::Thread::(anonymous namespace)::Multi<MR::DWI::Tractography::Tracking::Exec > >> >> >(void_) ()

6 0x00007fff893d905a in _pthread_body ()

from /usr/lib/system/libsystem_pthread.dylib

7 0x00007fff893d8fd7 in _pthread_start ()

from /usr/lib/system/libsystem_pthread.dylib

8 0x00007fff893d63ed in thread_start ()

from /usr/lib/system/libsystem_pthread.dylib

9 0x0000000000000000 in ?? ()

jdtournier commented 9 years ago

The chances of me having borked something in the porting process are close to 1. I haven't had a chance to thoroughly test all the features by any stretch... I really need to add some proper tests for tckgen to catch these issues, but there's just so many possibilities with this one, I haven't had the time. And there's also the issue that we haven't figured out a nice neat and sane way of actually comparing tractograms...

I'll get on the case when I have a minute, but if anyone feels like debugging this one, and/or adding more tests for tckgen, don't let me hold you back...

Lestropie commented 9 years ago

I'll be adding some tests for tckgen using the SIFT phantom as I catch up the testing repo with my latest ports.

jdtournier commented 9 years ago

:+1:

Lestropie commented 8 years ago

tckgen in updated_syntax currently passes all tests, which includes GMWMI seeding; will close this one now since a lot has changed in 3 months, can re-open or post a new issue if issues are found.