brew: xmgrace broken after brew package upgrades

I have a MacBook Pro (Retina, Mid 2012) with OS X El Capitan v. 10.11.6. I use xmgrace regularly for my work, and 10 days ago, I had no problems with it. On Sept. 20, 2016 I did ‘brew update, outdated, upgrade, cleanup, prune, doctor’ and now can no longer open xmgrace. The error message is:

Warning: Widget must be a VendorShell. Warning: Fatal Error: _XmGetDefaultDisplay cannot be used prior to VendorS.Initialize, returns NULL

Oops! Got SIGSYS

Please use "Help/Comments" to report the bug. Abort trap: 6

I have XQuartz 2.7.10_rc4, openmotif 2.3.4, grace 5.1.25_1. If I type ‘xclock’, that works. I have spent (too many) hours researching the web for a solution, but have not found anything that fixed this problem. I think it has to do with the order in which Xm, Xt, and X11 are linked when compiling openmotif with homebrew, but I haven’t figured out how to fix it. If you can help with this problem, please let me know! Gratefully yours,

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

Aha! The 2.7.10_rc4 release notes even have an item about libXt and Motif. They say:

  • libXt
    • libXt.6.dylib is now a two-level-namespace dylib
    • libXt.7.dylib is now a stub dylib that re-exports libXt.6.dylib (for binary compatibility with anything built against XQuartz 2.7.9)
    • A flat_namespace version of libXt is available in /opt/X11/lib/flat_namespace to help ease the transition (#96292)
      • Set DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace when executing older non-compliant software (eg: Motif-based applications)
      • Motif users are encouraged to file bugs against Motif to encourage them to fix that library.

And this from the XQuartz 2.7.9 release notes:

  • libXt
    • No longer linked with -flat_namespace
    • Binary compatibility maintained for existing clients of libXt.6.dylib

Which I think means that libXt.6.dylib is -flat_namespace, and the new libXt.7.dylib is not.

Here’s the library from XQuartz 2.7.8 (the prior version):

$ otool -hv libXt.6.dylib
libXt.6.dylib:
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64  X86_64        ALL  0x00       DYLIB    19       2024 DYLDLINK NO_REEXPORTED_DYLIBS APP_EXTENSION_SAFE

Note the lack of TWOLEVEL in the flags. There is no libXt.7.dylib in this version.

Here’s the libs from XQuartz 2.7.9:

$ otool -hv libXt.6.dylib libXt.7.dylib
libXt.6.dylib:
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64  X86_64        ALL  0x00       DYLIB    19       2024 DYLDLINK NO_REEXPORTED_DYLIBS APP_EXTENSION_SAFE
libXt.7.dylib:
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64  X86_64        ALL  0x00       DYLIB    19       2024   NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS APP_EXTENSION_SAFE

I downgraded XQuartz from 2.7.9 to 2.7.8, reinstalled openmotif and grace from source, and it’s working now: running xmgrace launches the GUI instead of just crashing.

So this was probably caused by XQuartz being upgraded on the test-bot servers. I suspect the first time that an openmotif bottle was built against 2.7.9, it linked to the two-level-namespace libXt.7.dylib, and @ltbuchman picked it up on a subsequent update.

So I think we need to massage the build to get it to link against the flat-namespace versions of libXt.dylib instead of the defaults – I’ll see if I can figure that out – and push for OpenMotif upstream to add compatibility with two-level-namespace dylibs (however that’s done; beyond me at this point).

@ltbuchman, as a workaround for the time being, try making sure you have XQuartz 2.7.8 installed (not 2.7.9 or 2.7.10_rc4), and reinstall openmotif and grace from source with brew reinstall -s openmotif grace.