DriveSuma crashes on Mac OS Sierra

Hi all,

I’m having troubles with DriveSuma on macOs sierra 10.12.4. I reinstalled the latest version of Xquartz (2.7.11) and updated AFNI to the latest version (Precompiled binary macosx_10.7_Intel_64: Mar 29 2017 (Version AFNI_17.0.18)), but the issues is still there. Also, I made sure that DYLD_LIBRARY_PATH points to /opt/X11/lib/flat_namespace

Whenever I run two commands that modify ‘surf_cont’, suma crashes. For example, this crashes all the time


suma -niml &
DriveSuma -com surf_cont -Dim 0.9
DriveSuma -com surf_cont -Dim 0.3

I’m attaching the output and the .afni.crashlog at the end of this message. Any help would be greatly appreciated. Thanks!

Matteo


$suma -niml &
[1] 31378
$
suma:
     No input specified, loading some toy surfaces...
     Use '.' and ',' to cycle between them.
     See suma -help for assistance.

SUMA_Engine: Starting to listen ...
$DriveSuma -com surf_cont -Dim 0.9

SUMA_niml_call: Contacting on tcp:127.0.0.1:53219 (6), maximum wait 300.000 sec
(You can change max. wait time with env. SUMA_DriveSumaMaxWait)


Waiting for SUMA to close stream .++     Notice SUMA_niml_workproc (SUMA_niml.c:298 @15:03:25):
++ NIML connection opened from 127.0.0.1 on port 53219 (6th stream)
++     Notice SUMA_XtWarn_handler (SUMA_display.c:4114 @15:03:25):
  X11 Warning 1:Cannot find callback list in XtAddCallback
  Have 1 X11 warnings so far, see Help-->Message Log if curious.
  This notice is shown once for each additional 10 warnings.

oo     Warning SUMA_Contralateral_SO (SUMA_DOmanip.c:2882):
Surface sides are not clearly defined. If this is in error, consider adding
Hemisphere = R  (or L or B) in the spec file
to make sure surfaces sides are correctly labeled.
Similar warnings will be muted

SUMA_niml_hangup: stream index 6
.Done.
$DriveSuma -com surf_cont -Dim 0.3

SUMA_niml_call: Contacting on tcp:127.0.0.1:53219 (6), maximum wait 300.000 sec
(You can change max. wait time with env. SUMA_DriveSumaMaxWait)


Waiting for SUMA to close stream .++     Notice SUMA_niml_workproc (SUMA_niml.c:298 @15:03:31):
++ NIML connection opened from 127.0.0.1 on port 53219 (6th stream)
xp_import_surface: assertion failed: s == NULL
error: xp_import_surface returned: 2
xp_destroy_surface: assertion failed: s != NULL
xp_destroy_surface error: 3
oo     Warning SUMA_XErrHandler (SUMA_display.c:4147):
Intercepted X11 error: 0
Will attempt to proceed but trouble might ensue.
++     Notice SUMA_XErrHandler (SUMA_display.c:4148 @15:03:31):
Trace At Xerr
          SUMA_XErrHandler
         SUMA_glXMakeCurrent
        SUMA_cmap_wid_graphicsInit
       SUMA_BringUpSurfContTLS
      SUMA_viewSurfaceCont
     SUMA_Engine
    SUMA_nimlEngine2Engine
   SUMA_process_NIML_data
  suma
 Bottom of Debug Stack
--     Error SUMA_glXMakeCurrent (SUMA_display.c:341):
Failed in glXMakeCurrent.

SUMA_glXMakeCurrent (via SUMA_GL_ERRS): Looking for OpenGL errors ...
SUMA_glXMakeCurrent: No errors found.
--     Error SUMA_glXMakeCurrent (SUMA_display.c:343):
Called from SUMA_glXMakeCurrent
         SUMA_glXMakeCurrent
        SUMA_cmap_wid_graphicsInit
       SUMA_BringUpSurfContTLS
      SUMA_viewSurfaceCont
     SUMA_Engine
    SUMA_nimlEngine2Engine
   SUMA_process_NIML_data
  suma
 Bottom of Debug Stack
Error SUMA_cmap_wid_graphicsInit: Failed in SUMA_glXMakeCurrent.
 	Continuing ...
SUMA_cmap_wid_graphicsInit (via SUMA_GL_ERRS): Looking for OpenGL errors ...
SUMA_cmap_wid_graphicsInit: No errors found.
xp_import_surface: assertion failed: s == NULL
error: xp_import_surface returned: 2
xp_destroy_surface: assertion failed: s != NULL
xp_destroy_surface error: 3
oo     Warning SUMA_XErrHandler (SUMA_display.c:4147):
Intercepted X11 error: 0
Will attempt to proceed but trouble might ensue.
++     Notice SUMA_XErrHandler (SUMA_display.c:4148 @15:03:31):
Trace At Xerr
          SUMA_XErrHandler
         SUMA_glXMakeCurrent
        SUMA_cmap_wid_handleRedisplay
       SUMA_InitializeColPlaneShell_SO
      SUMA_viewSurfaceCont
     SUMA_Engine
    SUMA_nimlEngine2Engine
   SUMA_process_NIML_data
  suma
 Bottom of Debug Stack
--     Error SUMA_glXMakeCurrent (SUMA_display.c:341):
Failed in glXMakeCurrent.

SUMA_glXMakeCurrent (via SUMA_GL_ERRS): Looking for OpenGL errors ...
SUMA_glXMakeCurrent: No errors found.
--     Error SUMA_glXMakeCurrent (SUMA_display.c:343):
Called from SUMA_glXMakeCurrent
         SUMA_glXMakeCurrent
        SUMA_cmap_wid_handleRedisplay
       SUMA_InitializeColPlaneShell_SO
      SUMA_viewSurfaceCont
     SUMA_Engine
    SUMA_nimlEngine2Engine
   SUMA_process_NIML_data
  suma
 Bottom of Debug Stack
--     Error SUMA_cmap_wid_handleRedisplay (SUMA_xColBar.c:381):
Failed in SUMA_glXMakeCurrent.
 	Continuing ...

Fatal Signal 11 (SIGSEGV) received
         SUMA_cmap_wid_display
        SUMA_cmap_wid_handleRedisplay
       SUMA_InitializeColPlaneShell_SO
      SUMA_viewSurfaceCont
     SUMA_Engine
    SUMA_nimlEngine2Engine
   SUMA_process_NIML_data
  suma
 Bottom of Debug Stack
** AFNI version = AFNI_17.0.18  Compile date = Mar 29 2017
** [[Precompiled binary macosx_10.7_Intel_64: Mar 29 2017]]
** 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/contematto/.afni.crashlog
[1]  + 31378 exit 1     suma -niml
.....oo     Warning SUMA_Wait_Till_Stream_Goes_Bad (SUMA_niml.c:4244):

Failed to detect closed stream after 5000 ms.
(You can change max. wait time with env. SUMA_DriveSumaMaxCloseWait)
Closing shop anyway...NI_stream_write(send): Broken pipe



*********------ CRASH LOG ------------------------------***********
Fatal Signal 11 (SIGSEGV) received
.......... recent internal history .........................................
----------SUMA_FindNgrAttributeElement [10]: EXIT} (file=suma_datasets.c line=1279) to SUMA_GetDatasetDimensions
---------SUMA_GetDatasetDimensions [9]: EXIT} (file=suma_datasets.c line=1350) to SUMA_is_Label_dset
+++++++++SUMA_is_AllConsistentColType_dset [9]: {ENTRY (file=suma_datasets.c line=12341) from SUMA_is_Label_dset
++++++++++SUMA_TypeOfDsetColNumb [10]: {ENTRY (file=suma_datasets.c line=10066) from SUMA_is_AllConsistentColType_dset
+++++++++++SUMA_FindDsetAttributeElement [11]: {ENTRY (file=suma_datasets.c line=1214) from SUMA_TypeOfDsetColNumb
-----------SUMA_FindDsetAttributeElement [11]: EXIT} (file=suma_datasets.c line=1220) to SUMA_TypeOfDsetColNumb
+++++++++++SUMA_FindNgrAttributeElement [11]: {ENTRY (file=suma_datasets.c line=1231) from SUMA_TypeOfDsetColNumb
-----------SUMA_FindNgrAttributeElement [11]: EXIT} (file=suma_datasets.c line=1260) to SUMA_TypeOfDsetColNumb
+++++++++++SUMA_Get_Sub_String [11]: {ENTRY (file=suma_string_manip.c line=857) from SUMA_TypeOfDsetColNumb
++++++++++++SUMA_NI_get_ith_string [12]: {ENTRY (file=suma_string_manip.c line=487) from SUMA_Get_Sub_String
------------SUMA_NI_get_ith_string [12]: EXIT} (file=suma_string_manip.c line=526) to SUMA_Get_Sub_String
-----------SUMA_Get_Sub_String [11]: EXIT} (file=suma_string_manip.c line=874) to SUMA_TypeOfDsetColNumb
+++++++++++SUMA_Col_Type [11]: {ENTRY (file=suma_datasets.c line=5081) from SUMA_TypeOfDsetColNumb
-----------SUMA_Col_Type [11]: EXIT} (file=suma_datasets.c line=5112) to SUMA_TypeOfDsetColNumb
----------SUMA_TypeOfDsetColNumb [10]: EXIT} (file=suma_datasets.c line=10088) to SUMA_is_AllConsistentColType_dset
---------SUMA_is_AllConsistentColType_dset [9]: EXIT} (file=suma_datasets.c line=12350) to SUMA_is_Label_dset
--------SUMA_is_Label_dset [8]: EXIT} (file=suma_datasets.c line=12440) to SUMA_InitializeColPlaneShell_SO
++++++++SUMA_cmap_wid_handleRedisplay [8]: {ENTRY (file=SUMA_xColBar.c line=363) from SUMA_InitializeColPlaneShell_SO
+++++++++SUMA_glXMakeCurrent [9]: {ENTRY (file=SUMA_display.c line=314) from SUMA_cmap_wid_handleRedisplay
++++++++++SUMA_XErrHandler [10]: {ENTRY (file=SUMA_display.c line=4143) from SUMA_glXMakeCurrent
----------SUMA_XErrHandler [10]: EXIT} (file=SUMA_display.c line=4150) to SUMA_glXMakeCurrent
---------SUMA_glXMakeCurrent [9]: EXIT} (file=SUMA_display.c line=344) to SUMA_cmap_wid_handleRedisplay
+++++++++SUMA_cmap_wid_display [9]: {ENTRY (file=SUMA_xColBar.c line=258) from SUMA_cmap_wid_handleRedisplay
++++++++++SUMA_build_rotmatrix [10]: {ENTRY (file=SUMA_trackball.c line=268) from SUMA_cmap_wid_display
----------SUMA_build_rotmatrix [10]: EXIT} (file=SUMA_trackball.c line=289) to SUMA_cmap_wid_display
++++++++++SUMA_CmapOfPlane [10]: {ENTRY (file=SUMA_Color.c line=2280) from SUMA_cmap_wid_display
+++++++++++SUMA_Find_ColorMap [11]: {ENTRY (file=SUMA_Color.c line=1651) from SUMA_CmapOfPlane
-----------SUMA_Find_ColorMap [11]: EXIT} (file=SUMA_Color.c line=1672) to SUMA_CmapOfPlane
----------SUMA_CmapOfPlane [10]: EXIT} (file=SUMA_Color.c line=2304) to SUMA_cmap_wid_display
++++++++++SUMA_DrawCmap [10]: {ENTRY (file=SUMA_xColBar.c line=190) from SUMA_cmap_wid_display
----------SUMA_DrawCmap [10]: EXIT} (file=SUMA_xColBar.c line=242) to SUMA_cmap_wid_display
............................................................................
         SUMA_cmap_wid_display
        SUMA_cmap_wid_handleRedisplay
       SUMA_InitializeColPlaneShell_SO
      SUMA_viewSurfaceCont
     SUMA_Engine
    SUMA_nimlEngine2Engine
   SUMA_process_NIML_data
  suma
** AFNI compile date = Mar 29 2017
** [[Precompiled binary macosx_10.7_Intel_64: Mar 29 2017]]
** Program Crash **

Hi Matteo,

The problem is in the script itself, for which I checked
in a fix this morning. The problem is that OS X is not
preserving DYLD_LIBRARY_PATH across new shells, but
it is exacerbated by the fact that many of our scripts
use the -f option at the top (so the .cshrc file is not
applied).

For the moment, edit the @DriveSuma script and just
remove the -f option on the first line. That update will
be available when the next build is run.

Just let me know if you have any questions.

Thanks,

  • rick

Hi Rick,

thank you for your reply. Modifying the shebang in @DriveSuma doesn’t help, unfortunately.

Just to make sure, the issues I had was with DriveSuma, not with the demo @DriveSuma (which crashes as well but for another maybe unrelated issue).

Thanks,
Matteo

BTW, I can confirm that the error seems to occur with Mac OS (at least on my system) but not linux. It works perfectly fine on a virtual machine.

Hi Matteo,

All of these problems are almost certainly due to
getting that variable set properly in your environment,
and OS X is actively making it more difficult to
propagate as expected. That is why you are not
seeing the problem on Linux.

If you start a new shell by typing ‘bash’ and then
run suma, does it work?

If it is set properly in ~/.bashrc and ~/.cshrc (and
it can be complicated, depending on your files),
then you may even need to reboot to get it fully
applied.

  • rick

I’m having the same problem, also on Sierra (10.12.4). Suma opens properly, but when I try to use more than one DriveSuma surf_cont command then Suma crashes, with a similar error message to Matteo’s. A similar workflow was working fine earlier this week, so I’m baffled as to what changed. Restarting the whole system doesn’t solve the problem. Running “echo $DYLD_LIBRARY_PATH” returns the correct value, so it seems that it is getting set correctly.

While I was searching for help with this error, I came across other projects also having similar issues in the past month, e.g. http://cxc.harvard.edu/ciao/download/ so whatever changed in OSX seems to be causing problems for multiple programs.