realtime demo crashes

Dear AFNI experts,
I’m trying to run realtime demo 1 in the directory: AFNI_data6/realtime.demos. When I launch the script from the demo_1_run1 directory like this:
./demo.1.run1

I get this output:
Precompiled binary linux_ubuntu_16_64: Jan 6 2023 (Version AFNI_23.0.00 ‘Commodus’)

Thanks go to B Feige for advice and help

Initializing: X11[The X.Org Foundation v 12101003]… Widgets… Input files:[Global]
** Searching subdirectories of ‘./’ for data
AFNI_GLOBAL_SESSION = /usr/local/afni/bin/ 77 datasets
image count = 77
Timeseries.1D = 0 files read
.[tc]sv data = 0 files read
Path(s) to be searched for plugins:
/usr/local/afni/bin
** RTM: clearing Mask_Vals setting from Motion_Only
as AFNI_REALTIME_MP_HOST_PORT is unset
– no T2star_ref from env

Plugins = 49 libraries read
write compress= GZIP
RT: AFNI realtime plugin is active; cf. README.realtime document

++ NOTE: This version of AFNI was built Jan 6 2023 ++
++ NOTE: ‘Define Markers’ is hidden: right-click ‘DataDir’ to see it
++ NOTE: Use ‘-seehidden’ option to see which plugins are hidden
++ AFNI is detached from terminal.
RT: starting to listen for control stream.
[1] + Done afni -rt

ready to run Dimon
press enter to proceed…

Dimon version 4.30 (November 2, 2022) running, use to quit…

RT:---------------------------------------
RT: connected to control stream 127.0.0.1
RT: version 23 Jan 2020: ROIs_and_data
RT: init RT input via control channel
Can’t connect? tcp_connect[connect]: Connection refused
RT: waiting for data stream to become good.
ART: comm link to afni established at
– scanning for first volume

– first volume found (34 slices)
RT: receiving image metadata=472 bytes

PARSE RT Detrend: RT Options mode 0x0 polort -1 fwhm 0

– scanning for additional volumes…
– run 3: 1 2 RT: sending dataset rt.__001+orig with 2 bricks
to AFNI[A], session /usr/local/afni/bin/

Fatal Signal 11 (SIGSEGV) received
AFNI_autorange_label
AFNI_reset_func_range
AFNI_setup_viewing
AFNI_initialize_view
AFNI:main
Bottom of Debug Stack
** AFNI version = AFNI_23.0.00 Compile date = Jan 6 2023
** [[Precompiled binary linux_ubuntu_16_64: Jan 6 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 /home/wgraves/.afni.crashlog
3 ART: ** failed to transmit data to afni @ localhost
- closing afni connection
- iochan error: iochan_goodcheck: no longer alive
ART: exit: closing afni control channel
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 . . .

final run statistics:
volume info :
slices : 34
z_first : -43.93
z_last : 71.57
z_delta : 3.5
oblique : no
mos_nslices : 0

run #   3 : volumes =  67, first file (#0) = ../../EPI_run1/8HRBRAINAx2DGRE-00001.dcm

I’d appreciate any help you could give!

Best,
Will

Hi Will,

I am a bit confused by this. It looks like it is trying to write AFNI datasets to the /usr/local/afni/bin directory. But if you would have run the script from there, it would have failed earlier.

There isn’t a “cd /usr/local/afni/bin” command in your .cshrc file, is there? I am not sure what to think.

  • rick

Hmm, the only lines in my .tcshrc file that refer to /usr/local/afni/bin are these:

setenv AFNI_PLUGINPATH /usr/local/afni/bin
setenv AFNI_GLOBAL_SESSION /usr/local/afni/bin
set path = ( $path /usr/local/afni/bin )

If nothing about that strikes you as the culprit, I’ll try running the script line-by-line tomorrow and let you know how it goes.

-Will

This is odd, the problematic message appears to be:

RT: sending dataset rt.__001+orig with 2 bricks to AFNI[A], session /usr/local/afni/bin/

But it should be writing to the directory that you are in, not /usr/local/abin/bin.

Is there any chance that you have modified the demo.1.run script? Would you mind displaying your demo.1.run script?
And to be sure, exactly what directory is the script in?

Thanks,

  • rick

Hi Rick, sorry for the delayed response. Had meetings, etc. this morning.
Here’s the directory from which I’m running the demo.1.run1 script: /home/wgraves/Documents/oneSession_univar_class/AFNI_data6/realtime.demos/demo_1_run1
Also, I’m running this on a Linux machine in my lab that I’m accessing over Chrome Remote Desktop. But presumably that shouldn’t matter.
I do have the AFNI_GLOBAL_SESSION environment variable set to /usr/local/afni/bin. Could that be what’s confusing AFNI?
Anyway, as you requested, here’s the exact the contents of the demo.1.run1 I’m running (not modified from the download):


#!/bin/tcsh

# demo real-time data acquisition and motion detection with afni

# use environment variables in lieu of running the RT Options plugin
setenv AFNI_REALTIME_Registration       3D:_realtime
setenv AFNI_REALTIME_Graph              Realtime

# set outdir = afni
set outdir = run1.afni

if ( ! -d $outdir ) mkdir $outdir
cd $outdir

afni -rt &
cd ..           # return to starting directory



sleep 5

echo ""
echo ""
echo ready to run Dimon
echo -n press enter to proceed...
set stuff = $<

Dimon -rt -pause 400 -infile_prefix ../../EPI_run1/8HRBRAIN -quit

Also, I ran that script line-by-line. It crashes on the last line as before. But when I just enter this into the terminal by itself, I get no errors and it produces what look to me like reasonable output files:
Dimon -infile_prefix …/…/EPI_run1/8HRBRAIN -dicom_org -show_sorted_list -quit -save_details DETAILS -save_errors

Is there any chance that you have another ‘afni’ instance running under /usr/local/abin/bin?
What is the output from:

ps -C afni

If there are any other afni’s running, please shut them down and try again.

  • rick

When I run:
ps -C afni

This is what the terminal outputs:
PID TTY TIME CMD

-Will

Too bad… the mystery continues, sorry.

Could I see the output of : afni -get_processed_env
If you would prefer, please feel free to sent it via email, though maybe there is no need. It is up to you.

Also, please feel free to clear AFNI_GLOBAL_SESSION (env or .afnirc) and try again, just to see.
And to be sure, when you try again, would you first save the output from:

afni -available_npb

Thanks,

  • rick