Segmentation fault

Hi all,

I have a small dicom file which I want to convert to the .mif format. This is the full debug info with error:

mrconvert 8b/ tb.mif -debug -info
mrconvert: [DEBUG] No config file found at "/etc/mrtrix.conf"
mrconvert: [INFO] reading config file "/home/tbilliet/.mrtrix.conf"...
mrconvert: [DEBUG] reading key/value file "/home/tbilliet/.mrtrix.conf"...
mrconvert: [INFO] opening image "8b/"...
mrconvert: [DEBUG] memory-mapping file "8b/IM-0001-0007.dcm"...
mrconvert: [DEBUG] file "8b/IM-0001-0007.dcm" mapped at 0x7efc0c59d000, size 2534656 (read-only)

mrconvert: [SYSTEM FATAL CODE: SIGSEGV (11)] Segmentation fault: Invalid memory access

The error remains if I use -nthreads 0 and I get the same error when applying mrinfo, or dcminfo on the data. I work on Linux Ubuntu 14.04.5 LTS and the version of mrtrix I am using is

== mrconvert 3.0_RC2-82-gbb77205e ==
64 bit release version, built Nov 10 2017, using Eigen 3.2.0

I must add that the system I’m working on was recently updated, including the mrtrix install, so not sure if it is related to one or the other. In any case, before those updates it worked.

Any idea what may cause this? I can share some of the data (1 dcm is 2.5Mb) if necessary.


Send me the data, I’ll take a look into it. :+1:

OK, this was due to empty fields in the DICOM header - presumably due to anonymisation. I’ve fixed the code to better handle this case. Pull request here. Please have a go yourself by checking out the branch DICOM_better_handling_of_empty_fields:

git checkout DICOM_better_handling_of_empty_fields

(don’t forget to revert to master afterwards, once pull request is merged: git checkout master; git pull; ./build).

Hi Donald,

Thanks for this fix. That did the trick!

Kind regards,