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 on apple silicon #160515

Closed
4 tasks done
fahasch opened this issue Jan 20, 2024 · 13 comments
Closed
4 tasks done

Segmentation fault when executing xfig on apple silicon #160515

fahasch opened this issue Jan 20, 2024 · 13 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age stale No recent activity

Comments

@fahasch
Copy link
Contributor

fahasch commented Jan 20, 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 crossposting the issue 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?

I looked into the issue. It seems that it only appears on apple silicon. 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)?

Executing xfig a segmentation fault happened.

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 Jan 20, 2024
@fahasch
Copy link
Contributor Author

fahasch commented Jan 23, 2024

Another piece of information which seems relevant:

The problem seems to be in the library fontconfig. If I link the executable xfig to the library in the path /opt/X11/lib then the executable does not crash. However, on an M1 machine linking the executable to the library in /opt/homebrew/opt/fontconfig/lib has the issues with the segfault. On intel processors, everything works fine.

It could very well be that the problem is in the formula for fontconfig.

@peterlittig

This comment has been minimized.

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 Feb 24, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2024
@fahasch
Copy link
Contributor Author

fahasch commented Mar 2, 2024

The issue is still present. It is quite annoying as I do have to compile xfig by hand. Any idea what is going wrong?

@adamny
Copy link

adamny commented Mar 2, 2024

I concur! Very disappointing that it was closed.

@mars0i
Copy link

mars0i commented Mar 16, 2024

Yes, please don't close. I'm getting it too (on Intel).

@fahasch
Copy link
Contributor Author

fahasch commented Mar 16, 2024

This is still a problem with the package causing segfaults. The issue is reproducible. Does anybody know how to reopen the issue?

@fortranboomer
Copy link

while this is still a problem, someone mentioned

"The problem seems to be in the library fontconfig. If I link the executable xfig to the library in the path /opt/X11/lib then the executable does not crash."

how does one link the homebrew-installed xfig executable to the libfontconfig.dylib in /opt/X11/lib ?????

@fahasch
Copy link
Contributor Author

fahasch commented Mar 18, 2024

One has to install it without homebrew. For me the homebrew install does not work. Nor does the bottle.

@fahasch
Copy link
Contributor Author

fahasch commented Mar 18, 2024

@mars0i @peterlittig @adamny @fortranboomer : I did not find a way to reopen the issue. Instead, I opened a new issues/166452. If the problem still persists for you, please make sure to comment on that issue. Otherwise, it might get closed again.

@fortranboomer
Copy link

fortranboomer commented Mar 18, 2024

One has to install it without homebrew. For me the homebrew install does not work. Nor does the bottle.

Many thanks for your answer and for the effort you're making to get this resolved within homebrew.

You think the homebrew fig2dev can be used or would one have to compile/install that too outside of homebrew ?

By the way, homebrew's xfig used to work fine before the newest updates that were forced on my system when I installed imagemagick via homebrew (that install screwed up my python setup too, had to wipe everything and reinstall).

@mars0i
Copy link

mars0i commented Mar 19, 2024

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.

@fahasch
Copy link
Contributor Author

fahasch commented Mar 19, 2024

Thanks @mars0i : I just wanted to repeat. Please post from now on on issues/166452. This issue is closed and as I can see there is no way to reopen it.

@github-actions github-actions bot added the outdated PR was locked due to age label Apr 19, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age stale No recent activity
Projects
None yet
Development

No branches or pull requests

5 participants