darlinghq / darling

Darwin/macOS emulation layer for Linux
http://www.darlinghq.org
GNU General Public License v3.0
11.53k stars 444 forks source link

Cannot launch apps - result: Segmentation fault: 11 #838

Open jiriks74 opened 4 years ago

jiriks74 commented 4 years ago

Expected Result Start application via open Appname.app in my case open /Applications/Visual\ Studio\ Code.app/

Actual Result I get Segmentation fault: 11 even when I do just open

Steps To Reproduce Download VS code, unzip it inside /Applications folder and run open /Applications/Visual\ Studio\ Code.app/

System Information OS: Arch Linux x86_64 Kernel: 5.4.47-xanmod1-1-xanmod-lts Uptime: 17 mins Packages: 1274 (pacman) Shell: zsh 5.8 Resolution: 1920x1080, 1024x768 DE: Unity WM: awesome Theme: Breeze [GTK2/3] Icons: breeze-dark [GTK2/3] Terminal: terminator CPU: Intel Pentium G2030 (2) @ 3.000GHz GPU: AMD ATI Radeon HD 5670/5690/5730 Memory: 1667MiB / 15969MiB

Software, Version Visual Studio code: 1.46

Linux: Kernel:5.4.47-xanmod1-1-xanmod-lts Darling: 07515744c968a490091d9f3da2fa940dd128e56e

gusbemacbe commented 4 years ago

@TheBrokenRail

It seems that @jiriks74 has already open an issue before me. Then I and he have the same issue. I leave my comment copied from your issue.

I am already aware that most GUI applications will not run at the moment..

I have this same problem with opening few simple Apple apps, as Nova (formerly Coda 2) and Sublime Text.

I prepared the logs for you, @Arucard1983, @bugaevc, @LubosD and @TheBrokenRail:

'Sublime Text.app/Contents/MacOS/Sublime Text'
dyld: Symbol not found: _kTISPropertyInputSourceIsASCIICapable
  Referenced from: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text (which was built for Mac OS X 10.9)
  Expected in: /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
 in /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
abort_with_payload: reason: Symbol not found: _kTISPropertyInputSourceIsASCIICapable
  Referenced from: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text (which was built for Mac OS X 10.9)
  Expected in: /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
 in /Applications/Sublime Text.app/Contents/MacOS/Sublime Text; code: 4
Abort trap: 6 (core dumped)
dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/Versions/A/UserNotifications
  Referenced from: /Volumes/SystemRoot/home/gusbemacbe/TransferĂȘncias/Aplicativos/macOS/Nova.app/Contents/MacOS/Nova
  Reason: image not found
abort_with_payload: reason: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/Versions/A/UserNotifications
  Referenced from: /Volumes/SystemRoot/home/gusbemacbe/TransferĂȘncias/Aplicativos/macOS/Nova.app/Contents/MacOS/Nova
  Reason: image not found; code: 1
Abort trap: 6 (core dumped)

I have been researching. There are two solutions, you need to host dyld library for compiling for Darling, or Homebrew comes with the dylib library, but I am not sure if it is safe to install Homebrew inside Darling.

And abort_with_payload, I fear it comes from Objective-C, which is closed-source. :-(

I am not sure if Swift, which is open source, has the library abort_with_payload.

gusbemacbe commented 4 years ago

@jiriks74

You need to copy the error log here from the command"/Applications/Visual Studio Code.app/Contents/MacOS/Visual Studio Code"

jiriks74 commented 4 years ago

@jiriks74

You need to copy the error log here from the command"/Applications/Visual Studio Code.app/Contents/MacOS/Visual Studio Code"

There is only Electron file no Visual Studio Code

gusbemacbe commented 4 years ago

@jiriks74, try "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" and see if the error log appears

jiriks74 commented 4 years ago

I get this running /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron

abort_with_payload: reason: Library not loaded: /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility Referenced from: /Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework Reason: image not found; code: 1

How do I get those files?

jiriks74 commented 4 years ago

@gusbemacbe I also tried install brew, bu that won't work too. I get:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/bin
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/sbin
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/sbin/chown jirka /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
chown: jirka: illegal user name
Failed during: /usr/bin/sudo /usr/sbin/chown jirka /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
gusbemacbe commented 4 years ago

Then we have the same issue. All our apps did not find the abort_with_payload library that Darling missed.

How do I get those files?

It comes mostly from XCode and from Objective-C.

The library dyld comes with Homebrew.

As for Homebrew, it seems that because of permissions and TLS, in reference to https://github.com/darlinghq/darling/issues/553 and https://github.com/darlinghq/darling/issues/357.

jiriks74 commented 4 years ago

@gusbemacbe How do I get xcode then?

jiriks74 commented 4 years ago

@gusbemacbe If I can get my hands on xcode app from a macbook, would that work?

gusbemacbe commented 4 years ago

How do I get xcode then?

According to Darling's docs, you can run:

xcode-select --install

If I can get my hands on xcode app from a macbook, would that work?

Yes, as according to Darling's docs, run the xcode-select --switch /Applications/Xcode.app, after coyping your app to that folder from your MacBook. See if, with Xcode.app, the apps open with the __abort_with_payload library hold by Xcode.

HinTak commented 4 years ago

@gusbemacbe you are reading the wrong part of the error message. In one it says "symbol not found" - I.e. The darling version of that library is missing a feature that the genuine apple version has; in the other, it says "image not found" . "Image" is just a collective term for "executable or library" - thus a complete library is missing, not yet implemented.

harsh2161 commented 1 year ago

bash: line 1: 3331 Segmentation fault: 11 '/Users/harshpandey/Desktop/DSA/Recursion/SubsetGenerationCode' [Finished in 10.6s with exit code 139] [cmd: ['bash', '-c', "g++ -std=c++14 '/Users/harshpandey/Desktop/DSA/Recursion/SubsetGenerationCode.cpp' -o '/Users/harshpandey/Desktop/DSA/Recursion/SubsetGenerationCode' && '/Users/harshpandey/Desktop/DSA/Recursion/SubsetGenerationCode'"]] [dir: /Users/harshpandey/Desktop/DSA/Recursion] [path: /opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin]