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

xcrun: Segmentation fault: 11 #1524

Open
osxaudio opened this issue Jun 28, 2024 · 3 comments
Open

xcrun: Segmentation fault: 11 #1524

osxaudio opened this issue Jun 28, 2024 · 3 comments

Comments

@osxaudio
Copy link

Expected Result
Normal xcrun output is shown

Actual Result

Darling []# xcrun
Invoked with: /Library/Developer/DarlingCLT/usr/bin/xcrun
Segmentation fault: 11 (core dumped)

Steps To Reproduce

  1. build darling from source make && sudo make install
  2. launch darling shell
  3. install commandline tools xcode-select --install
  4. try to use xcrun

I was following the docs on "what to try" and tried to run Darling [~]$ clang hello-world.c -o hello-world which results in:

Darling []# clang
Invoked with: /Library/Developer/DarlingCLT/usr/bin/xcrun clang
Executing /Library/Developer/DarlingCLT/usr/bin/clang
Failed to execute program /Library/Developer/DarlingCLT/usr/bin/clang
xtrace
 Darling []# xtrace xcrun
  [120] getuid() -> 0
  [120] issetugid() -> 0
  [120] readlink("/var/db/xcode_select_link", 0x7F3AD62DB140, 1023) -> ENOENT
  [120] readlink("/usr/share/xcode-select/xcode_dir_link", 0x7F3AD62DB140, 1023) -> ENOENT
  [120] open("/usr/share/xcode-select/xcode_dir_path", O_RDONLY, 0) -> ENOENT
  [120] stat64("/Applications/Xcode.app", 0x7FFFFFDFF8F0) -> ENOENT
  [120] stat64("/Library/Developer/CommandLineTools", 0x7FFFFFDFF8F0) -> ENOENT
  [120] stat64("/Library/Developer/DarlingCLT", 0x7FFFFFDFF8F0) -> 0
  [120] execve("/Library/Developer/DarlingCLT/usr/bin/xcrun", {"/Library/Developer/DarlingCLT/usr/bin/xcrun"}, {"TERM=xterm-256color", "SHELL=/bin/bash", "CLICOLOR=1", "TMPDIR=/private/tmp", "USER=root", "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:dyld: warning: could not load inserted library '' into hardened process because image not found
  Invoked with: /Library/Developer/DarlingCLT/usr/bin/xcrun
  Segmentation fault: 11 (core dumped)

System Information
Ubuntu 20.04 on AMD Phenom(tm) II X6 1090T

Software Version
Linux Kernel 5.4.0-182-generic
Darling 203af1f
Distro "20.04.6 LTS (Focal Fossa)"
@osxaudio
Copy link
Author

osxaudio commented Jun 28, 2024

As a workaraund I am able to use xcrun included with Xcode 11.7. ( xcode-select -s Xcode.app/ && xcrun)
But when trying to use clang I now get: Illegal instruction: 4 (core dumped)

@osxaudio osxaudio changed the title xcrun: Segmentation fault: 11 xcrun: Segmentation fault: 11 [workaraund available] Jun 28, 2024
@osxaudio osxaudio changed the title xcrun: Segmentation fault: 11 [workaraund available] xcrun: Segmentation fault: 11 [workaround available] Jun 28, 2024
@osxaudio osxaudio changed the title xcrun: Segmentation fault: 11 [workaround available] xcrun: Segmentation fault: 11 Jun 28, 2024
@osxaudio
Copy link
Author

OK finally got lldb working, and my fear has become reality, I am missing SSE4 support again:

libclang.dylib`p_bracket:
->  0x7fffedae2638 <+1640>: pmovzxbd (%rdx,%rax), %xmm6        ; xmm6 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero
    0x7fffedae263e <+1646>: pmovzxbd 0x4(%rdx,%rax), %xmm7     ; xmm7 = mem[0],zero,zero,zero,mem[1],zero,zero,zero,mem[2],zero,zero,zero,mem[3],zero,zero,zero
    0x7fffedae2645 <+1653>: pand   %xmm0, %xmm6
    0x7fffedae2649 <+1657>: pand   %xmm4, %xmm6

seems like pmovzxbd is not available in opemu-linux :/

@CuriousTommy
Copy link
Contributor

I wonder if Darling should support checking and warning the user if an SSE extension is not available.

It doesn't seem to hard to implement:
https://stackoverflow.com/a/7495023/5988706

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

No branches or pull requests

2 participants