QA script fails following updates

Hello!

I got a new machine and installed AFNI using the new App. I’ve having an issue with a script that still runs on a machine that hasn’t been updated in a while. The new machine is running:

Mojave 10.14.5
X11- 2.7.11
AFNI_19.1.26 Compile date June 26, 2019

Below are the script, the error message and the output of my .cshrc file, which is where I’m suspicious the problem is.

thanks!

Stu

Script:

##############################################################################

Make a jpg (montage) of all the identified contrast in the

axial direction

and moves this to a directory you specify

##############################################################################
export ssid=“378”

#give a name for all the contrasts you are interested in
export contrast=" Cue_App Cue_Avo Fdb_Rew Fdb_Pun "
#set the subbrick identifier. For most purposes you would use the identifier to the T
#subbrick, as this is how the image is being thresholded.
declare -a subbrick=( 2 5 8 11 )
export datadir=“/Volumes/MILLER/PA_DATA/”
export picdir=“/Users/whistu/Desktop/fMRI/MILLER_PA/Check_images”
#identifier that will be part of the output filename, used to move pictures to your
#identified folder. Make sure this ID is unique in your results directory, otherwise
#more file will be moved than you would like
export ID=“PA
export anat=“anat_final.PA.0+tlrc”
export stats=“stats.PA_IND.3+tlrc”

#Xvfb (The X Windows Virtual Frame Buffer).
#Xvfb allows you to launch X windows (of which AFNI is one)
#without actually displaying the contents to your screen

which Xvfb :1 -screen 0 1024x768x24 &

for ssid_index in $ssid
do
let SubbrickIndex=0
for contrast_index in $contrast
do

	let SubbrickIndex=SubbrickIndex+1
	export FileName=$ssid_index$ID$contrast_index

	echo "************************************"
	echo the FileName = $FileName
	echo the SubbrickIndex = $SubbrickIndex
	echo the subbrick is ${subbrick[$SubbrickIndex-1]}
	echo the contrast is $contrast_index
	echo "************************************"


	cd "$datadir$ssid_index"/PA.0.results
	pwd
	
	DISPLAY=:1 afni	-com "OPEN_WINDOW A.axialimage mont=6x6:3 " \
			-com "SWITCH_UNDERLAY A.$anat" \
			-com 'SET_VIEW A.tlrc' \
			-com "SWITCH_OVERLAY A.$stats" \
			-com 'SET_XHAIRS A.OFF' \
			-com "SET_SUBBRICKS A 0 ${subbrick[$SubbrickIndex-1]} ${subbrick[$SubbrickIndex-1]} " \
			-com "SET_DICOM_XYZ A 0 0 0 " \
			-com 'SET_THRESHNEW A 0.05 *p' \
			-com 'SET_PBAR_NUMBER A.8' \
			-com 'SEE_OVERLAY A.+' \
			-com "SAVE_JPEG A.axialimage $FileName" \
			-com "QUIT"
	
done
sleep 5
mv *"$ID"* "$picdir"

done

killall Xvfb

Error Message:

[NERC134684:~/Desktop/fMRI/MILLER_PA] whistu% sh PullImages_Functional.sh


the FileName = 378_PA_Cue_App
the SubbrickIndex = 1
the subbrick is 2
the contrast is Cue_App


/Volumes/MILLER/PA_DATA/378/PA.0.results
Precompiled binary macos_10.12_local: Jun 26 2019 (Version AFNI_19.1.26 ‘Caligula’)

** Version check disabled: AFNI_VERSION_CHECK forbids
Thanks go to E Leibenluft for much encouragement

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].
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.1.26 Compile date = Jun 26 2019
** [[Precompiled binary macos_10.12_local: Jun 26 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/whistu/.afni.crashlog
++ AFNI is detached from terminal.

AFNI Crash log:

------ 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 {327 ms}
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq {327 ms}
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=36) to open_MCW_imseq {327 ms}
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq {327 ms}
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=36) to open_MCW_imseq {328 ms}
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq {328 ms}
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=36) to open_MCW_imseq {328 ms}
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq {328 ms}
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=36) to open_MCW_imseq {328 ms}
+++++++THD_find_executable [7]: {ENTRY (file=thd_getpathprogs.c line=27) from open_MCW_imseq {328 ms}
-------THD_find_executable [7]: EXIT} (file=thd_getpathprogs.c line=36) to open_MCW_imseq {328 ms}
+++++++SPLASH_imseq_getim [7]: {ENTRY (file=afni_splash.c line=442) from open_MCW_imseq {328 ms}
-------SPLASH_imseq_getim [7]: EXIT} (file=afni_splash.c line=464) to open_MCW_imseq {328 ms}
+++++++SPLASH_imseq_getim [7]: {ENTRY (file=afni_splash.c line=442) from open_MCW_imseq {328 ms}
++++++++mri_valpad_2D [8]: {ENTRY (file=mri_zeropad.c line=28) from SPLASH_imseq_getim {328 ms}
+++++++++mri_new_7D_generic [9]: {ENTRY (file=mri_new.c line=48) from mri_valpad_2D {328 ms}
---------mri_new_7D_generic [9]: EXIT} (file=mri_new.c line=142) to mri_valpad_2D {328 ms}
+++++++++mri_add_name [9]: {ENTRY (file=mri_add_name.c line=19) from mri_valpad_2D {328 ms}
---------mri_add_name [9]: EXIT} (file=mri_add_name.c line=24) to mri_valpad_2D {328 ms}
--------mri_valpad_2D [8]: EXIT} (file=mri_zeropad.c line=138) to SPLASH_imseq_getim {328 ms}
-------SPLASH_imseq_getim [7]: EXIT} (file=afni_splash.c line=484) to open_MCW_imseq {328 ms}
+++++++mri_free [7]: {ENTRY (file=mri_free.c line=49) from open_MCW_imseq {328 ms}
mri_free – call killpurge {328 ms}
++++++++mri_killpurge [8]: {ENTRY (file=mri_purger.c line=259) from mri_free {328 ms}
mri_killpurge – check if im==NULL ptr=0x7ff8d9501a00
mri_killpurge – can’t killpurge NULL fname! {328 ms}
--------mri_killpurge [8]: EXIT} (file=mri_purger.c line=270) to mri_free {328 ms}
mri_free – free ptr {328 ms}
mri_free – free im {328 ms}
-------mri_free [7]: EXIT} (file=mri_free.c line=67) to open_MCW_imseq {328 ms}
+++++++ISQ_record_button [7]: {ENTRY (file=imseq.c line=10962) from open_MCW_imseq {333 ms}

ISQ_record_button
open_MCW_imseq
SPLASH_popup_image
AFNI_splashup
MAIN_workprocess
AFNI:main
** AFNI compile date = Jun 26 2019
** [[Precompiled binary macos_10.12_local: Jun 26 2019]]
** Program Crash **

.cshrc file

if ( $?DYLD_LIBRARY_PATH ) then
setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace
else
setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace
endif

set path = ( $path /Users/whistu/abin )

if ( -f $HOME/.afni/help/all_progs.COMP ) then
source $HOME/.afni/help/all_progs.COMP
endif

set filec
set autolist
set nobeep
alias ls ls -G
alias ll ls -lG

It’s good to hear from you, Stu.

You are running that script with ‘sh’, so try making a similar update to .profile.

export DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace

You might as well be sure it is in .bashrc, too.

  • rick

Hi Rick,

I’m glad I haven’t used your goodwill and tolerance for my computer illiteracy :slight_smile: I’m definitely missing Harma.

Still no joy, but I’m betting I still don’t have something correct in terms of syntax. Same error as before.

I’ve posted my .profile and .bashrc files below.

thanks!

Stu

.profile

auto-inserted by @update.afni.binaries :

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

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

if ( $?DYLD_LIBRARY_PATH ) then
setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace
else
setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace
fi

export PATH=$PATH:/Users/whistu/abin
alias ls=“ls -G”
alias ll=“ls -lG”

if [ -f $HOME/.afni/help/all_progs.COMP.bash ]
then
. $HOME/.afni/help/all_progs.COMP.bash ]
fi

Hey Stu,

Sorry, I am travelling at the moment.

That looks good to me at a glance. Write a script (e.g., run.me) that just echoes that value, e.g.,

echo my DLP is $DYLD_LIBRARY_PATH, with contents:
ls $DYLD_LIBRARY_PATH

The run it (e.g. sh run.me) and get it to work (it should show libXt.6.dylib). I would not expect you to need to logout, but it is possible. Please let me know what it shows when run.

Note that since your .profile has (. $HOME/.bashrc), the other lines are not really needed.

  • rick

Hi Rick,

So something is definitely off… This is showing the files on ~/Desktop

[NERC134684:~/Desktop] whistu% sh show.me
my DLP is , with contents:
4_PullImages_Functional2_lin.sh Microsoft_Office_2019_VL_Serializer.pkg
AFNI_error_Stu.pdf Misc
Collaborations NCSI
Cox_ETAC2017.pdf NUNDA
Eprime and Presentation licenses.docx Presentations
Grants Reviews
HardDrive_inventory_12.13.17.xlsx fMRI
Hormones_DATA_2019-05-23_0950.csv gsl_1.9-10.3.tgz
IRB papers
Kids_stim show.me
Kim Schedule 2019-2020.docx temple
Manuscripts ~$m Schedule 2019-2020.docx

BUT…

[NERC134684:~/Desktop] whistu% echo my DLP is $DYLD_LIBRARY_PATH
my DLP is /opt/X11/lib/flat_namespace

I wonder if I screwed something up in the .bashrc?

Thanks!

Stu

Hi, Stuart-

Rick is on vacation this week, so I will try to step in to help, if I can. I will PM you instructions for sending your ~/.* files, so that I can take a look and see if something might be jamming up the works.

While those things will definitely need to be sorted out, it looks like you are driving AFNI to make images/snapshots of data. Please note that the @chauffeur_afni program was built to be a friendly wrapper for that process, trying to maintain looots of options and flexiblity.

@chauffeur_afni’s online version of help:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/programs/@chauffeur_afni_sphx.html#ahelp-chauffeur-afni
Several codified examples of snapshotting:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/tutorials/auto_image/auto_@chauffeur_afni.html

–pt

Hi Stu,

Yes, your .bashrc has a combination of tcsh and bash in there, with a structure of:

if () then
setenv
else
setenv
fi

That is mostly tcsh syntax, and it can all be deleted, since that variable should already be set on the prior line. Just delete the whole “if … else … fi” structure.

  • rick

Thanks so much Paul.

I’ll have a look at this now… a colleague wrote the other script and so I had been using that. I’ll check the chauffeur out.

Stu