Afni crashing on startup

Having just updated the afni binaries (and also updated xquartz to 2.7.11), afni GUI now crashes on startup, without even opening a window. I cannot work out why. because the afni system check doesn’t find a problem, as far as I can tell.

The Terminal output is as follows:


Precompiled binary macos_10.12_local: Feb 15 2019 (Version AFNI_19.0.14 'Tiberius')

Thanks go to J Kummer for inspiration

Initializing: X11
++ If you are using XQuartz 2.7.10 (or later), and AFNI crashes when
 + opening windows, or you cannot type text into AFNI popup windows,
 + you might need to set an environment variable to solve this problem:
 +   setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace
 + This command is best put in your startup ~/.cshrc file, so that
 + it will be invoked for every (t)csh shell you open.

[The X.Org Foundation v 11804000].
++++++++ IMAGE SAVE SETUP WARNINGS ++++++++
++ Can't find program ppmtogif AND/OR ppmquant for Save to GIF
++ Can't find program ppmtobmp for Save to BMP
++ Can't find program pnmtopng for Save to PNG
++ Some of the missing image Save programs are in
++  the netpbm software package, which is freeware.
++  The 'fink' package at http://fink.sourceforge.net/
++  is a way to get the netpbm programs for OS X; *OR*
++  Netpbm can be found at http://netpbm.sourceforge.net/
++ To disable these warnings, set environment
++  variable AFNI_IMSAVE_WARNINGS to 'NO'.
+++++++++++++++++++++++++++++++++++++++++++

Fatal Signal 11 (SIGSEGV) received
       ISQ_record_button
      open_MCW_imseq
     SPLASH_popup_image
    AFNI_splashup
   MAIN_workprocess
  AFNI:main
 Bottom of Debug Stack
** AFNI version = AFNI_19.0.14  Compile date = Feb 15 2019
** [[Precompiled binary macos_10.12_local: Feb 15 2019]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /Users/hb435/.afni.crashlog
++ AFNI is detached from terminal.

The crashlog is as follows:


*********------ CRASH LOG ------------------------------***********
Fatal Signal 11 (SIGSEGV) received
.......... recent internal history .........................................
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=39) to open_MCW_imseq
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=39) to open_MCW_imseq
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=36) to open_MCW_imseq
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=39) to open_MCW_imseq
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=39) to open_MCW_imseq
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=39) to open_MCW_imseq
+++++++SPLASH_imseq_getim [7]: {ENTRY (file=afni_splash.c line=442) from open_MCW_imseq
-------SPLASH_imseq_getim [7]: EXIT} (file=afni_splash.c line=464) to open_MCW_imseq
+++++++SPLASH_imseq_getim [7]: {ENTRY (file=afni_splash.c line=442) from open_MCW_imseq
++++++++mri_valpad_2D [8]: {ENTRY (file=mri_zeropad.c line=28) from SPLASH_imseq_getim
+++++++++mri_new_7D_generic [9]: {ENTRY (file=mri_new.c line=48) from mri_valpad_2D
---------mri_new_7D_generic [9]: EXIT} (file=mri_new.c line=142) to mri_valpad_2D
+++++++++mri_add_name [9]: {ENTRY (file=mri_add_name.c line=19) from mri_valpad_2D
---------mri_add_name [9]: EXIT} (file=mri_add_name.c line=24) to mri_valpad_2D
--------mri_valpad_2D [8]: EXIT} (file=mri_zeropad.c line=138) to SPLASH_imseq_getim
-------SPLASH_imseq_getim [7]: EXIT} (file=afni_splash.c line=484) to open_MCW_imseq
+++++++mri_free [7]: {ENTRY (file=mri_free.c line=49) from open_MCW_imseq
       mri_free -- call killpurge
++++++++mri_killpurge [8]: {ENTRY (file=mri_purger.c line=259) from mri_free
        mri_killpurge -- check if im==NULL ptr=0x7fc72e802cc0
        mri_killpurge -- can't killpurge NULL fname!
--------mri_killpurge [8]: EXIT} (file=mri_purger.c line=270) to mri_free
       mri_free -- free ptr
       mri_free -- free im
-------mri_free [7]: EXIT} (file=mri_free.c line=67) to open_MCW_imseq
+++++++ISQ_record_button [7]: {ENTRY (file=imseq.c line=10947) from open_MCW_imseq
............................................................................
       ISQ_record_button
      open_MCW_imseq
     SPLASH_popup_image
    AFNI_splashup
   MAIN_workprocess
  AFNI:main
** AFNI compile date = Feb 15 2019
** [[Precompiled binary macos_10.12_local: Feb 15 2019]]
** Program Crash **

And checking the system check gives the following:


-------------------------------- general ---------------------------------
architecture:         64bit 
system:               Darwin
release:              16.6.0
version:              Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64
distribution:         10.12.5 x86_64
number of CPUs:       12
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /usr/local/abin/afni
afni version         : Precompiled binary macos_10.12_local: Feb 15 2019 
                     : AFNI_19.0.14 'Tiberius'
AFNI_version.txt     : AFNI_19.0.14, macos_10.12_local, Feb 15 2019
which python         : /usr/bin/python
python version       : 2.7.10
which R              : /usr/local/bin/R
R version            : R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
which tcsh           : /bin/tcsh

instances of various programs found in PATH:
    afni    : 1   (/usr/local/abin/afni)
    R       : 1   (/Library/Frameworks/R.framework/Versions/3.4/Resources/bin/R)
    python  : 1   (/usr/bin/python)
    python2 : 0 
    python3 : 0 


testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    uber_subject.py      : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success

checking for R packages...
    rPkgsInstall -pkgs ALL -check : success

checking for $HOME files...
    .afnirc                   : found
    .sumarc                   : found
    .afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
** python module not found: PyQt4
-- PyQt4 is no longer needed for an AFNI bootcamp

-------------------------------- env vars --------------------------------
PATH = /usr/local/xcede/bin:/usr/local/dicomtools:/usr/local/fsl/bin:/usr/local/abin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

PYTHONPATH = 
R_LIBS = 
LD_LIBRARY_PATH = 
DYLD_LIBRARY_PATH (sub-shell) = :/opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH = /opt/X11/lib:/usr/local/abin


------------------------------ 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 /usr/local/abin

------------------------------ OS specific -------------------------------
which brew           : /usr/local/bin/brew
brew version         : 0.9.5

-- for PyQt4 under brew, consider running:
   brew install cartr/qt4/pyqt
-- consider installing gcc under homebrew
-- consider installing glib under homebrew
++ found 1 dylib files under '/opt/X11/lib/flat_namespace'
   -- found 'libXt' dylib files:
      /opt/X11/lib/flat_namespace/libXt.6.dylib
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell 'bash'...
++ found evar DYLD_LIBRARY_PATH = :/opt/X11/lib/flat_namespace
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in shell 'tcsh'...
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

=========================  summary, please fix:  =========================
*  login shell 'bash', trusting user to translate code examples from 'tcsh'
*  shell bash: consider sourcing (non-login) .bashrc from (login) .profile
*  insufficient data for AFNI bootcamp

Hi Henry,

It seems likely that this is just from the XQuartz upgrade. First, check things from the command line:

export DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace
afni

Does that work? If so, try first opening a new Terminal window and running afni from there. You might even have to logout.

It depend on which startup files (e.g. .bashrc) you used. Since the afni_system_check.py output seems happy, perhaps just opening a new Terminal will work.

  • rick

Running that does work. But opening a new window (or restarting the computer and opening a new window) fails again.

The .bashrc file doe shave the DYLD_LIBRARY_PATH set, and is as follows:


#setup AFNI
export PATH=/usr/local/abin:$PATH
export DYLD_FALLBACK_LIBRARY_PATH=/opt/X11/lib:/usr/local/abin

#setup FSL
FSLDIR=/usr/local/fsl
. ${FSLDIR}/etc/fslconf/fsl.sh
PATH=${FSLDIR}/bin:${PATH}
export FSLDIR PATH

#setup dcm2nii and haskins_fmri_timer
export PATH=/usr/local/dicomtools:$PATH

#setup fBIRN QA checking
export PATH=/usr/local/xcede/bin:$PATH

#setup Freesurfer
export FREESURFER_HOME=/usr/local/freesurfer
alias freesurfer="source $FREESURFER_HOME/SetUpFreeSurfer.sh"

alias sinatra="sinatra.haskins.yale.internal"
 export DYLD_LIBRARY_PATH=$\{DYLD_LIBRARY_PATH\}:/opt/X11/lib/flat_namespacemile

I wonder if this line at the end of that ~/.bashrc file is causing the problem, with some rough formatting and an odd string ‘mile’ attached at the end:


export DYLD_LIBRARY_PATH=$\{DYLD_LIBRARY_PATH\}:/opt/X11/lib/flat_namespacemile

?

What if you replace it with:


export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace

and then open a new terminal and try to run AFNI there?

–pt

My apologies, that was a bad copy-paste from terminal, the “mile” is just the beginning of the the PS1 string at the beginning of the next input line. The line in .bashrc is as you suggested above, and the problem persists.

Did you try logging out? Are you using .bash_profile for new Terminals? It is hard to debug remotely, since it depends how your bash environment is set up.

If logging out and back in does not work, please run:

afni_system_check.py -dot_file_pack henry_dotfiles.tgz

and send me the tgz file via email.

Thanks,

  • rick