suma crash on Monterey/M1

Hi all,
I compiled afni/suma on a MacBook Pro with an M1. AFNI works well, but SUMA is crashing non-trivially. Crash log attached.
It seems like there may be an issue with a UI event call?
I was running ./suma in a directory without any surface files, expecting for the toy surfaces to load.

Here’s the output of otool -L (Mac equivalent of ldd):
suma:
/opt/homebrew/opt/openmotif/lib/libXm.4.dylib (compatibility version 5.0.0, current version 5.4.0)
/opt/homebrew/opt/jpeg/lib/libjpeg.9.dylib (compatibility version 14.0.0, current version 14.0.0)
/opt/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/X11/lib/libXft.2.dylib (compatibility version 6.0.0, current version 6.3.0)
/opt/X11/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0)
/opt/X11/lib/libpng16.16.dylib (compatibility version 55.0.0, current version 55.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/X11/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/homebrew/opt/libxp/lib/libXp.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/X11/lib/libXpm.4.dylib (compatibility version 16.0.0, current version 16.0.0)
/opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/opt/X11/lib/libX11.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 8.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
/opt/X11/lib/libGLU.1.dylib (compatibility version 5.0.0, current version 5.1.0)
/opt/X11/lib/libGL.1.dylib (compatibility version 4.0.0, current version 4.0.0)
/opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 7001.0.0, current version 7001.2.0)
/opt/homebrew/opt/gcc/lib/gcc/11/libgcc_s.1.1.dylib (compatibility version 1.0.0, current version 1.1.0)

------ CRASH LOG ------------------------------**
Fatal Signal 11 (SIGSEGV) received
… recent internal history …
----SUMA_DimSclFac [4]: EXIT} (file=SUMA_SVmanip.c line=48) to SUMA_Alloc_SurfaceViewer_Struct {176 ms}
++++SUMA_Alloc_Axis [4]: {ENTRY (file=SUMA_CreateDO.c line=5090) from SUMA_Alloc_SurfaceViewer_Struct {176 ms}
----SUMA_Alloc_Axis [4]: EXIT} (file=SUMA_CreateDO.c line=5140) to SUMA_Alloc_SurfaceViewer_Struct {176 ms}
++++SUMA_Alloc_CrossHair [4]: {ENTRY (file=SUMA_CreateDO.c line=16774) from SUMA_Alloc_SurfaceViewer_Struct {176 ms}
+++++SUMA_DimSclFac [5]: {ENTRY (file=SUMA_SVmanip.c line=23) from SUMA_Alloc_CrossHair {176 ms}
++++++SUMA_EnvVal [6]: {ENTRY (file=suma_utils.c line=3499) from SUMA_DimSclFac {176 ms}
------SUMA_EnvVal [6]: EXIT} (file=suma_utils.c line=3509) to SUMA_DimSclFac {176 ms}
-----SUMA_DimSclFac [5]: EXIT} (file=SUMA_SVmanip.c line=48) to SUMA_Alloc_CrossHair {176 ms}
+++++SUMA_DimSclFac [5]: {ENTRY (file=SUMA_SVmanip.c line=23) from SUMA_Alloc_CrossHair {176 ms}
++++++SUMA_EnvVal [6]: {ENTRY (file=suma_utils.c line=3499) from SUMA_DimSclFac {176 ms}
------SUMA_EnvVal [6]: EXIT} (file=suma_utils.c line=3509) to SUMA_DimSclFac {176 ms}
-----SUMA_DimSclFac [5]: EXIT} (file=SUMA_SVmanip.c line=48) to SUMA_Alloc_CrossHair {176 ms}
+++++SUMA_DimSclFac [5]: {ENTRY (file=SUMA_SVmanip.c line=23) from SUMA_Alloc_CrossHair {176 ms}
++++++SUMA_EnvVal [6]: {ENTRY (file=suma_utils.c line=3499) from SUMA_DimSclFac {176 ms}
------SUMA_EnvVal [6]: EXIT} (file=suma_utils.c line=3509) to SUMA_DimSclFac {176 ms}
-----SUMA_DimSclFac [5]: EXIT} (file=SUMA_SVmanip.c line=48) to SUMA_Alloc_CrossHair {176 ms}
----SUMA_Alloc_CrossHair [4]: EXIT} (file=SUMA_CreateDO.c line=16840) to SUMA_Alloc_SurfaceViewer_Struct {176 ms}
++++SUMA_AdoptGroup [4]: {ENTRY (file=SUMA_SVmanip.c line=5501) from SUMA_Alloc_SurfaceViewer_Struct {176 ms}
+++++SUMA_WhichGroup [5]: {ENTRY (file=SUMA_SVmanip.c line=6116) from SUMA_AdoptGroup {176 ms}
-----SUMA_WhichGroup [5]: EXIT} (file=SUMA_SVmanip.c line=6127) to SUMA_AdoptGroup {176 ms}
+++++SUMA_copy_string [5]: {ENTRY (file=suma_utils.c line=2543) from SUMA_AdoptGroup {176 ms}
-----SUMA_copy_string [5]: EXIT} (file=suma_utils.c line=2556) to SUMA_AdoptGroup {176 ms}
----SUMA_AdoptGroup [4]: EXIT} (file=SUMA_SVmanip.c line=5511) to SUMA_Alloc_SurfaceViewer_Struct {176 ms}
++++SUMA_SetObjectDisplayOrder [4]: {ENTRY (file=SUMA_SVmanip.c line=468) from SUMA_Alloc_SurfaceViewer_Struct {176 ms}
----SUMA_SetObjectDisplayOrder [4]: EXIT} (file=SUMA_SVmanip.c line=479) to SUMA_Alloc_SurfaceViewer_Struct {176 ms}
—SUMA_Alloc_SurfaceViewer_Struct [3]: EXIT} (file=SUMA_SVmanip.c line=1104) to suma {176 ms}
+++SUMA_X_SurfaceViewer_Create [3]: {ENTRY (file=SUMA_display.c line=4213) from suma {176 ms}
++++SUMA_get_fallbackResources [4]: {ENTRY (file=SUMA_display.c line=280) from SUMA_X_SurfaceViewer_Create {176 ms}
----SUMA_get_fallbackResources [4]: EXIT} (file=SUMA_display.c line=287) to SUMA_X_SurfaceViewer_Create {176 ms}
++++SUMA_EnvVal [4]: {ENTRY (file=suma_utils.c line=3499) from SUMA_X_SurfaceViewer_Create {177 ms}
----SUMA_EnvVal [4]: EXIT} (file=suma_utils.c line=3509) to SUMA_X_SurfaceViewer_Create {177 ms}

SUMA_X_SurfaceViewer_Create
suma
** AFNI compile date = Jan 24 2022
** [[Precompiled binary macos_11.3_ARM_M1_clang: Jan 24 2022]]
** Program Crash **

Thank you!
Prantik

Hi Prantik,

Thanks for letting us know about this issue. We (Rick) are (is) looking into this. It seems to be related to a recent update in Monterey, and the homebrew libraries have not been updated to match.

Hi Prantik,

We made some changes now to make the build more fully homebrew based for X-ish libraries:

brew install mesa mesa-glu

And then do a fresh build with the updated Makefile.macos_11_ARM_clang.

I assume you are pulling from git and would not wait on a re-build, is that correct?

Also, since you are building, you would presumably not set DYLD_LIBRARY_PATH, just to be sure.

Please let us know now that goes, thanks!

  • rick

Hey y’all
Fixed worked great! make cleanest wasn’t leading to a good build for some reason, so I just untarred the package again, copied the M1 Makefile to Makefile, and ran make vastness.
Thanks!
Prantik

That’s great, Prantik!

Yes, “cleanest” is a bit of an overstatement (maybe that should be cleanerer (no, you need to use the one with 17 er’s, not 18)). :slight_smile:
Indeed, to really do a clean build, start from fresh source.

Thanks for the update!

  • rick