# Segmentation Fault Error with dwifslpreproc

**URL:** https://community.mrtrix.org/t/segmentation-fault-error-with-dwifslpreproc/8171
**Category:** Uncategorized
**Created:** [January 23, 2025, 5:42pm UTC](https://community.mrtrix.org/t/segmentation-fault-error-with-dwifslpreproc/8171 "2025-01-23T17:42:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![federico2000](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/f/ac91a4/32.png) [@federico2000](https://community.mrtrix.org/u/federico2000)
#### Post date: [January 23, 2025, 5:42pm UTC](https://community.mrtrix.org/t/segmentation-fault-error-with-dwifslpreproc/8171/1 "2025-01-23T17:42:21Z")

</div>

Dear MRtrix team, after launching dwifslpreproc I get a segmentation fault error.  
The command is:

`dwifslpreproc sub-01_den_unr.mif sub-01_den_preproc.mif -nocleanup -pe_dir AP -rpe_pair -se_epi b0_pair.mif -eddy_options " --slm=linear"`

I get the following output:

```auto
/usr/bin/dwifslpreproc:23: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.spawn import find_executable
dwifslpreproc: 
dwifslpreproc: Note that this script makes use of commands / algorithms that have relevant articles for citation; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES. Please consult the help page (-help option) for more information.
dwifslpreproc: 
dwifslpreproc: Generated scratch directory: /home/federico/Downloads/fede_trial_1/dwifslpreproc-tmp-KPS72H/
Command: mrconvert /home/federico/Downloads/fede_trial_1/sub-01_den_unr.mif /home/federico/Downloads/fede_trial_1/dwifslpreproc-tmp-KPS72H/dwi.mif -json_export /home/federico/Downloads/fede_trial_1/dwifslpreproc-tmp-KPS72H/dwi.json
Command: mrconvert /home/federico/Downloads/fede_trial_1/b0_pair.mif /home/federico/Downloads/fede_trial_1/dwifslpreproc-tmp-KPS72H/se_epi.mif
dwifslpreproc: Changing to scratch directory (/home/federico/Downloads/fede_trial_1/dwifslpreproc-tmp-KPS72H/)
dwifslpreproc: Total readout time not provided at command-line; assuming sane default of 0.1
Command: mrinfo dwi.mif -export_grad_mrtrix grad.b
dwifslpreproc: 1 spatial axis of DWIs has non-even size; this will be automatically padded for compatibility with topup, and the extra slice erased afterwards
Command: mrconvert se_epi.mif -coord 2 28 - | mrcat se_epi.mif - se_epi_pad2.mif -axis 2
Command: mrconvert dwi.mif -coord 2 28 - | mrcat dwi.mif - dwi_pad2.mif -axis 2
Command: mrconvert se_epi_pad2.mif topup_in.nii -import_pe_table se_epi_manual_pe_scheme.txt -strides -1,+2,+3,+4 -export_pe_table topup_datain.txt
Command: topup --imain=topup_in.nii --datain=topup_datain.txt --out=field --fout=field_map.nii.gz --config=/home/federico/fsl/etc/flirtsch/b02b0.cnf --verbose

dwifslpreproc: [ERROR] topup --imain=topup_in.nii --datain=topup_datain.txt --out=field --fout=field_map.nii.gz --config=/home/federico/fsl/etc/flirtsch/b02b0.cnf --verbose (dwifslpreproc:805)
dwifslpreproc: [ERROR] Information from failed command:
dwifslpreproc:
               /home/federico/fsl/share/fsl/bin/topup: line 2: 10509 Segmentation fault (core dumped) /home/federico/fsl/bin/topup "$@"
dwifslpreproc:
dwifslpreproc: [ERROR] For debugging, inspect contents of scratch directory: /home/federico/Downloads/fede_trial_1/dwifslpreproc-tmp-KPS72H/
dwifslpreproc: Scratch directory retained; location: /home/federico/Downloads/fede_trial_1/dwifslpreproc-tmp-KPS72H/

```

Is the segmentation fault caused by insufficient memory? The problem seems to arise when using the `topup` command

OS: Ubuntu 22.04.5  
RAM: 8 GB  
MRtrix3 Version: MRtrix 3.0.3

Thank you in advance,  
Regards,

Federico
