External Email - Use Caution
While I do no know and have not looked at the source code in question, if you lookup that error online, one explanation is memory corruption is happening by writing beyond the end of allocated memory, e.g., by using free(g) incorrectly.On May 17, 2023, at 16:27, Douglas N. Greve <dgreve@mgh.harvard.edu> wrote:External Email - Use CautionSo the same input volume will sometimes succeed and sometimes fail depending upon the platform?On 5/17/2023 12:05 PM, Patrick Sadil wrote:External Email - Use CautionHello,I am trying to process several images withMiDeFacebut running into issues with memory and uncaught exceptions.Of 50 images, about half are processed successfully. On the other halfMiDeFacefails consistently. However, whether the images fail seems to depend on the platform. Here's what I've tried
- Fails
- freesurfer-linux-centos7_x86_64-7.4.0.tar.gz install on HPC, CentOS Linux release 7.9.2009 (Core)
- freesurfer-linux-centos7_x86_64-7.3.2.tar.gz install on HPC, CentOS Linux release 7.9.2009 (Core)
- Apptainer image from docker://freesurfer/freesurfer:7.3.2, (this is built on CentOS:7) run on HPC
- Docker image from docker://freesurfer/freesurfer:7.3.2, (this is built on CentOS:7) Apple M1 Pro; 13.3.1
- Custom docker image (below), built and run on Apple M1 Pro; 13.3.1
- Succeeds
- freesurfer-darwin-macOS-7.4.0.pkg, installed and run on Apple M1 Pro; 13.3.1
So, I'm not sure whether this is a bug or something that I need to configure differently.############Exampleapptainercommand$ apptainer exec -e -B $(pwd):/data docker://freesurfer/freesurfer:7.3.2 mideface --i /data/volume.nii.gz --o /data/defaced.nii.gz --odir /data/qaExampledockercommand> docker run --rm -it -v $(pwd):/data freesurfer/freesurfer:7.3.2 mideface --i /data/volume.nii.gz --o /data/defaced.nii.gz --odir /data/qaExample "bare" command> mideface --i volume.nii.gz --o defaced.nii.gz --odir qa############On the CentOS runs, the error isMiDeface::SegFace()*** Error in `mri_defacer': double free or corruption (!prev): 0x000000000e4d64f0 ***======= Backtrace: =========/lib64/libc.so.6(+0x81329)[0x4001f6b329]mri_defacer[0x4b0ebe]mri_defacer[0x422c15]mri_defacer[0x415308]/lib64/libc.so.6(__libc_start_main+0xf5)[0x4001f0c555]mri_defacer[0x418367]======= Memory map: ========400000-700000 r-xp 00000000 fe:01 4223092 /usr/local/freesurfer/bin/mri_defacer700000-900000 ---p 00000000 00:00 0900000-908000 r--p 00300000 fe:01 4223092 /usr/local/freesurfer/bin/mri_defacer908000-932000 rw-p 00308000 fe:01 4223092 /usr/local/freesurfer/bin/mri_defacer932000-13ee1000 rw-p 00000000 00:00 04000000000-4000001000 ---p 00000000 00:00 04000001000-4000801000 rw-p 00000000 00:00 0 [stack]4000801000-4000823000 r-xp 00000000 fe:01 2527596 /usr/lib64/ld-2.17.so4000823000-4000a22000 ---p 00000000 00:00 04000a22000-4000a23000 r--p 00021000 fe:01 2527596 /usr/lib64/ld-2.17.so4000a23000-4000a24000 rw-p 00022000 fe:01 2527596 /usr/lib64/ld-2.17.so4000a24000-4000a27000 rw-p 00000000 00:00 04000a2b000-4000a2c000 rw-p 00000000 00:00 04000a2c000-4000a41000 r-xp 00000000 fe:01 2527648 /usr/lib64/libz.so.1.2.74000a41000-4000c40000 ---p 00015000 fe:01 2527648 /usr/lib64/libz.so.1.2.74000c40000-4000c41000 r--p 00014000 fe:01 2527648 /usr/lib64/libz.so.1..2.74000c41000-4000c42000 rw-p 00015000 fe:01 2527648 /usr/lib64/libz.so.1.2.74000c42000-4000c59000 r-xp 00000000 fe:01 2527629 /usr/lib64/libpthread-2.17.so4000c59000-4000e58000 ---p 00017000 fe:01 2527629 /usr/lib64/libpthread-2.17.so4000e58000-4000e59000 r--p 00016000 fe:01 2527629 /usr/lib64/libpthread-2.17.so4000e59000-4000e5a000 rw-p 00017000 fe:01 2527629 /usr/lib64/libpthread-2.17.so4000e5a000-4000e5e000 rw-p 00000000 00:00 04000e5e000-4000e60000 r-xp 00000000 fe:01 2527609 /usr/lib64/libdl-2.17.so4000e60000-4001060000 ---p 00002000 fe:01 2527609 /usr/lib64/libdl-2..17.so4001060000-4001061000 r--p 00002000 fe:01 2527609 /usr/lib64/libdl-2.17.so4001061000-4001062000 rw-p 00003000 fe:01 2527609 /usr/lib64/libdl-2.17.so4001062000-4001063000 rw-p 00000000 00:00 04001063000-4001164000 r-xp 00000000 fe:01 2527611 /usr/lib64/libm-2.17.so4001164000-4001363000 ---p 00101000 fe:01 2527611 /usr/lib64/libm-2.17.so4001363000-4001364000 r--p 00100000 fe:01 2527611 /usr/lib64/libm-2..17.so4001364000-4001365000 rw-p 00101000 fe:01 2527611 /usr/lib64/libm-2.17.so4001365000-400138a000 r-xp 00000000 fe:01 2527938 /usr/lib64/libgomp.so.1.0.0400138a000-4001589000 ---p 00025000 fe:01 2527938 /usr/lib64/libgomp.so.1.0.04001589000-400158a000 r--p 00024000 fe:01 2527938 /usr/lib64/libgomp.so.1.0.0400158a000-400158b000 rw-p 00025000 fe:01 2527938 /usr/lib64/libgomp.so.1.0..0400158b000-4001593000 r-xp 00000000 fe:01 2527607 /usr/lib64/libcrypt-2.17.so4001593000-4001792000 ---p 00008000 fe:01 2527607 /usr/lib64/libcrypt-2.17.so4001792000-4001793000 r--p 00007000 fe:01 2527607 /usr/lib64/libcrypt-2.17.so4001793000-4001794000 rw-p 00008000 fe:01 2527607 /usr/lib64/libcrypt-2.17.so4001794000-40017c3000 rw-p 00000000 00:00 040017c3000-40017ca000 r-xp 00000000 fe:01 2527633 /usr/lib64/librt-2.17.so40017ca000-40019c9000 ---p 00007000 fe:01 2527633 /usr/lib64/librt-2.17.so40019c9000-40019ca000 r--p 00006000 fe:01 2527633 /usr/lib64/librt-2.17.so40019ca000-40019cb000 rw-p 00007000 fe:01 2527633 /usr/lib64/librt-2.17.so40019cb000-4001ab4000 r-xp 00000000 fe:01 2123191 /usr/lib64/libstdc++.so.6.0.194001ab4000-4001cb4000 ---p 000e9000 fe:01 2123191 /usr/lib64/libstdc++.so.6.0.194001cb4000-4001cbc000 r--p 000e9000 fe:01 2123191 /usr/lib64/libstdc++.so.6.0.194001cbc000-4001cbe000 rw-p 000f1000 fe:01 2123191 /usr/lib64/libstdc++.so.6..0.194001cbe000-4001cd3000 rw-p 00000000 00:00 04001cd3000-4001ce8000 r-xp 00000000 fe:01 2123006 /usr/lib64/libgcc_s-4.8.5-20150702.so.14001ce8000-4001ee7000 ---p 00015000 fe:01 2123006 /usr/lib64/libgcc_s-4.8.5-20150702.so.14001ee7000-4001ee8000 r--p 00014000 fe:01 2123006 /usr/lib64/libgcc_s-4.8.5-20150702.so.14001ee8000-4001ee9000 rw-p 00015000 fe:01 2123006 /usr/lib64/libgcc_s-4.8.5-20150702.so.14001ee9000-4001eea000 rw-p 00000000 00:00 04001eea000-40020ae000 r-xp 00000000 fe:01 2527603 /usr/lib64/libc-2.17.so40020ae000-40022ad000 ---p 001c4000 fe:01 2527603 /usr/lib64/libc-2.17.so40022ad000-40022b1000 r--p 001c3000 fe:01 2527603 /usr/lib64/libc-2.17.so40022b1000-40022b3000 rw-p 001c7000 fe:01 2527603 /usr/lib64/libc-2.17.so40022b3000-40022b8000 rw-p 00000000 00:00 040022b8000-40022ba000 r-xp 00000000 fe:01 2527589 /usr/lib64/libfreebl3.so40022ba000-40024b9000 ---p 00002000 fe:01 2527589 /usr/lib64/libfreebl3.so40024b9000-40024ba000 r--p 00001000 fe:01 2527589 /usr/lib64/libfreebl3.so40024ba000-40024bb000 rw-p 00002000 fe:01 2527589 /usr/lib64/libfreebl3.so40024bb000-40024c0000 rw-p 00000000 00:00 040024c1000-40024c2000 rw-p 00000000 00:00 040024c7000-40024d3000 r-xp 00000000 fe:01 2527621 /usr/lib64/libnss_files-2.17.so40024d3000-40026d2000 ---p 0000c000 fe:01 2527621 /usr/lib64/libnss_files-2.17.so40026d2000-40026d3000 r--p 0000b000 fe:01 2527621 /usr/lib64/libnss_files-2.17.so40026d3000-40026d4000 rw-p 0000c000 fe:01 2527621 /usr/lib64/libnss_files-2.17.so40026d4000-40026da000 rw-p 00000000 00:00 040026dc000-4004767000 rw-p 00000000 00:00 0400476a000-400c2f1000 rw-p 00000000 00:00 0400db9d000-400e3c0000 rw-p 00000000 00:00 0400e3c1000-401044c000 rw-p 00000000 00:00 0401044d000-40215ba000 rw-p 00000000 00:00 040215bd000-4023648000 rw-p 00000000 00:00 04023649000-4023ec1000 rw-p 00000000 00:00 04023eca000-4023ecb000 rw-p 00000000 00:00 04024000000-4024021000 rw-p 00000000 00:00 04024021000-4028000000 ---p 00000000 00:00 0ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall]===============================================MiDeface::FaceIntensityStats()Mode2 12 12 4362qemu: uncaught target signal 6 (Aborted) - core dumpedAbortERROR:############With a docker image using Ubuntu base, the error isMiDeface::SegFace()qemu: uncaught target signal 11 (Segmentation fault) - core dumpedSegmentation faultERROR:############# DockerfileFROM ubuntu:22.04COPY freesurfer_ubuntu22-7.4.0_amd64.deb /tmp/fs.deb# installRUN apt-get update \&& apt-get install -y /tmp/fs.deb \&& rm -rf /var/lib/apt/lists/* \&& rm /tmp/fs.debCOPY license /usr/local/freesurfer/7.4.0/.license# setup fs envENV OS LinuxENV FREESURFER_HOME /usr/local/freesurfer/7.4.0ENV PATH ${FREESURFER_HOME}/bin:${FREESURFER_HOME}/fsfast/bin:${FREESURFER_HOME}/tktools:{$FREESURFER_HOME}/mni/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binENV FREESURFER ${FREESURFER_HOME}ENV SUBJECTS_DIR ${FREESURFER_HOME}/subjectsENV LOCAL_DIR ${FREESURFER_HOME}/localENV FSFAST_HOME ${FREESURFER_HOME}/fsfastENV FMRI_ANALYSIS_DIR ${FREESURFER_HOME}/fsfastENV FUNCTIONALS_DIR ${FREESURFER_HOME}/sessionsENV FS_LICENSE ${FREESURFER_HOME}/.license# set default fs optionsENV FS_OVERRIDE 0ENV FIX_VERTEX_AREA ""ENV FSF_OUTPUT_FORMAT nii.gz# mni env requirementsENV MINC_BIN_DIR ${FREESURFER_HOME}/mni/binENV MINC_LIB_DIR ${FREESURFER_HOME}/mni/libENV MNI_DIR ${FREESURFER_HOME}/mniENV MNI_DATAPATH ${FREESURFER_HOME}/mni/dataENV MNI_PERL5LIB ${FREESURFER_HOME}/mni/share/perl5ENV PERL5LIB ${FREESURFER_HOME}/mni/share/perl5Thanks!Patrick Sadil, PhD (he/him/his)Research Associate_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer