# Segmentation fault (core dumped)

**URL:** <https://community.mrtrix.org/t/segmentation-fault-core-dumped/457>\
**Category:** Uncategorized\
**Created:** [September 20, 2016, 2:54pm UTC](https://community.mrtrix.org/t/segmentation-fault-core-dumped/457 "2016-09-20T14:54:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarbani](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@Sarbani](https://community.mrtrix.org/u/Sarbani)\
**Post date:** [September 20, 2016, 2:54pm UTC](https://community.mrtrix.org/t/segmentation-fault-core-dumped/457/1 "2016-09-20T14:54:44Z")

</div>

Hi  
I am getting segmentation fault error after creating the WM\_FODs and also a warning “Diffusion encoding of input file does not match number of image volumes; omitting gradient information from output image” while performing mrconvert WM\_FODs.mif … and then "segmentation fault " in mrview WM\_FODs.mif and in “tckgen WM\_FODs.mif 1M.tck -act TT.mif -backtrack -crop\_at\_gmwmi -seed\_dynamic WM\_FODs.mif -maxlength 250 -number 1M -cutoff 0.06”.  
I have also put the mrinfo of WM\_FODs,mif. But I am not be able to interpret what is causing the error “segmentation fault”.  
I have done these steps before with same set of HCP data (subject 100307) and it was successful. Now only thing which is different is ubuntu 16. 04, does that cause anything?

The commands execution snippet:

DQ77MK:~/HCP\_Data/2016-09-20/100307$ dwi2fod msmt\_csd DWI.mif RF\_WM.txt WM\_FODs.mif RF\_GM.txt GM.mif RF\_CSF.txt CSF.mif -mask nodif\_brain\_mask.nii.gz  
dwi2fod: [100%] uncompressing image "nodif\_brain\_mask.nii.gz"  
dwi2fod: [100%] performing multi-shell, multi-tissue CSD  
DQ77MK:~/HCP\_Data/2016-09-20/100307$ mrconvert WM\_FODs.mif - -coord 3 0 | mrcat CSF.mif GM.mif - tissueRGB.mif -axis 3  
mrconvert: [WARNING] Diffusion encoding of input file does not match number of image volumes; omitting gradient information from output image  
mrconvert: [100%] copying from “WM\_FODs.mif” to "/tmp/mrtrix-tmp-vQLG1q.mif"  
mrcat: [100%] concatenating "CSF.mif"  
mrcat: [100%] concatenating "GM.mif"  
mrcat: [100%] concatenating "/tmp/mrtrix-tmp-vQLG1q.mif"  
DQ77MK:~/HCP\_Data/2016-09-20/100307$ mrview tissueRGB.mif -odf.load\_sh WM\_FODs.mif  
Segmentation fault (core dumped)

DQ77MK:~/HCP\_Data/2016-09-20/100307$ tckgen WM\_FODs.mif 1M.tck -act 5TT.mif -backtrack -crop\_at\_gmwmi -seed\_dynamic WM\_FODs.mif -maxlength 250 -number 1M -cutoff 0.06  
tckgen: [100%] resampling ACT 5TT image to fixel image space  
tckgen: [100%] segmenting FODs  
Segmentation fault (core dumped)

DQ77MK:~/HCP\_Data/2016-09-20/100307$ mrinfo WM\_FODs.mif

* * *

Image: “WM\_FODs.mif”

* * *

Dimensions: 145 x 174 x 145 x 45  
Voxel size: 1.25 x 1.25 x 1.25 x 1  
Data strides: [-2 3 4 1]  
Format: MRtrix  
Data type: 32 bit float (little endian)  
Intensity scaling: offset = 0, multiplier = 1  
Transform: 1 0 0 -90  
-0 1 0 -126  
-0 0 1 -72  
comments: FSL5.0  
dw\_scheme: [288 entries]  
mrtrix\_version: 0.3.15-266-g2bf78387

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [September 20, 2016, 4:16pm UTC](https://community.mrtrix.org/t/segmentation-fault-core-dumped/457/2 "2016-09-20T16:16:56Z")

</div>

Am I correct in assuming that you’ve just switched to Ubuntu 16.04, and that these commands worked fine before on the same data running on a previous version of Ubuntu? If so, then the reason is most likely related to the particular version of Eigen that Ubuntu ships on 16.04, as in [this post](https://community.mrtrix.org/t/mrview-segmentationfault-core-dump-ubuntu-16-04/185).

Can I just check whether your MRtrix install is up to date? We [committed some changes a couple of weeks ago](https://github.com/MRtrix3/mrtrix3/pull/712) that were supposed to fix this problem, but it’s likely we might have missed some edge cases, which might not have been picked up in testing. If your install is more recent, then we’ll need to investigate these particular errors on our side. Maybe you can update with `git pull; ./build` and try again just to make sure…?

If that didn’t help, then the simplest fix is to download the stable release of Eigen - you’ll find [instructions to do this here](https://community.mrtrix.org/t/mrview-segmentationfault-core-dump-ubuntu-16-04/185/26?u=jdtournier).

---

<div class="post-metadata">

**Author:** ![Sarbani](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@Sarbani](https://community.mrtrix.org/u/Sarbani)\
**Post date:** [September 20, 2016, 4:27pm UTC](https://community.mrtrix.org/t/segmentation-fault-core-dumped/457/3 "2016-09-20T16:27:53Z")

</div>

Hi @jdtournier  
Thanks for the input.  
Yes I have switched to Ubuntu 16.04 but not very recently.  
I had updated the Eigen version for Ubuntu 16 .04 discarding the beta version and kept it in mrtrix3 folder.  
But recently I have deleted the mrtrix3 and re-cloned it again. So may be the latest eigen version has been deleted and again mrtix3 is working on eigen beta 1-2 version.  
So thanks for the insight, I will definitely start checking with eigen version.

Many thanks!  
Sarbani

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [September 20, 2016, 4:48pm UTC](https://community.mrtrix.org/t/segmentation-fault-core-dumped/457/4 "2016-09-20T16:48:50Z")

</div>

OK, that would explain it. If that was the issue, can you check how recent your MRtrix install was? If it was up to date (i.e. after the additions we made recently), yet still crashes out, then we have some work to do…

---

<div class="post-metadata">

**Author:** ![Sarbani](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@Sarbani](https://community.mrtrix.org/u/Sarbani)\
**Post date:** [September 21, 2016, 8:51am UTC](https://community.mrtrix.org/t/segmentation-fault-core-dumped/457/5 "2016-09-21T08:51:19Z")

</div>

Hi @jdtournier,  
Here is my reply:

1. Before today, I reinstall MRtrix on 19/09/16. (That’s the time the Eigen version was deleted from mrtrix3 folder).
2. But for safer side I again did git pull & ./build mrtrix.
3. I run the tckgen command but got the segmentation fault error.
4. I updated the Eigen version:-  
wget [http://bitbucket.org/eigen/eigen/get/3.2.8.tar.gz](http://bitbucket.org/eigen/eigen/get/3.2.8.tar.gz)  
tar xvfz 3.2.8.tar.gz  
rm -f 3.2.8.tar.gz  
mv eigen-eigen-\* eigen  
EIGEN\_CFLAGS="-isystem $(pwd)/eigen" ./configure

./build  
5. I run the tckgen command and it is running successfully.

Thanks  
Sarbani

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [September 21, 2016, 9:45am UTC](https://community.mrtrix.org/t/segmentation-fault-core-dumped/457/6 "2016-09-21T09:45:15Z")

</div>

Thanks for checking, that’s really useful. We’ll look into what we might have overlooked, and hopefully get it fixed properly…
