Skip to content
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

Segmentation fault when executing xfig #166452

Open
4 tasks done
fahasch opened this issue Mar 18, 2024 · 3 comments
Open
4 tasks done

Segmentation fault when executing xfig #166452

fahasch opened this issue Mar 18, 2024 · 3 comments
Labels
bug Reproducible Homebrew/homebrew-core bug upstream issue An upstream issue report is needed

Comments

@fahasch
Copy link
Contributor

fahasch commented Mar 18, 2024

brew gist-logs <formula> link OR brew config AND brew doctor output

HOMEBREW_VERSION: 4.2.3
ORIGIN: https://github.com/Homebrew/brew
HEAD: b3751bca8c4a3c76107d5aa3b75b81db93cf4bb6
Last commit: 2 days ago
Core tap JSON: 09 Jan 16:37 UTC
Core cask tap JSON: 09 Jan 16:37 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.yxbYRS4AZj/org.xquartz:0
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 14.0-arm64
CLT: 15.1.0.0.1.1700200546
Xcode: N/A
Rosetta 2: false

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

I am trying to reopen issues/160515. As I did not see another option, I openened another issue.

For me xfig does not work, neither as bottle nor installed from source in a M1 machine. There were reports in issue/160515 that the formula does not work on intel as well.

Initially, the problem was reported by @adamny here. I believe the issue belongs here. The OP has the following issue:

I executed: "brew install xfig". No error messages. The last three lines of output where:

==> Installing xfig
==> Pouring xfig--3.2.9.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/Cellar/xfig/3.2.9: 3,005 files, 14.2MB
==> Running brew cleanup xfig...

I see xfig in /opt/homebrew/bin
But when I execute it in mac terminal I get:

Warning: locale not supported by Xlib, locale set to C
Warning: X locale modifiers not supported, using default
Warning: Cannot convert string "--times-medium-r-normal--16-------,---medium-r-normal--16-------,--16-*" to type FontSet
Warning: Unable to load any usable fontset
zsh: segmentation fault xfig
I get the same error when I execute it in xterm under XQuartz. How can I fix it?

This is the backtrace from my process

    frame #0: 0x00000001008b5500 libX11.6.dylib`XmbTextEscapement
    frame #1: 0x0000000100687424 libXaw3d.8.dylib`GetDefaultSize + 92
    frame #2: 0x000000010072b604 libXt.6.dylib`CallInitialize + 176
    frame #3: 0x000000010072a940 libXt.6.dylib`xtCreate + 524
    frame #4: 0x000000010072a64c libXt.6.dylib`_XtCreateWidget + 408
    frame #5: 0x000000010006140c xfig`rebuild_file_menu + 240
    frame #6: 0x0000000100061760 xfig`create_menu_item + 296
    frame #7: 0x00000001000610d8 xfig`init_main_menus + 480
    frame #8: 0x00000001000a2968 xfig`main + 3144
    frame #9: 0x00000001848610e0 dyld`start + 2360

So it fails while calling the X11 library.

What happened (include all command output)?

Just execute xfig and the segfault happens. At the moment the formula is not functioning. The test passes as it does not try to open an xwindow.

What did you expect to happen?

The xfig application is supposed to be opened.

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

brew install xfig
xfig
@fahasch fahasch added the bug Reproducible Homebrew/homebrew-core bug label Mar 18, 2024
@fahasch
Copy link
Contributor Author

fahasch commented Mar 20, 2024

The following is a patch that works on my system (both intel as well as apple silicon):
echo "179c179\n< Fig.international: True\n---\n> Fig.international: False" | patch /usr/local/etc/X11/app-defaults/Fig

It turns off the utf8 feature which is the main change from 3.2.8 to 3.2.9 which leads to the segmentation fault.

The issue is either in the Xft or the freetype library which are the new dependencies.

@mars0i
Copy link

mars0i commented Mar 20, 2024

Copied from what I posted at #160515:

For anyone who wants to build xfig on their own, and who aren't used to doing that sort of thing

I downloaded the source package here: https://sourceforge.net/projects/mcj/

However, on my system, that version, v. 3.2.9, didn't build--I forget what the errors were-- but I saw that I had an older version, 3.2.8a, and that built and installed without problem. Better to use Homebrew if it works, but I just needed some version of xfig. The simpler instructions, i.e. the three commands to run, are listed at the top of the file named "INSTALL". The only trick is figuring out where the file "app-defaults" lives on your system. On mine it was /opt/X11/share/X11/app-defaults . You need to substitute in the location of app-defaults in the first line between the "<" and ">".

        ./configure --with-appdefaultdir=</path/to/your/app-defaults>
        make
        make install

I didn't have to do anything special to link to fontconfig or anything like that. So if you have trouble building the latest version, it might be worth trying one of the older versions, which are available that that mcj sourceforge site.

I know that some people reading this know all of the above, but I thought it wouldn't hurt to post it for anyone who's not used to this kind of process.

@cho-m
Copy link
Member

cho-m commented Apr 2, 2024

Sounds like something that should be discussed upstream.

Someone reported a similar error with AUR package in https://sourceforge.net/p/mcj/tickets/174/

@cho-m cho-m added the upstream issue An upstream issue report is needed label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug upstream issue An upstream issue report is needed
Projects
None yet
Development

No branches or pull requests

4 participants
@fahasch @mars0i @cho-m and others