darlinghq / darling

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

AppKit fails to load Mesa drivers #600

Closed TheBrokenRail closed 4 years ago

TheBrokenRail commented 4 years ago

After #598 failed, I also tried this simple AppKit test program: https://github.com/gammasoft71/Examples_Cocoa/blob/master/src/HelloWorld/HelloWorld.m It printed:

Fontconfig error: Cannot load default config file
2020-01-03 22:42:07.380 HelloWorld[356:3e8] No font found for name San Francisco
2020-01-03 22:42:07.381 HelloWorld[356:3e8] No font found for name San Francisco
2020-01-03 22:42:07.381 HelloWorld[356:3e8] No font found for name Arial
2020-01-03 22:42:07.381 HelloWorld[356:3e8] No font found for name San Francisco
Segmentation fault: 11 (core dumped)
TheBrokenRail commented 4 years ago

After using #603 the error became:

2020-01-04 04:31:14.022 HelloWorld[41:3e8] convertFont:toHaveTrait: failed, Arial 2
2020-01-04 04:31:14.022 HelloWorld[41:3e8] convertFont:toHaveTrait: failed, Arial 1
2020-01-04 04:31:14.322 HelloWorld[41:3e8] FreeType font face is not scalable
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: MESA-LOADER: failed to open amdgpu (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: amdgpu
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: MESA-LOADER: failed to open amdgpu (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: amdgpu
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
2020-01-04 04:31:14.905 HelloWorld[41:3e8] Terminating app due to uncaught exception 'NSException', reason: '-[Form setIsVisible:]: unrecognized selector sent to instance 0x7fcc3fc15d80'
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6 (core dumped)

So a combination of #598 and something new.

TheBrokenRail commented 4 years ago

I tried to symlink /usr/lib/x86_64-linux-gnu/dri into Darling with:

ln -s /Volumes/SystemRoot/usr/lib/x86_64-linux-gnu/dri /usr/lib/x86_64-linux-gnu/dri

and the error changed to:

2020-01-04 05:19:13.223 HelloWorld[86:3e8] convertFont:toHaveTrait: failed, Arial 2
2020-01-04 05:19:13.223 HelloWorld[86:3e8] convertFont:toHaveTrait: failed, Arial 1
2020-01-04 05:19:13.524 HelloWorld[86:3e8] FreeType font face is not scalable
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: MESA-LOADER: failed to open amdgpu (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: amdgpu
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: MESA-LOADER: failed to open amdgpu (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: amdgpu
2020-01-04 05:19:14.154 HelloWorld[86:3e8] Terminating app due to uncaught exception 'NSException', reason: '-[Form setIsVisible:]: unrecognized selector sent to instance 0x7fad78c15f10'
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6 (core dumped)
CuriousTommy commented 4 years ago

@TheBrokenRail The failure to load the mesa driver is a known issue. It has to do with the chroot environment interfering with the Linux libraries. I recommend you keep an eye on this issue. Once that is fixed, that annoying mesa bug will go away.

bugaevc commented 4 years ago

@TheBrokenRail you may have to symlink or bind-mount a lot more directories, see https://github.com/darlinghq/darling/issues/365#issuecomment-494882104

TheBrokenRail commented 4 years ago

After running:

ln -s /Volumes/SystemRoot/usr/share/glvnd /usr/share/glvnd
ln -s /Volumes/SystemRoot/sys /sys
ln -s /Volumes/SystemRoot/usr/share/drirc /usr/share/drirc
ln -s /Volumes/SystemRoot/etc/drirc /etc/drirc

It segfaults:

Segmentation fault: 11 (core dumped)
TheBrokenRail commented 4 years ago

The /usr/share/glvnd symlink caused a segfault. You also need to symlink /usr/share/libdrm. Once you have done this you get a similar result to #589.

# Make sure you don't have a /usr/share/glvnd symlink.
ln -s /Volumes/SystemRoot/usr/share/libdrm /usr/share/libdrm
ln -s /Volumes/SystemRoot/sys /sys
ln -s /Volumes/SystemRoot/usr/share/drirc /usr/share/drirc
ln -s /Volumes/SystemRoot/etc/drirc /etc/drirc

outputs:

2020-01-05 05:28:37.595 HelloWorld[454:3e8] convertFont:toHaveTrait: failed, Arial 2
2020-01-05 05:28:37.595 HelloWorld[454:3e8] convertFont:toHaveTrait: failed, Arial 1
2020-01-05 05:28:37.897 HelloWorld[454:3e8] FreeType font face is not scalable
2020-01-05 05:28:38.522 HelloWorld[454:3e8] Terminating app due to uncaught exception 'NSException', reason: '-[Form setIsVisible:]: unrecognized selector sent to instance 0x7fc1a5415d80'
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
TheBrokenRail commented 4 years ago

/etc/drirc and /usr/share/drirc don't seem to affect the outcome.

bugaevc commented 4 years ago

No, of course an unrecognized selector sent to the form is unrelated to the fonts.

And indeed, we don't seem to have setIsVisible: (and I get a feeling we've already discussed this before, but this is clearly a misnamed selector, it should've been setVisible:, but that's how it is in Apple's AppKit).

You should:

  1. Try replacing setIsVisible: call by the usual makeKeyAndOrderFront:, see if that works for you
  2. Try seeing how that's implemented and implement setIsVisible: in NSWindow
TheBrokenRail commented 4 years ago

Now the error is:

2020-01-05 17:01:05.647 HelloWorld[757:3e8] convertFont:toHaveTrait: failed, Arial 2
2020-01-05 17:01:05.647 HelloWorld[757:3e8] convertFont:toHaveTrait: failed, Arial 1
2020-01-05 17:01:06.142 HelloWorld[757:3e8] FreeType font face is not scalable
2020-01-05 17:01:07.178 HelloWorld[757:3e8] CGLCreateContext failed at /home/connor/Documents/darling/darling/src/external/cocotron/AppKit/X11.backend/X11Window.m 430 with error 10004
2020-01-05 17:01:07.179 HelloWorld[757:3e8] Terminating app due to uncaught exception 'NSException', reason: 'Failed to create GL context, CGL error 10004'
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
bugaevc commented 4 years ago

Yeah, that means it still doesn't like your GL setup. strace it and see what it needs but doesn't find.

TheBrokenRail commented 4 years ago

I ran strace and got:

$ ln -s /Volumes/SystemRoot/usr/share/libdrm /usr/share/libdrm
$ ln -s /Volumes/SystemRoot/sys /sys
$ ln -s /Volumes/SystemRoot/usr/share/drirc /usr/share/drirc
$ ln -s /Volumes/SystemRoot/etc/drirc /etc/drirc
$ sudo strace darling shell env LIBGL_DEBUG=verbose HelloWorld.app/Contents/MacOS/HelloWorld
execve("/usr/local/bin/darling", ["darling", "shell", "env", "LIBGL_DEBUG=verbose", "HelloWorld.app/Contents/MacOS/He"...], 0x7ffdcf73a1f0 /* 16 vars */) = 0
brk(NULL)                               = 0xe05000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffef625df10) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=214560, ...}) = 0
mmap(NULL, 214560, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4f61df3000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libutil.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\23\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14848, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4f61df1000
mmap(NULL, 16656, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f4f61dec000
mmap(0x7f4f61ded000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f4f61ded000
mmap(0x7f4f61dee000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f4f61dee000
mmap(0x7f4f61def000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f4f61def000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360r\2\0\0\0\0\0"..., 832) = 832
lseek(3, 64, SEEK_SET)                  = 64
read(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784) = 784
lseek(3, 848, SEEK_SET)                 = 848
read(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32) = 32
lseek(3, 880, SEEK_SET)                 = 880
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0!U\364U\255V\275\207\34\202%\274\312\205\356%"..., 68) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2025032, ...}) = 0
lseek(3, 64, SEEK_SET)                  = 64
read(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784) = 784
lseek(3, 848, SEEK_SET)                 = 848
read(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32) = 32
lseek(3, 880, SEEK_SET)                 = 880
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0!U\364U\255V\275\207\34\202%\274\312\205\356%"..., 68) = 68
mmap(NULL, 2032984, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f4f61bfb000
mmap(0x7f4f61c20000, 1540096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f4f61c20000
mmap(0x7f4f61d98000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7f4f61d98000
mmap(0x7f4f61de2000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e6000) = 0x7f4f61de2000
mmap(0x7f4f61de8000, 13656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4f61de8000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4f61bf8000
arch_prctl(ARCH_SET_FS, 0x7f4f61bf8740) = 0
mprotect(0x7f4f61de2000, 12288, PROT_READ) = 0
mprotect(0x7f4f61def000, 4096, PROT_READ) = 0
mprotect(0x408000, 4096, PROT_READ)     = 0
mprotect(0x7f4f61e54000, 4096, PROT_READ) = 0
munmap(0x7f4f61df3000, 214560)          = 0
geteuid()                               = 0
getuid()                                = 0
getgid()                                = 0
setuid(0)                               = 0
setgid(0)                               = 0
brk(NULL)                               = 0xe05000
brk(0xe26000)                           = 0xe26000
openat(AT_FDCWD, "/proc/modules", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "darling_mach 495616 24 - Live 0x"..., 1024) = 1024
close(3)                                = 0
getcwd("/home/<USERNAME>/Documents/Examples_Cocoa-master/src/HelloWorld", 4096) = 60
stat("/root/.darling", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/root/.darling", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/root/.darling/.init.pid", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=4, ...}) = 0
read(3, "3420", 4096)                   = 4
read(3, "", 4096)                       = 0
close(3)                                = 0
kill(3420, 0)                           = 0
openat(AT_FDCWD, "/proc/3420/comm", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
read(3, "launchd\n", 1024)              = 8
close(3)                                = 0
openat(AT_FDCWD, "/proc/3420/ns/mnt", O_RDONLY) = 3
setns(3, CLONE_NEWNS)                   = 0
close(3)                                = 0
setresuid(-1, 0, -1)                    = 0
socket(AF_UNIX, SOCK_STREAM, 0)         = 3
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/shellspawn.sock"}, 110) = 0
write(3, "\2\0002\0PATH=/usr/bin:/bin:/usr/sbin"..., 54) = 54
write(3, "\2\0\36\0HOME=/Volumes/SystemRoot/roo"..., 34) = 34
write(3, "\1\0\3\0-c\0", 7)             = 7
write(3, "\1\0G\0'env' 'LIBGL_DEBUG=verbose' "..., 75) = 75
write(3, "\3\0O\0/Volumes/SystemRoot/home/con"..., 83) = 83
write(3, "\6\0\10\0\0\0\0\0\0\0\0\0", 12) = 12
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
openat(AT_FDCWD, "/dev/ptmx", O_RDWR)   = 4
statfs("/dev/pts", {f_type=DEVPTS_SUPER_MAGIC, f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={val=[0, 0]}, f_namelen=255, f_frsize=4096, f_flags=ST_VALID|ST_NOSUID|ST_NOEXEC|ST_RELATIME}) = 0
ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, TIOCGPTN, [34])                = 0
stat("/dev/pts/34", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x22), ...}) = 0
getuid()                                = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 5
connect(5, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(5)                                = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 5
connect(5, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(5)                                = 0
openat(AT_FDCWD, "/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=542, ...}) = 0
read(5, "# /etc/nsswitch.conf\n#\n# Example"..., 4096) = 542
read(5, "", 4096)                       = 0
close(5)                                = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=259154, ...}) = 0
mmap(NULL, 259154, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7f4f61bb8000
close(5)                                = 0
openat(AT_FDCWD, "/Volumes/SystemRoot/lib/x86_64-linux-gnu/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 5
read(5, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3005\0\0\0\0\0\0"..., 832) = 832
fstat(5, {st_mode=S_IFREG|0644, st_size=51832, ...}) = 0
mmap(NULL, 79672, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) = 0x7f4f61e14000
mmap(0x7f4f61e17000, 28672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x3000) = 0x7f4f61e17000
mmap(0x7f4f61e1e000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0xa000) = 0x7f4f61e1e000
mmap(0x7f4f61e20000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0xb000) = 0x7f4f61e20000
mmap(0x7f4f61e22000, 22328, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4f61e22000
close(5)                                = 0
mprotect(0x7f4f61e20000, 4096, PROT_READ) = 0
munmap(0x7f4f61bb8000, 259154)          = 0
openat(AT_FDCWD, "/etc/group", O_RDONLY|O_CLOEXEC) = 5
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0644, st_size=1093, ...}) = 0
read(5, "root:x:0:\ndaemon:x:1:\nbin:x:2:\ns"..., 4096) = 1093
close(5)                                = 0
ioctl(4, TIOCSPTLCK, [0])               = 0
ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, TIOCGPTN, [34])                = 0
stat("/dev/pts/34", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x22), ...}) = 0
openat(AT_FDCWD, "/dev/pts/34", O_RDWR|O_NOCTTY) = 5
ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TIOCGWINSZ, {ws_row=56, ws_col=204, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                 ioctl(0, TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                                                                              ioctl(4, TIOCSWINSZ, {ws_row=56, ws_col=204, ws_xpixel=0, ws_ypixel=0}) = 0
             ioctl(1, TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                          ioctl(2, TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                                                                       sendmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\4\0\0\0", iov_len=4}], msg_iovlen=1, msg_control=[{cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[5, 5, 5]}], msg_controllen=32, msg_flags=0}, 0) = 4
                                                                                                                                                                     close(5)                                = 0
    rt_sigaction(SIGHUP, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                     rt_sigaction(SIGINT, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                          rt_sigaction(SIGQUIT, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                                                                            rt_sigaction(SIGILL, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                 rt_sigaction(SIGTRAP, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                       rt_sigaction(SIGABRT, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                                                         rt_sigaction(SIGBUS, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                              rt_sigaction(SIGFPE, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                   rt_sigaction(SIGKILL, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = -1 EINVAL (Invalid argument)
                                                                                                                                                                                rt_sigaction(SIGUSR1, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                      rt_sigaction(SIGSEGV, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                            rt_sigaction(SIGUSR2, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                                              rt_sigaction(SIGPIPE, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                    rt_sigaction(SIGALRM, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
          rt_sigaction(SIGTERM, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                            rt_sigaction(SIGSTKFLT, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                    rt_sigaction(SIGCHLD, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                                                                                      rt_sigaction(SIGCONT, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                            rt_sigaction(SIGSTOP, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = -1 EINVAL (Invalid argument)
                                                                             rt_sigaction(SIGTSTP, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
   rt_sigaction(SIGTTIN, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                     rt_sigaction(SIGTTOU, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                           rt_sigaction(SIGURG, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                                                                            rt_sigaction(SIGXCPU, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                  rt_sigaction(SIGXFSZ, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                        rt_sigaction(SIGVTALRM, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                                                            rt_sigaction(SIGPROF, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                  rt_sigaction(SIGWINCH, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                         rt_sigaction(SIGIO, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                                                                                                         rt_sigaction(SIGPWR, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
                                                                              rt_sigaction(SIGSYS, {sa_handler=0x405420, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7f4f61c41470}, NULL, 8) = 0
   fcntl(4, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
                                              fcntl(0, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
                                                                                         fcntl(3, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
                                                                                                                                    poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])
                                         read(4, "2020-01-05 15:31:44.979 HelloWor"..., 4096) = 166
                                                                                                   write(1, "2020-01-05 15:31:44.979 HelloWor"..., 1662020-01-05 15:31:44.979 HelloWorld[98:0] convertFont:toHaveTrait: failed, Arial 2
2020-01-05 15:31:44.979 HelloWorld[98:0] convertFont:toHaveTrait: failed, Arial 1
) = 166
       poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])
                                                                                                                        read(4, "2020-01-05 15:31:45.289 HelloWor"..., 4096) = 77
                                                                                                                                                                                 write(1, "2020-01-05 15:31:45.289 HelloWor"..., 772020-01-05 15:31:45.289 HelloWorld[98:0] FreeType font face is not scalable
) = 77
      poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])
                                                                                                                       read(4, "libGL: Can't open configuration "..., 4096) = 1107
                                                                                                                                                                                  write(1, "libGL: Can't open configuration "..., 1107libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /Volumes/SystemRoot/root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /Volumes/SystemRoot/root/.drirc: No such file or directory.
libGL error: MESA-LOADER: failed to retrieve device information
libGL: using driver amdgpu for 20
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/amdgpu_dri.so: \$${ORIGIN}/dri/amdgpu_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/amdgpu_dri.so: /usr/lib/dri/amdgpu_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open amdgpu (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: amdgpu
) = 1107
        poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])
                                                                                                                         read(4, "libGL: Can't open configuration "..., 4096) = 932
                                                                                                                                                                                   write(1, "libGL: Can't open configuration "..., 932libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /Volumes/SystemRoot/root/.drirc: No such file or directory.
libGL error: MESA-LOADER: failed to retrieve device information
libGL: using driver amdgpu for 20
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/amdgpu_dri.so: \$${ORIGIN}/dri/amdgpu_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/amdgpu_dri.so: /usr/lib/dri/amdgpu_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open amdgpu (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: amdgpu
) = 932
       poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])
                                                                                                                        read(4, "libGL: MESA-LOADER: failed to op"..., 4096) = 657
                                                                                                                                                                                  write(1, "libGL: MESA-LOADER: failed to op"..., 657libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open \$${ORIGIN}/dri/swrast_dri.so: \$${ORIGIN}/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/dri/swrast_dri.so: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
) = 657
       poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])
                                                                                                                        read(4, "2020-01-05 15:31:45.900 HelloWor"..., 4096) = 182
                                                                                                                                                                                  write(1, "2020-01-05 15:31:45.900 HelloWor"..., 1822020-01-05 15:31:45.900 HelloWorld[98:0] CGLCreateContext failed at /home/<USERNAME>/Documents/darling/darling/src/external/cocotron/AppKit/X11.backend/X11Window.m 443 with error 10004
) = 182
       poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])
                                                                                                                        read(4, "2020-01-05 15:31:45.901 HelloWor"..., 4096) = 228
                                                                                                                                                                                  write(1, "2020-01-05 15:31:45.901 HelloWor"..., 2282020-01-05 15:31:45.901 HelloWorld[98:0] Terminating app due to uncaught exception 'NSException', reason: 'Failed to create GL context, CGL error 10004'
libc++abi.dylib: terminating with uncaught exception of type NSException
) = 228
       poll([{fd=3, events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}], 3, -1) = 1 ([{fd=3, revents=POLLIN}])
                                                                                                                        read(3, "\0\0\0\0", 4)                  = 4
                                                                                                                                                                   ioctl(0, TCGETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                    ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
exit_group(0)                           = ?
+++ exited with 0 +++
bugaevc commented 4 years ago

Don't strace darling shell, that's only going to give you the syscalls Darling shell itself makes, not the processes running inside the container.

Do this: start Darling shell as usual, then from a regular Linux shell figure out the PID of bash running inside, then run strace -fp that_pid, then go back to that bash and run the app from there.

TheBrokenRail commented 4 years ago

Without /usr/share/glvnd: strace1.txt With /usr/share/glvnd: strace2.txt

TheBrokenRail commented 4 years ago

Core dump: core.zip

TheBrokenRail commented 4 years ago

Fixed by #377