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.
However the code is written, an issue with memory allocation might be exacerbated depending upon how memory management is done on the platform. Memory management on MacOS is extremely aggressive about swapping out to disk well before physical RAM is in danger of being underrun.. Or it is virtually impossible to run out of physical RAM on macOS though things may slow down to a crawl and/or thrash. It might be informative to know if you are hitting memory limits in the cluster and in the container (where it crashes) - but for some reason not on MacOS. Similarly, it would be interesting to know if the memory error occurs when run on a stand alone linux workstation. - R. On May 17, 2023, at 16:27, Douglas N. Greve <dgr...@mgh.harvard.edu> wrote: External Email - Use Caution So 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 Caution Hello, I am trying to process several images with MiDeFace but running into issues with memory and uncaught exceptions.Of 50 images, about half are processed successfully. On the other half MiDeFace fails consistently. However, whether the images fail seems to depend on the platform. Here's what I've triedFailsfreesurfer-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 HPCDocker image from docker://freesurfer/freesurfer:7.3.2, (this is built on CentOS:7) Apple M1 Pro; 13.3.1Custom docker image (below), built and run on Apple M1 Pro; 13.3.1Succeedsfreesurfer-darwin-macOS-7.4.0.pkg, installed and run on Apple M1 Pro; 13.3.1So, I'm not sure whether this is a bug or something that I need to configure differently.############Example apptainer command$ 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/qaExample docker command> 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 0 900000-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 0 4000000000-4000001000 ---p 00000000 00:00 0 4000001000-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 0 4000a22000-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 0 4000a2b000-4000a2c000 rw-p 00000000 00:00 0 4000a2c000-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 0 4000e5e000-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 0 4001063000-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 0 40017c3000-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 0 4001cd3000-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 0 4001eea000-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 0 40022b8000-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 0 40024c1000-40024c2000 rw-p 00000000 00:00 0 40024c7000-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 0 40026dc000-4004767000 rw-p 00000000 00:00 0 400476a000-400c2f1000 rw-p 00000000 00:00 0 400db9d000-400e3c0000 rw-p 00000000 00:00 0 400e3c1000-401044c000 rw-p 00000000 00:00 0 401044d000-40215ba000 rw-p 00000000 00:00 0 40215bd000-4023648000 rw-p 00000000 00:00 0 4023649000-4023ec1000 rw-p 00000000 00:00 0 4023eca000-4023ecb000 rw-p 00000000 00:00 0 4024000000-4024021000 rw-p 00000000 00:00 0 4024021000-4028000000 ---p 00000000 00:00 0 ffffffffff600000-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 is MiDeface::SegFace()qemu: uncaught target signal 11 (Segmentation fault) - core dumpedSegmentation faultERROR:############# model: MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to behttps://github.com/freesurfer/freesurfer/blob/dev/Dockerfile# 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 Associatepsadil.github.io/psadil_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/1laBDOs68qgMCwS6DLNr5FqHfBCv5WY81hMckdEareZx45n31_KoxbJxWPKWgrXynXQXhsAm3pw_PYgeYVas3O5XO4IaHWamoLQ7e1JBkDtY-woiW2MmVlE-_vjNygF5JhbV5sU8A00XMkcRoiY0fEYq5VORMetPh7Gic0l7ZdQTveX8ae-wLS5FWdhjuI6-dOckYamuhXpt9NztbjPw9UQ2w2uvjnQsAEe5JIKdVFtTWnuZ_cEC26FscTU4ZdielFNQOkB1gI-y6BSjCFQc59MyoYIWXgYQa3DbYVjww_WkxqUr3ZD1fIxtnxBLGcdi1/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer_______________________________________________Freesurfer mailing listfreesur...@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline <https://www.massgeneralbrigham.org/complianceline> . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.