Bug 249381 - [linuxlator] Failing linux_socket(0x10,0x3,0) causes PulseAudio under Linux emulator to fail
Summary: [linuxlator] Failing linux_socket(0x10,0x3,0) causes PulseAudio under Linux e...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 12.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-17 01:36 UTC by Yuri Victorovich
Modified: 2020-09-29 01:36 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2020-09-17 01:36:30 UTC
Linux apps using PulseAudio print this and fail:
> setsockopt(SOL_SOCKET, SO_PASSCRED): Protocol not available

Here are the corresponding lines from ktrace:
>  14619 zoom     CALL  linux_socket(0x10,0x3,0)
>  14619 zoom     RET   linux_socket -1 errno -97 Address family not supported by protocol family

It is probably wise to support such 'socket' call because it is important to support PulseAudio.


> FreeBSD xx.xx.xx 12.2-STABLE FreeBSD 12.2-STABLE #1 r365688M: Sun Sep 13 05:26:18 PDT 2020     unknown@xx.xx:/huge-disk/sys/usr/src/amd64.amd64/sys/GENERIC  amd64
Comment 1 Yuri Victorovich freebsd_committer 2020-09-17 02:04:29 UTC
Correction: the kernel log of the failed setsockopt is:
>  15432 zoom     CALL  linux_setsockopt(0x30,0x1,0xc,0x7fffffffb964,0x4)
>  15432 zoom     RET   linux_setsockopt -1 errno -92 Protocol not available
Comment 2 Alex S 2020-09-20 00:45:55 UTC
Also see bug 206083.
Comment 3 break19 2020-09-29 00:59:01 UTC
This is also apparently causing the linux Discordapp to coredump.

from linux-c7-strace
> wait4(6206, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 6206
> lstat("/opt", {st_mode=S_IFDIR|0755, st_size=2, ...}) = 0
> lstat("/opt/Discord", {st_mode=S_IFDIR|0755, st_size=20, ...}) = 0
> lstat("/opt/Discord/Discord", {st_mode=S_IFREG|0755, st_size=115293392, ...}) = 0
> socketpair(AF_UNIX, SOCK_SEQPACKET, 0, [10, 11]) = 0
> setsockopt(10, SOL_SOCKET, SO_PASSCRED, [1], 4) = -1 ENOPROTOOPT (Protocol not available)
> --- SIGTRAP {si_signo=SIGTRAP, si_code=TRAP_BRKPT} ---
> /compat/linux/usr/bin/strace: [ Process PID=6205 runs in x32 mode. ]
> syscall_0xfffffffffffffffc(0x8479f19a0, 0x2, 0xffffffff, 0x7fffffff, 0, 0x2 <unfinished ...>
> +++ killed by SIGTRAP +++
> [1]    6203 trace trap  /compat/linux/usr/bin/strace ./Discord

and from ktrace/kdump:

>  6251 Discord  CALL  linux_setsockopt(0xa,0x1,0x10,0x7fffffffcb7c,0x4)
>  6251 Discord  RET   linux_setsockopt -1 errno -92 Protocol not available
>  6251 Discord  PSIG  SIGTRAP SIG_DFL code=TRAP_BRKPT
>  6251 Discord  RET   poll -1 errno -4 Interrupted system call
>  6251 Discord  NAMI  "sandbox_ipc_thr.core"