3dSkullStrip crashing

Hi everyone!

I was running 3dSkullStrip because sswarper2 chopped off some of the brain, and 3dSkullStrip kept crashing.

The command I used was:
3dSkullStrip -input subj.anat.ac+orig -push_to_edge -prefix subj.anat_ss

Please view below for one of the crash logs:

------ CRASH LOG ------------------------------**
Fatal Signal 11 (SIGSEGV) received
.......... recent internal history .........................................
mri_killpurge -- check if im==NULL ptr=0x2895a70
mri_killpurge -- can't killpurge NULL fname! {30 ms}
----------mri_killpurge [10]: EXIT} (file=mri_purger.c line=270) to mri_free {30 ms}
mri_free -- free im {30 ms}
---------mri_free [9]: EXIT} (file=mri_free.c line=69) to THD_delete_datablock {30 ms}
THD_delete_datablock -- free brick_ stuff {30 ms}
THD_delete_datablock -- KILL_KILL {31 ms}
THD_delete_datablock -- free attributes {31 ms}
--------THD_delete_datablock [8]: EXIT} (file=thd_delete.c line=122) to THD_delete_3dim_dataset {31 ms}
THD_delete_3dim_dataset -- KILL_KILL {31 ms}
-------THD_delete_3dim_dataset [7]: EXIT} (file=thd_delete.c line=179) to THD_is_dataset {31 ms}
------THD_is_dataset [6]: EXIT} (file=thd_opendset.c line=407) to init_global_atlas_list {31 ms}
++++++invert_affine [6]: {ENTRY (file=thd_atlas.c line=2026) from init_global_atlas_list {31 ms}
------invert_affine [6]: EXIT} (file=thd_atlas.c line=2049) to init_global_atlas_list {31 ms}
++++++invert_affine [6]: {ENTRY (file=thd_atlas.c line=2026) from init_global_atlas_list {31 ms}
------invert_affine [6]: EXIT} (file=thd_atlas.c line=2049) to init_global_atlas_list {31 ms}
++++++invert_affine [6]: {ENTRY (file=thd_atlas.c line=2026) from init_global_atlas_list {31 ms}
------invert_affine [6]: EXIT} (file=thd_atlas.c line=2049) to init_global_atlas_list {31 ms}
++++++invert_affine [6]: {ENTRY (file=thd_atlas.c line=2026) from init_global_atlas_list {31 ms}
------invert_affine [6]: EXIT} (file=thd_atlas.c line=2049) to init_global_atlas_list {31 ms}
-----init_global_atlas_list [5]: EXIT} (file=thd_ttatlas_query.c line=2246) to THD_open_one_dataset {31 ms}
+++++THD_3dim_from_ROIstring [5]: {ENTRY (file=thd_ttatlas_query.c line=8443) from THD_open_one_dataset {31 ms}
++++++ROI_String_Decode [6]: {ENTRY (file=thd_ttatlas_query.c line=3675) from THD_3dim_from_ROIstring {31 ms}
------ROI_String_Decode [6]: EXIT} (file=thd_ttatlas_query.c line=3711) to THD_3dim_from_ROIstring {31 ms}
-----THD_3dim_from_ROIstring [5]: EXIT} (file=thd_ttatlas_query.c line=8451) to THD_open_one_dataset {31 ms}
+++++THD_patch_brickim [5]: {ENTRY (file=thd_loaddblk.c line=1267) from THD_open_one_dataset {31 ms}
-----THD_patch_brickim [5]: EXIT} (file=thd_loaddblk.c line=1269) to THD_open_one_dataset {31 ms}
----THD_open_one_dataset [4]: EXIT} (file=thd_opendset.c line=359) to THD_open_dataset {31 ms}
++++THD_patch_brickim [4]: {ENTRY (file=thd_loaddblk.c line=1267) from THD_open_dataset {31 ms}
----THD_patch_brickim [4]: EXIT} (file=thd_loaddblk.c line=1269) to THD_open_dataset {31 ms}
---THD_open_dataset [3]: EXIT} (file=thd_mastery.c line=173) to 3dSkullStrip {31 ms}
............................................................................
3dSkullStrip
** AFNI compile date = May 30 2024
** [[Precompiled binary linux_centos_7_64: May 30 2024]]
** Program Crash **
~
~

Any recommendations or help would be appreciated. Thank you so much!

Hi-

To help investigate the crash, can you please copy+paste the output of:

afni_system_check.py -check_all

?

--pt

Here you go, I'd like to note that this is being ran on a slurm cluster.

[gatencio@login01 ~]$ afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              3.10.0-1160.31.1.el7.x86_64
version:              #1 SMP Thu Jun 10 13:32:12 UTC 2021
distribution:         CentOS Linux 7.9.2009 Core
number of CPUs:       32
apparent login shell: bash  (current shell is tcsh)
shell RC file:        .cshrc (does not exist)


--------------------- AFNI and related program tests ---------------------
which afni           : /opt/afni/24.1.16/afni
afni version         : Precompiled binary linux_centos_7_64: May 30 2024
                     : AFNI_24.1.16 'Publius Septimius Geta'
AFNI_version.txt     : AFNI_24.1.16, linux_centos_7_64, May 30 2024, official
which python         : /usr/bin/python
python version       : 2.7.5
which R              :


instances of various programs found in PATH:
    afni    : 1   (/opt/afni/24.1.16/afni)
    R       : 0
    python  : 1   (/usr/bin/python2.7)
    python2 : 1   (/usr/bin/python2.7)
    python3 : 1   (/usr/bin/python3.6)



testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    uber_subject.py      : success
    3dMVM                : FAILURE
        R: Command not found.
()
** missing binary library 'libR.so' in program R_io.so
()
------------------------ dependent program tests -------------------------
checking for dependent programs...


which tcsh           : /usr/bin/tcsh
tcsh version         : 6.18.01
which Xvfb           : /usr/bin/Xvfb


checking for R packages...
    rPkgsInstall -pkgs ALL -check : FAILURE
        R: Command not found.


R RHOME : R: Command not found.


------------------------------ python libs -------------------------------


** failed to load module matplotlib.pyplot
-- matplotlib.pyplot is required


** failed to load module flask
-- flask is not required, but is desirable


** failed to load module flask_cors
-- flask_cors is not required, but is desirable


-------------------------------- env vars --------------------------------
PATH                       = /opt/afni/24.1.16:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/home/gatencio/bin


PYTHONPATH                 =
R_LIBS                     =
LD_LIBRARY_PATH            =
DYLD_LIBRARY_PATH          =
DYLD_FALLBACK_LIBRARY_PATH =
CONDA_SHLVL                =
CONDA_DEFAULT_ENV          =


----------------------------- eval dot files -----------------------------
()
----------- AFNI $HOME files -----------
()
    .afnirc                   : missing
    .sumarc                   : missing
    .afni/help/all_progs.COMP : missing


--------- shell startup files ----------


   -- no .tcshrc, will create one as a follower of .cshrc
   -- considered operations: path, apsearch
   
   -- note: followers should not need edits, so edit flags should be 0
      (have 1 follower(s), which can be ignored)
   
   dot file test : want 4 modifications across 3 files:
   
      file             path  flatdir  apsearch        follower
      ---------------  ----  -------  --------        --------
      .tcshrc          0     0        0               1     
      .cshrc           1     0        1               0     
      .bashrc          1     0        1               0     
   
------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas    : found TT_N27+tlrc  under /opt/afni/24.1.16


------------------------------ OS specific -------------------------------
which yum            : /usr/bin/yum
yum version          : 3.4.3



=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  shell tcsh: missing setup file .cshrc
*  missing program: R
*  failure under initial "AFNI and related program tests"
*  'afni' executable is owned by root
*  AFNI programs show FAILURE
*  missing binary library: libR.so
*  missing R packages (see rPkgsInstall)
*  python library matplotlib is required
   (see AFNI install docs for details)
*  please run: cp /opt/afni/24.1.16/AFNI.afnirc ~/.afnirc
*  please run: "suma -update_env" for .sumarc
*  please run: apsearch -update_all_afni_help
*  dot file test : want 4 modifications across 3 files:
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)

Thanks!

Thanks for sharing that. I don't see anything obviously wrong for the 3dSkullStrip crash. (There are several other setup things that could be addressed for R, etc., if you need those later on.)

Does 3dSkullStrip crash like this on all datasets, or just this particular one? And could you please copy+paste the full output text? I think there are more direct function calls above the "crash log".

From checking previous instances with similar crashes, most related either to a sytem variable on a Mac or an error reading in files.

Just to check also, what is the output for voxel+matrix size for this input file:

3dinfo -ad3 -n4 subj.anat.ac+orig

?

--pt

Hi Paul, I ran the script in another directory and ended up working, looked like just an error on my end. Thanks for all your help!

I wonder if maybe it was an old shell where its fully set up ~/.*rc file hadn't been sourced or something? Hard to say, but glad to hear it is working now.

--pt