Summary of what happened:
I am running FreeSurfer on longitudinal MRI data of many subjects and sessions.
All subjects ran successfully, except for Step 1 of only one session. It terminated with a “*** stack smashing detected ***: terminated” error.
Command used (and if a helper script was used, a link to the helper script or the command generated):
#!/bin/bash -l
# step1_cross-sectional.sh
for sub in $(tail -n+2 $PARTICIPANTS | cut -f1) ; do
for ses in $(ls -d $IN/${sub}/ses-*/ | xargs -n1 basename); do
jobfile="job_${sub}_${ses}.sh"
{
echo '#!/bin/bash -l'
echo "#SBATCH --job-name=fs-${sub}-${ses}"
echo "#SBATCH --output $OUT/logs/step1_slurm-%j.out"
echo "#SBATCH --cpus-per-task=6"
echo "#SBATCH --mem=30GB"
echo "export FS_LICENSE=$LICENSE"
echo "module load freesurfer/8.1.0"
echo "recon-all -openmp 6 -all -i $IN/${sub}/${ses}/anat/*T1w.nii.gz -subjid ${sub}_${ses} -sd $OUT"
} > "$jobfile"
sbatch "$jobfile"
done
done
Version:
8.1.0
Environment (Docker, Singularity / Apptainer, custom installation):
Apptainer
Data formatted according to a validatable standard? Please provide the output of the validator:
BIDS
Relevant log outputs (up to 20 lines):
Computing Initial Surface Statistics
-face loglikelihood: -9.1698 (-4.5849)
-vertex loglikelihood: -5.9583 (-2.9791)
-normal dot loglikelihood: -3.5949 (-3.5949)
-quad curv loglikelihood: -5.7549 (-2.8775)
Total Loglikelihood : -24.4779
CORRECTING DEFECT 0 (vertices=14335, convex hull=3024, v0=295)
*** stack smashing detected ***: terminated
Command terminated by signal 6
@#@FSTIME 2025:10:07:13:15:38 mris_fix_topology N 18 e 43312.12 S 5.00 U 43305.63 P 99% M 1241132 F 532 R 191768 W 0 c 91984 w 1208 I 22268 O 3746 L 927.34 926.15 901.39
@#@FSLOADPOST 2025:10:08:01:17:30 mris_fix_topology N 18 527.53 350.50 473.21
Linux ood-19 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64 GNU/Linux
recon-all -s sub-WZC28M_ses-02 exited with ERRORS at Wed Oct 8 01:17:30 CEST 2025
Screenshots / relevant information:
I have tried rerunning (solved other issues), but it does not help.
Does anybody know what could be causing this problem and what the solution can be?
Thank you!