SIGSEV error when trying to use rtfeedme

Versions of relevant programs:

  • MacOS 10.15.7 “Catalina” (I know, I know…)
  • AFNI 2021-03-24
  • Xquartz 2.8.0

In one terminal, with the following environment variable modifications:
export AFNI_REALTIME_Registration=3D:_realtime
export AFNI_REALTIME_Base_Image=2
export AFNI_REALTIME_Graph=Realtime
export AFNI_REALTIME_MP_HOST_PORT=localhost:53214
export AFNI_REALTIME_SEND_VER=YES
export AFNI_REALTIME_SHOW_TIMES=YES
export AFNI_REALTIME_Mask_Vals=ROI_means
export AFNI_REALTIME_Function=FIM
I launch afni -rt, which successfully loads the standard AFNI viewer.
In a separate terminal, I run
rtfeedme FILE
and no matter what I file I send, I receive the following error message:

++++++++ IMAGE SAVE SETUP WARNINGS ++++++++
++ Can’t find program ffmpeg for Save to MPEG-1
++ To disable these warnings, set environment
++ variable AFNI_IMSAVE_WARNINGS to ‘NO’.
+++++++++++++++++++++++++++++++++++++++++++++
. Widgets… Input files:+/Users/tevesjb/AFNI
session # 1 = tevesjb/AFNI/ ==> 54 datasets
dataset count = 54
Time series = 0 files read
.[tc]sv data = 4 files read
Path(s) to be searched for plugins:
/Users/tevesjb/AFNI /Users/tevesjb/AFNI/…/lib
++ AFNI is detached from terminal.
(base) tevesjb@MH02217074MACLT AFNI % – no T2star_ref from env

Plugins = 49 libraries read
RT: AFNI realtime plugin is active; cf. README.realtime document
RT: starting to listen for control stream.

++ NOTE: This version of AFNI was built Mar 24 2021 ++
++ NOTE: ‘Define Markers’ is hidden: right-click ‘DataDir’ to see it
++ NOTE: Use ‘-seehidden’ option to see which plugins are hidden
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
RT: waiting for data stream to become good.
RT: receiving image metadata=164 bytes
RT TIME (starting to receive realtime data): 2261 sec, 175 ms (0 ms passed)

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

Has shared memory buffer gone bad? shm_nattach[shmctl]: Invalid argument
RT: finish channel 01 with 1 bricks completed.
RT: cpu time = 0.02 elapsed time = 0.29
RT: sending dataset rt.__001+orig with 1 bricks
to AFNI[A], session /Users/tevesjb/AFNI/

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_21.0.21 Compile date = Mar 24 2021
** [[Precompiled binary macos_10.12_local: Mar 24 2021]]

Additional notes:
I checked previous notes, and saw that DYLD_LIBRARY_PATH can be an issue, so I double-checked that environment variable:
:/opt/X11/lib/flat_namespace

Any ideas what might be going on?

Perhaps using “rtfeedme -host localhost” will help. This will force the transmission of data via TCP/IP rather than shared memory (shm or SHM) – the first error message I see is related to shared memory usage.

Shared memory is a faster way to transfer large blocks of information between programs that are on the same computer system. It has the drawback that it is sometimes flaky. I spent a great deal of time trying to reduce that problem, but was never able to banish it entirely.

Rick Reynold is now in charge of the realtime part of AFNI (among many other things), and he might have some further insights.

Unfortunately the issue remains, but at least now we’re rid of the shared memory issue:

RT: connected to control stream 127.0.0.1
RT: version 23 Jan 2020: ROIs_and_data
RT: init RT input via control channel
RT: waiting for data stream to become good.
RT: receiving image metadata=164 bytes
RT TIME (starting to receive realtime data): 2128 sec, 434 ms (0 ms passed)

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

RT: finish channel 01 with 1 bricks completed.
RT: cpu time = 0.02 elapsed time = 0.39
RT: sending dataset rt.__001+orig with 1 bricks
to AFNI[A], session /Users/tevesjb/Downloads/jt_rt/rt_try/Realtime/

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_21.0.21 Compile date = Mar 24 2021
** [[Precompiled binary macos_10.12_local: Mar 24 2021]]
** 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/tevesjb/.afni.crashlog

Hi Josh,

I have no problem with this on my system. So to be sure, would you please start plugouts, either from the GUI or by changing the afni command to:

afni -rt -yesplugouts

Then instead of running rtfeedme, just try:

plugout_drive -com 'GETENV DYLD_LIBRARY_PATH' -quit

Does that show flat_namespace?

Thanks,

  • rick

Hi Rick,
This is the result after real-time AFNI begins listening:

RT: starting to listen for control stream.
PO: plugout connection from host 127.0.0.1 (tcp:*:7955)
PO: plugout connection name is plugout_drive
DYLD_LIBRARY_PATH = :/opt/X11/lib/flat_namespace
PO: plugout ‘plugout_drive’ has broken connection!
: iochan_goodcheck: no longer alive

This is a bit peculiar. For reference, I can run those commands on my 10.14 mac.

If you run the script but not rtfeedme, are there any issues looking at datasets in that directory?
Do the __001 (etc.) datasets exist? Can you view them with the GUI?

  • rick

If you run the script but not rtfeedme, are there any issues looking at datasets in that directory?

I’m not sure what the script is in this context, but there are no issues loading the files in the AFNI viewer in the directory where I’m calling rtfeedme

Do the __001 (etc.) datasets exist? Can you view them with the GUI?

They are not generated when I run rtfeedme, no.

Sorry about the delay, apparently I didn’t send my draft and then it disappeared in a swarm of tabs.

Rick, on a different Ubuntu machine it does not show flat_namespace (In fact, DYLD_LIBRARY_PATH is entirely blank). What should I make sure gets linked?

Further update: after building AFNI from the MacOS 10.15 makefile, I still see a shared memory error, but no longer receive SIGSEV and AFNI appears to be receiving real-time data. Perhaps an issue with the way things are configured in the default MacOS binaries?