Fatal signal 10

Hello,

I am new to AFNI and am having some trouble running a script. We have made this script (DWI_do_01_QC.sh) to look at sagittal images all together for easier visual analysis of motion and striations on any individual slice to then aggregate and exclude. My colleague has run this script and it is working well on his machine, but I am receiving a “fatal signal 10” error message.

Below is what I am getting when I attempt to run the script with p187’s postop data.

Thank you!
Kayla Togneri
NINDS

(base) ndsl-imab-2469:dwi-proc tognerikm$ ./DWI_do_01_QC.sh -p p187
Precompiled binary macos_10.12_local: Apr 7 2023 (Version AFNI_23.1.00 ‘Publius Helvius Pertinax’)

** Version check disabled: AFNI_VERSION_CHECK forbids
Thanks go to LR Frank for “quick” questions

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 # tcsh
  • export DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace # bash
  • This command is best put in your startup ~/.cshrc file, so that
  • it will be invoked for every (t)csh shell you open (mutatis mutandis
  • for the bash shell, of course).
  • If things are OK and you want to avoid having this warning message
  • pollute your terminal, use this:
  • setenv AFNI_SKIP_DYLD_WARNING YES # tcsh
  • export AFNI_SKIP_DYLD_WARNING=YES # bash

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[The X.Org Foundation v 12101006].Warning: Widget must be a VendorShell.

Fatal Signal 10 (SIGBUS) received
open_MCW_imseq
SPLASH_popup_image
AFNI_splashup
MAIN_workprocess
AFNI:main
Bottom of Debug Stack
** AFNI version = AFNI_23.1.00 Compile date = Apr 7 2023
** [[Precompiled binary macos_10.12_local: Apr 7 2023]]
** 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/tognerikm/.afni.crashlog
++ AFNI is detached from terminal.
^C

QC! Near and dear to our hearts! Let’s fix this crash!

There is some suggestion perhaps in that crash message, but to be sure can we start with checking the system setup—could you please copy+paste the output of:


afni_system_check.py -check_all

?

–pt

Yes! Here is the output

(base) ndsl-imab-2469:~ tognerikm$ afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit
cpu type: i386
system: Darwin
release: 21.6.0
version: Darwin Kernel Version 21.6.0: Sun Nov 6 23:31:16 PST 2022; root:xnu-8020.240.14~1/RELEASE_X86_64
distribution: 10.16
number of CPUs: 8
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/tognerikm/abin/afni
afni version : Precompiled binary macos_10.12_local: Apr 7 2023
: AFNI_23.1.00 ‘Publius Helvius Pertinax’
AFNI_version.txt : AFNI_23.1.00, macos_10.12_local, Apr 07 2023
which python : /Users/tognerikm/anaconda3/bin/python
python version : 3.10.9
which R : /Library/Frameworks/R.framework/Resources/R
R version : R version 3.6.3 (2020-02-29) – “Holding the Windsock”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/tognerikm/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
python : 1 (/Users/tognerikm/anaconda3/bin/python3.10)
python2 : 0
python3 : 3
/Users/tognerikm/anaconda3/bin/python3.10
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7
/usr/bin/python3

** have python3 but not python2

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

checking for R packages…
rPkgsInstall -pkgs ALL -check : FAILURE

    oo Warning: 
       These packages are not installed on the computer: afex!
    These packages are not installed on the computer: brms!
    These packages are not installed on the computer: metafor!

R RHOME : /Library/Frameworks/R.framework/Resources

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

------------------------------ python libs -------------------------------
** failed to load module PyQt4
– PyQt4 is no longer needed for an AFNI bootcamp

++ module loaded: matplotlib.pyplot
module file : /Users/tognerikm/anaconda3/lib/python3.10/site-packages/matplotlib/pyplot.py
matplotlib version : 3.7.0

– python binaries under /usr/local/bin:
/usr/local/bin/python3 (sym link to /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7)
/usr/local/bin/python3.7 (sym link to /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7)

-------------------------------- env vars --------------------------------
PATH = /Users/tognerikm/anaconda3/bin:/Users/tognerikm/anaconda3/condabin:/Applications/freesurfer/7.3.2/bin:/Applications/freesurfer/7.3.2/fsfast/bin:/Applications/freesurfer/7.3.2/mni/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/tognerikm/abin:/Users/tognerikm/bin:/sw:/sw/sbin:/sw/bin:/usr/local/opt/python/libexec/bin:/Library/Frameworks/R.framework/Resources:/usr/local/gfortran/bin

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH (sub-shell) = /Applications/freesurfer/7.3.2/lib/gcc/lib:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) =

----------------------------- eval dot files -----------------------------

– good: .tcshrc seems to contain ‘source .cshrc’
– considered operations: path, flatdir, 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 2 modifications across 3 files:

  file             path  flatdir  apsearch        follower
  ---------------  ----  -------  --------        --------
  .cshrc           1     0        0               0     
  .tcshrc          0     0        0               1     
  .bashrc          0     0        1               0     

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME (953904M Avail)
top history: …Nov 2022 [rickr]: s05: added align_unifize_epi local
data dir : found AFNI_demos under $HOME
top history: NONE FOUND
data dir : found suma_demo under $HOME
top history: …s_New/data/Build_tmp on Mon Mar 4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /Users/tognerikm/abin

------------------------------ OS specific -------------------------------
XQuartz version : 2.8.5

which brew : /usr/local/bin/brew
brew version : Homebrew >=2.5.0 (shallow or no git repository)

– 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 = /Applications/freesurfer/7.3.2/lib/gcc/lib:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace
– recent OS X, cheating to check DYLD_LIBRARY_PATH in shell ‘tcsh’…
** env var DYLD_LIBRARY_PATH not set to contain /opt/X11/lib/flat_namespace

========================= summary, please fix: =========================

  • just be aware: login shell ‘bash’, but our code examples use ‘tcsh’
  • missing R packages (see rPkgsInstall)
  • dot file test : want 2 modifications across 3 files:
  • please set DYLD_LIBRARY_PATH to /opt/X11/lib/flat_namespace in tcsh

Hi Kayla,

Your script is given as SOMETHING.sh. If you actually use ‘sh’ to run it, those DYLD variables will probably not be set in that sub-shell. Does that apply, or is that script run via bash?

Would you specify exactly how you execute the DWI_do_01_QC.sh script?

Thanks,

  • rick

Hi Rick,

We run the script in a -bash terminal with ./DWI_do_01_QC.sh
I have also tried to run it with the command bash DWI_do_01_QC.sh and I receive the same fatal signal 10 message.

Thanks!
Kayla

That is interesting. If it is failing in bash, then maybe there is a discrepancy between whatever libXp is being shipped with FreeSurfer and the one that is otherwise on your system. But to be sure, let’s forget doing it from a script for now. Since your login shell is bash, just try running commands by hand.

  1. from your bash terminal, can you start afni?
  2. assuming that fails, would you first adjust the DYLD variable?
export DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace
afni

Does that work?

  • rick

Afni is opening up normally without adjusting the DYLD variable!

Cool, and to be sure, what is the output from

echo $0
echo $DYLD_LIBRARY_PATH

Thanks,

  • rick

Here is the output!

(base) ndsl-imab-2469:~ tognerikm$ echo $0
-bash
(base) ndsl-imab-2469:~ tognerikm$ echo $DYLD_LIBRARY_PATH
/Applications/freesurfer/7.3.2/lib/gcc/lib:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace

Thanks!
Kayla

Hi Kayla,

Then I am a little confused why the “bash SCRIPT” method failed. I will send you personal email to look more closely.
But just as a sanity check, in the script, before afni is run, can you add a similar line:

echo $DYLD_LIBRARY_PATH

Thanks,

  • rick

I am not sure what changed but QC was able to run, and AFNI opened! I do now receive the fatal signal 10 message when trying to run the next script in the pipeline though unfortunately (DWI_do_02.sh) .

Thanks Rick! We can correspond over email if this only pertains to me.
Kayla

Here is the output:

(base) ndsl-imab-2469:dwi-proc tognerikm$ ./DWI_do_02.sh p85

set: Variable name must begin with a letter.
++ Start imager script version: 2.32

++ My command:
@djunct_4d_imager -inset /Volumes/Shares/NEU/Data/sub-p85/ses-research/dwi/sub-p85_ses-research_acq-Siemens_dir-down_dwi.nii.gz -prefix /Volumes/Shares/NEU/Projects/DWI/p85/sel/qc_images/dwi_down
++ Found inset file: /Volumes/Shares/NEU/Data/sub-p85/ses-research/dwi/sub-p85_ses-research_acq-Siemens_dir-down_dwi.nii.gz
++ Making working directory: /Volumes/Shares/NEU/Projects/DWI/p85/sel/qc_images/__WORK_imgr_hkmLllQMrHV
\n-----> STARTING imager ---->
++ Iteration #1
++ Going to view slice [43]
+* WARNING: dset wasn’t floats, but will be converted
to float for image-making purposes!
++ Command line: [‘/Users/tognerikm/abin/adjunct_calc_mont_dims.py’, ‘45’, ‘padcombo.dat’]
++ OK, have my integer argument: 45
[1, 3, 5]
[45, 15, 9]
2 9 5 0.11246117974981074
++ OK! Good enough


++ final Nslices = 45 (pad = 0)
++ → Ncol x Nrow = 9 x 5

++ Slicing…
++ from3d: AFNI version=AFNI_23.1.00 (Apr 7 2023) [64-bit]
++ Authored by: B. Douglas Ward
++ …and gluing.
++ to3d: AFNI version=AFNI_23.1.00 (Apr 7 2023) [64-bit]
++ Authored by: RW Cox
++ It is best to use to3d via the Dimon program.
++ Counting images: total=45 2D slices
++ Each 2D slice is 110 X 110 pixels
++ Image data type = float
++ Reading images: …
++ 3D dataset written to disk
++ 3drefit: AFNI version=AFNI_23.1.00 (Apr 7 2023) [64-bit]
++ Authored by: RW Cox
++ Processing AFNI dataset padcombo.nii

  • deoblique
  • loading and re-writing dataset padcombo.nii (/Volumes/Shares/NEU/Projects/DWI/p85/sel/qc_images/__WORK_imgr_hkmLllQMrHV/padcombo.nii in NIFTI storage)
    ++ 3drefit processed 1 datasets
    set: Variable name must begin with a letter.
    ++ My command:
    @chauffeur_afni -ulay padcombo.nii -prefix dwi_down_qc_onescl_1 -olay_off -montx 9 -monty 5 -ulay_range 1% 99.5% -label_mode 1 -label_size 4 -image_label_ijk

++ Using AFNI ver : AFNI_23.1.00
++ chauffeur ver : 6.52
\n------------------ start of optionizing ------------------\n
++ Found input file: padcombo.nii
++ Using blowup factor: 2
++ Using opacity: 6
++ Making temporary work directory to copy vis files: ./__tmp_chauf_opsHEYymTbw
++ Converted 0 to labels
++ Final subbrick indices: -1 -1 -1
++ Copy ulay to visualize (volumetric) within user’s range:
++ Ulay to be visualized within user range:
[1%, 99.5%] → [0.000000, 652.000000]
++ 3dcalc: AFNI version=AFNI_23.1.00 (Apr 7 2023) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ././__tmp_chauf_opsHEYymTbw/tmp_ulay.nii
++ No overlay viewing
set: Variable name must begin with a letter.
++ Dimensions (xyzt): 110 110 45 1
++ (initial) Slice spacing ordered (x,y,z) is: 2 2 1
set: Variable name must begin with a letter.
set: Variable name must begin with a letter.
++ 3dmaskdump: AFNI version=AFNI_23.1.00 (Apr 7 2023) [64-bit]
++ Executing 3dcalc()
argv[0]=3dcalc argv[1]=-a argv[2]=padcombo.nii[0] argv[3]=-expr argv[4]=a argv[5]=-byte argv[6]=-session argv[7]=/var/folders/c0/g8w816m11w382s0kx795dtwnh1x3j0/T/ argv[8]=-prefix argv[9]=3dcalc_AFN_lLljuw0Nb7ByBPfsHs3Qog argv[10]=-verbose
++ 3dcalc: AFNI version=AFNI_23.1.00 (Apr 7 2023) [64-bit]
++ Authored by: A cast of thousands
++ Computing sub-brick 0
++ Scaling output to type byte brick(s)
++ Sub-brick 0 scale factor = 0.114350
++ Computing output statistics
++ Output dataset /var/folders/c0/g8w816m11w382s0kx795dtwnh1x3j0/T/3dcalc_AFN_lLljuw0Nb7ByBPfsHs3Qog+orig.BRIK
++ 544500 voxels in the entire dataset (no mask)
++ 1 voxels in the boxes and/or balls
++ Using only the boxes+balls mask
++ Will have: SET_IJK 55 54 22
\n------------------- end of optionizing -------------------\n
– trying to start Xvfb :73
[1] 54244

+++ Command Echo:
afni -q -no1D -noplugins -no_detach -com SWITCH_UNDERLAY tmp_ulay.nii -com SWITCH_OVERLAY tmp_ulay.nii -com SEE_OVERLAY - -com OPEN_WINDOW sagittalimage opacity=6 mont=9x5:2:0:black crop=0:0,0:0 -com OPEN_WINDOW coronalimage opacity=6 mont=9x5:2:0:black crop=0:0,0:0 -com OPEN_WINDOW axialimage opacity=6 mont=9x5:1:0:black crop=0:0,0:0 -com SET_PBAR_ALL -99 1 Plasma -com DO_NOTHING -com SET_SUBBRICKS -1 -1 -1 -com SET_ULAY_RANGE A.all 0.000000 652.000000 -com SET_FUNC_RANGE 0 -com SET_THRESHNEW 0 * -com SET_FUNC_ALPHA No -com SET_FUNC_BOXED No -com SET_FUNC_RESAM NN.NN -com SET_XHAIRS OFF -com SET_XHAIR_GAP -1 -com SET_IJK 55 54 22 -com SAVE_PNG axialimage ./dwi_down_qc_onescl_1.axi blowup=2 -com SAVE_PNG sagittalimage ./dwi_down_qc_onescl_1.sag blowup=2 -com SAVE_PNG coronalimage ./dwi_down_qc_onescl_1.cor blowup=2 -com QUITT ./__tmp_chauf_opsHEYymTbw

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ 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 # tcsh
  • export DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace # bash
  • This command is best put in your startup ~/.cshrc file, so that
  • it will be invoked for every (t)csh shell you open (mutatis mutandis
  • for the bash shell, of course).
  • If things are OK and you want to avoid having this warning message
  • pollute your terminal, use this:
  • setenv AFNI_SKIP_DYLD_WARNING YES # tcsh
  • export AFNI_SKIP_DYLD_WARNING=YES # bash

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Warning: Widget must be a VendorShell.

Fatal Signal 10 (SIGBUS) received
Last STATUS: creating top_form
AFNI_make_widgets
new_AFNI_controller
MAIN_workprocess
AFNI:main
Bottom of Debug Stack
** AFNI version = AFNI_23.1.00 Compile date = Apr 7 2023
** [[Precompiled binary macos_10.12_local: Apr 7 2023]]
** 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/tognerikm/.afni.crashlog
\n+* Removing temporary image directory ‘./__tmp_chauf_opsHEYymTbw’.\n
[1] + Done Xvfb :73 -screen 0 1024x768x24

++ DONE (good exit)
see: ./dwi_down_qc_onescl_1*

Just to follow up, we resolved this by fixing the .cshrc file.

  • rick