darling icon indicating copy to clipboard operation
darling copied to clipboard

Error connecting to shellspawn on Ubuntu 18.04

Open geoffreycs opened this issue 8 years ago • 16 comments

Hello,

I cloned Darling last night and went through the process of building and installing it. No major problems besides having to point some files to my cairo.h library. But after installing and loading the kernel module for the first time, I get this fun little error:

geoffrey@Linux-HP ~ $ darling shell
Bootstrapping the container with launchd...
objc[5]: Class NSObject is implemented in both /usr/lib/libobjc.A.dylib (0x7f2601de7e00) and /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (0x7f26020c96b0). One of the two will be used. Which one is undefined.
Assertion failed: (isRealized()), function isMetaClass, file /home/geoffrey/darwin/darling/src/external/objc4/runtime/objc-runtime-new.h, line 1221.
Error connecting to shellspawn in the container (/var/run/shellspawn.sock): No such file or directory

I tried temporarily moving both mentioned libraries to separate locations, and they first one will just make it fail instantly while the second will give the same Error connecting to shellspawn in the container (/var/run/shellspawn.sock): No such file or directory.

Any attempts to retry darling shell will give Error connecting to shellspawn in the container (/var/run/shellspawn.sock): No such file or directory. To recreate the problem afterwards, I had to kill mldr, unload the kernel module, and reload it again.

Operating system: Ubuntu 17.04 64-bit CPU: AMD Turion-II P520 Dual-Core Clang version: clang-3.8 and clang-4.0 Kernel: 4.10.0-26-generic

Extra:

geoffrey@Linux-HP ~/darling/build $ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../Toolchain.cmake
-- Compiler include path detected as /usr/lib/llvm-4.0/bin/../lib/clang/4.0.1/include/
-- Checking for module 'cairo'
--   No package 'cairo' found
-- Checking for module 'cairo'
--   No package 'cairo' found
-- Checking for module 'fontconfig'
--   Found fontconfig, version 2.12.4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/geoffrey/darling/build

I don't know if it's just my setup or a deeper problem. I have Linuxbrew installed but I have built a previous version of Darling while Brew installed and ran into no issues.

Just a quick FYI, I'm not a programmer, I'm just a geeky high school student with too much time.

Thanks, Geoffrey S.

geoffreycs avatar Aug 14 '17 02:08 geoffreycs

The issue with NSObject being defined twice and that assertion failure was fixed 3 days ago by c541139. Make sure you have the latest sources pulled.

However, I can confirm that "Error connecting to shellspawn" is an issue Darling currently has on Ubuntu 17.04.

I used to develop Darling on Ubuntu and the rest of the devs were on Debian so we usually caught bugs like this. But since I switched to Debian a few months ago I can see how this slipped through the cracks. Arch Linux tends to break Darling too 😉.

I started working on Darling when I was a senior in HS (class of 2017) so don't think you need to be a pro to get involved, you're already ahead of the game 🙂.

ahyattdev avatar Aug 14 '17 02:08 ahyattdev

I'll investigate the shellspawn problem. The problem is distributions tend to patch their kernels to make them "safer" whatever, and break a ton of things along the way. I suspect this might be the case.

LubosD avatar Aug 14 '17 07:08 LubosD

After a clean install of Ubuntu 17.04, I was able to run darling shell just fine. There are some pending updates, though, so I'll try if e.g. a kernel update breaks something.

Besides this I'd suggest deleting your ~/.darling. There could've been some breaking changes in the past.

LubosD avatar Aug 14 '17 11:08 LubosD

I also have a few other kernels lying around that I could use (including a Debian realtime kernel). I'll try it with that one this afternoon.

Sent from my Samsung SM-T800 using FastHub

geoffreycs avatar Aug 14 '17 13:08 geoffreycs

Okay, just now I tried deleting my ~/.darling. Still the same shellspawn error.

Sent from my Samsung SM-T800 using FastHub

geoffreycs avatar Aug 14 '17 13:08 geoffreycs

Have you shut down the container before retrying? darling shutdown and only then darling shell.

LubosD avatar Aug 14 '17 14:08 LubosD

Yea, I have done darling shutdown. I've tried building against a newer kernel (4.11.0-14-generic) and same result. Does not play nice with 4.9.33-rtavl1 or 4.9.13-muqss-xanmod19 either (but those are weird kernels). I'll try with an older one later.

Sent from my Samsung SM-T800 using FastHub

geoffreycs avatar Aug 14 '17 22:08 geoffreycs

I've just upgraded my Ubuntu 17.04 install to 4.10.0-32 and it still works.

LubosD avatar Aug 15 '17 07:08 LubosD

I will clone the new source this weekend. School has started, so I haven't had time to muck around.

Sent from my Samsung SM-T820 using FastHub

geoffreycs avatar Aug 18 '17 12:08 geoffreycs

I had this issue before but I removed ~/.darling, ~/.darling.workdir, and /usr/local/libexec/darling`, did a clean build, and this issue went away.

ahyattdev avatar Aug 22 '17 03:08 ahyattdev

I encountered this issue again. I did something weird where I can sudo darling shell.

Bootstrapping the container with launchd...
Error connecting to shellspawn in the container (/var/run/shellspawn.sock): No such file or directory

The workaround is (thanks to @bugaevc):

$ darling shutdown
$sudo chown -R `whoami`:`whoami` ~/.darling

ahyattdev avatar Apr 05 '19 17:04 ahyattdev

IIRC we don't use shellspawn anymore, can reopen if I'm mistaken

ahyattdev avatar Mar 17 '20 19:03 ahyattdev

We do

bugaevc avatar Mar 17 '20 19:03 bugaevc

Ran into this exact issue following the wiki install / setup on an Ubuntu 18.04 VM. Had to work around the gcc / clang environment variable to cmake .. && make:

(thanks: https://stackoverflow.com/questions/7031126/switching-between-gcc-and-clang-llvm-using-cmake) $ export CC=/usr/bin/clang $ export CXX=/usr/bin/clang++

I tried the workarounds in this thread (see whoami) but darling shell just hangs. This is in a Parallels Version 15.1.2 (47123) over macOS 10.15.3

I had issues with the other install steps on CentOS 7 (appears to not ship with dnf) Fedora 29 was missing kernel-devel as a package. Debian 9 hit a cmake issue

-- Checking for module 'fuse' -- Found fuse, version 2.9.7 CMake Error at cmake/darling_static_lib.cmake:1 (cmake_policy): Policy "CMP0069" is not known to this version of CMake. Call Stack (most recent call first): src/external/libclosure/CMakeLists.txt:9 (include)

Feel free to prune this / have me refile issues, but just saying at least for Parallels VM work, the instructions aren't working for me.

If there's a preferred distribution + version I'd love to try it out. Thank you.

apelican avatar Mar 30 '20 17:03 apelican

Same issue here, Linux 5.4.0-1024-gcp #24~18.04.1-Ubuntu SMP x86_64 GNU/Linux. When set DPREFIX to some folder other than ~/.darling this error occurs, but when is the default, works fine.

Edit: I'm using DPREFIX=/home/.darling and now works :). Silly error

caio-vinicius avatar Sep 19 '20 13:09 caio-vinicius

same issue on Kubuntu 25.04, KDE Plasma 6.3.4, Wayland @caio-vinicius your solution fixed it! ty! DPREFIX=/home/.darling

ripscreates avatar Oct 23 '25 21:10 ripscreates