Skip to content

Segmentation fault in xfig #221146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
fahasch opened this issue Apr 23, 2025 · 2 comments · Fixed by #223509
Closed
3 tasks done

Segmentation fault in xfig #221146

fahasch opened this issue Apr 23, 2025 · 2 comments · Fixed by #223509
Labels
stale No recent activity

Comments

@fahasch
Copy link
Contributor

fahasch commented Apr 23, 2025

brew doctor output

Your system is ready to brew.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.4.32-22-g076fdc3
ORIGIN: https://github.com/Homebrew/brew
HEAD: 076fdc30cec33b620f6e03eef931d1b912442dab
Last commit: 3 hours ago
Branch: master
Core tap JSON: 23 Apr 04:46 UTC
Core cask tap JSON: 23 Apr 04:46 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.m6uZbF5p1c/org.xquartz:0
HOMEBREW_EDITOR: vim
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.4.3 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.3/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 17.0.0 build 1700
Git: 2.49.0 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.4.1-arm64
CLT: 16.3.0.0.1.1742442376
Xcode: 16.3
Rosetta 2: false

What were you trying to do (and why)?

There is a problem with the compiled source of xfig. If I start xfig (the problem is reproducible on multiple computers and was already discussed in #166452 and https://sourceforge.net/p/mcj/tickets/177/ ).

When I compile xfig without homebrew (or the bottle), no problem appears.

What happened (include all command output)?

Executing xfig, I get the output:

Warning: locale not supported by Xlib, locale set to C
Warning: X locale modifiers not supported, using default
Warning: Cannot convert string "-misc-fixed-bold-r-normal--13-*-*-*-*-70-iso10646-1,			-*-fixed-bold-r-normal--13-*-*-*-*-*-70-iso8859-*,			-*-fixed-bold-r-normal--13-*-*-*-*-*-*,					-*-*-*-r-normal--13-*, -*-*-*-r-normal--*" to type FontSet
Warning: Unable to load any usable fontset
Warning: Cannot convert string "-misc-fixed-medium-r-normal--15-*-*-*-*-*-iso10646-1,-misc-fixed-medium-r-normal--15-*-*-*-*-*,-*-*-medium-r-normal--15-*,*--*-*" to type FontSet
Warning: Unable to load any usable fontset
Warning: Unable to load any usable fontset
zsh: segmentation fault  /opt/homebrew/bin/xfig

What did you expect to happen?

No segmentation fault is expected. I have traced back the problem to the following. If I compile the program myself and then execute otool -L xfig, I obtain:

src/xfig:
        /opt/X11/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0)
        /opt/X11/lib/libfreetype.6.dylib (compatibility version 25.0.0, current version 25.3.18)
        /opt/X11/lib/libXaw3d.8.dylib (compatibility version 9.0.0, current version 9.0.0)
        /opt/X11/lib/libXft.2.dylib (compatibility version 6.0.0, current version 6.7.0)
        /opt/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /opt/X11/lib/libX11.6.dylib (compatibility version 11.0.0, current version 11.0.0)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)

The bottled version instead outputs:

/opt/homebrew/bin/xfig:
	/opt/homebrew/opt/libxaw3d/lib/libXaw3d.8.dylib (compatibility version 9.0.0, current version 9.0.0)
	/opt/homebrew/opt/libxft/lib/libXft.2.dylib (compatibility version 6.0.0, current version 6.8.0)
	/opt/homebrew/opt/libxt/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
	/opt/homebrew/opt/libx11/lib/libX11.6.dylib (compatibility version 11.0.0, current version 11.0.0)
	/opt/homebrew/opt/libxpm/lib/libXpm.4.dylib (compatibility version 16.0.0, current version 16.0.0)
	/opt/homebrew/opt/ghostscript/lib/libgs.10.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/opt/homebrew/opt/libtiff/lib/libtiff.6.dylib (compatibility version 8.0.0, current version 8.0.0)
	/opt/homebrew/opt/libpng/lib/libpng16.16.dylib (compatibility version 61.0.0, current version 61.0.0)
	/opt/homebrew/opt/jpeg-turbo/lib/libjpeg.8.dylib (compatibility version 8.0.0, current version 8.3.2)
	/opt/homebrew/opt/fontconfig/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)

If I change the two libraries libXt and libXaw3d to the version in /opt/X11 via

install_name_tool -change $HOMEBREW_PREFIX/opt/libxt/lib/libXt.6.dylib /opt/X11/lib/libXt.6.dylib $HOMEBREW_PREFIX/Cellar/xfig/3.2.9a/bin/xfig
install_name_tool -change $HOMEBREW_PREFIX/opt/libxaw3d/lib/libXaw3d.8.dylib /opt/X11/lib/libXaw3d.8.dylib $HOMEBREW_PREFIX/Cellar/xfig/3.2.9a/bin/xfig

The segmentation fault disappears.

Step-by-step reproduction instructions (by running brew commands)

brew install xfig
$HOMEBREW_PREFIX/bin/xfig
@MikeMcQuaid MikeMcQuaid transferred this issue from Homebrew/brew Apr 23, 2025
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label May 15, 2025
gromgit added a commit to gromgit/homebrew-core that referenced this issue May 15, 2025
Fixes Homebrew#221146. Also add the standard "run X11 app with no display" test.
gromgit added a commit to gromgit/homebrew-core that referenced this issue May 15, 2025
Fixes Homebrew#221146. Also add the standard "run X11 app with no display" test.
@gromgit
Copy link
Contributor

gromgit commented May 15, 2025

@fahasch, please brew update then brew reinstall xfig and see if it works for you now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No recent activity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants