我注意到一件奇怪的事情。当我以普通用户身份运行该file
命令时,总是收到无效的系统调用错误。
例如在桀骜:
$ file ~/.zshrc
[1] 18553 invalid system call file ~/.zshrc
$ file ~/.bashrc
Bad system call
它不依赖于目标文件、wm 环境(也发生在 tty 中)并且似乎也不依赖于 shell。
避免此错误的唯一方法是以 root 身份运行该命令或使用以下命令sudo
:
$ sudo file ~/.bashrc
/home/user/.bashrc: ASCII text
它看起来不像预期的行为。有谁知道什么会导致这个问题?
我不知道如何继续调试这个。任何评论或链接都可能有用,因为我没有找到与该file
命令直接相关的任何内容,这似乎只是受此影响的一个命令。
编辑1
ls
并且df
命令按预期工作。
$ ls -alGg .bashrc
-rw-r--r-- 1 603 31. led 11.09 .bashrc
$ df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p5 420G 419G 1.5G 100% /home
file
我使用的命令:
$ whereis file
file: /usr/bin/file /usr/share/man/man1/file.1.bz2 /usr/share/man/man1p/file.1p.bz2 /usr/share/man/mann/file.n.bz2
$ which file
/usr/bin/file
$ command -v file
/usr/bin/file
$ file -v
file-5.39
magic file from /usr/share/misc/magic
seccomp support included
编辑2
我使用 Gentoo 并发现当我编译时file
包装无seccomp
使用标志,效果很好。
编辑3
$ strace file ~/.bashrc
execve("/usr/bin/file", ["file", "/home/user/.bashrc"], 0x7fff74d08c58 /* 74 vars */) = 0
brk(NULL) = 0x55e04e3e3000
openat(AT_FDCWD, "/usr/lib64/libgio-2.0.so.0", 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\320\270\3\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1857608, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff54a543000
mmap(NULL, 1867584, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff54a37b000
mprotect(0x7ff54a3b3000, 1593344, PROT_NONE) = 0
mmap(0x7ff54a3b3000, 1040384, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x38000) = 0x7ff54a3b3000
mmap(0x7ff54a4b1000, 548864, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x136000) = 0x7ff54a4b1000
mmap(0x7ff54a538000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bc000) = 0x7ff54a538000
mmap(0x7ff54a542000, 3904, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff54a542000
close(3) = 0
openat(AT_FDCWD, "/usr/lib64/libglib-2.0.so.0", 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\260\315\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1201032, ...}) = 0
mmap(NULL, 1206440, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff54a254000
mprotect(0x7ff54a270000, 1081344, PROT_NONE) = 0
mmap(0x7ff54a270000, 532480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c000) = 0x7ff54a270000
mmap(0x7ff54a2f2000, 544768, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9e000) = 0x7ff54a2f2000
mmap(0x7ff54a378000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x123000) = 0x7ff54a378000
mmap(0x7ff54a37a000, 2216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff54a37a000
close(3) = 0
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=218596, ...}) = 0
mmap(NULL, 218596, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff54a21e000
close(3) = 0
openat(AT_FDCWD, "/usr/lib64/libmagic.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\0PG\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=158712, ...}) = 0
mmap(NULL, 161688, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff54a1f6000
mmap(0x7ff54a1fa000, 102400, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7ff54a1fa000
mmap(0x7ff54a213000, 36864, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d000) = 0x7ff54a213000
mmap(0x7ff54a21c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7ff54a21c000
close(3) = 0
openat(AT_FDCWD, "/usr/lib64/libseccomp.so.2", 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\320Q\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=309280, ...}) = 0
mmap(NULL, 311568, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff54a1a9000
mmap(0x7ff54a1ce000, 40960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7ff54a1ce000
mmap(0x7ff54a1d8000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2f000) = 0x7ff54a1d8000
mmap(0x7ff54a1dc000, 106496, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x32000) = 0x7ff54a1dc000
close(3) = 0
openat(AT_FDCWD, "/lib64/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\0@\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1798224, ...}) = 0
mmap(NULL, 1811664, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549fee000
mmap(0x7ff54a010000, 1327104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7ff54a010000
mmap(0x7ff54a154000, 307200, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x166000) = 0x7ff54a154000
mmap(0x7ff54a19f000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b0000) = 0x7ff54a19f000
mmap(0x7ff54a1a5000, 13520, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff54a1a5000
close(3) = 0
openat(AT_FDCWD, "/usr/lib64/libgobject-2.0.so.0", 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@\347\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=379696, ...}) = 0
mmap(NULL, 384776, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549f90000
mmap(0x7ff549f9e000, 212992, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe000) = 0x7ff549f9e000
mmap(0x7ff549fd2000, 98304, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x42000) = 0x7ff549fd2000
mmap(0x7ff549fea000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x59000) = 0x7ff549fea000
close(3) = 0
openat(AT_FDCWD, "/usr/lib64/libgmodule-2.0.so.0", 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@\22\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=18472, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff549f8e000
mmap(NULL, 20888, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549f88000
mmap(0x7ff549f89000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7ff549f89000
mmap(0x7ff549f8b000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7ff549f8b000
mmap(0x7ff549f8c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7ff549f8c000
close(3) = 0
openat(AT_FDCWD, "/lib64/libz.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\0203\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=100592, ...}) = 0
mmap(NULL, 102800, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549f6e000
mmap(0x7ff549f71000, 57344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7ff549f71000
mmap(0x7ff549f7f000, 28672, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11000) = 0x7ff549f7f000
mmap(0x7ff549f86000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7ff549f86000
close(3) = 0
openat(AT_FDCWD, "/lib64/libmount.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\332\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=382776, ...}) = 0
mmap(NULL, 385800, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549f0f000
mprotect(0x7ff549f1b000, 327680, PROT_NONE) = 0
mmap(0x7ff549f1b000, 245760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7ff549f1b000
mmap(0x7ff549f57000, 77824, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x48000) = 0x7ff549f57000
mmap(0x7ff549f6b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5b000) = 0x7ff549f6b000
mmap(0x7ff549f6d000, 776, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff549f6d000
close(3) = 0
openat(AT_FDCWD, "/lib64/libresolv.so.2", 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\260C\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=84528, ...}) = 0
mmap(NULL, 96896, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549ef7000
mprotect(0x7ff549efb000, 65536, PROT_NONE) = 0
mmap(0x7ff549efb000, 49152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7ff549efb000
mmap(0x7ff549f07000, 12288, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7ff549f07000
mmap(0x7ff549f0b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x7ff549f0b000
mmap(0x7ff549f0d000, 6784, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff549f0d000
close(3) = 0
openat(AT_FDCWD, "/lib64/libpthread.so.0", 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\360k\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=148000, ...}) = 0
mmap(NULL, 128088, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549ed7000
mmap(0x7ff549edd000, 61440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7ff549edd000
mmap(0x7ff549eec000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7ff549eec000
mmap(0x7ff549ef1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0x7ff549ef1000
mmap(0x7ff549ef3000, 13400, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff549ef3000
close(3) = 0
openat(AT_FDCWD, "/lib64/libpcre.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\360!\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=460856, ...}) = 0
mmap(NULL, 463336, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549e65000
mmap(0x7ff549e67000, 327680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ff549e67000
mmap(0x7ff549eb7000, 122880, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x52000) = 0x7ff549eb7000
mmap(0x7ff549ed5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6f000) = 0x7ff549ed5000
close(3) = 0
openat(AT_FDCWD, "/lib64/libbz2.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\260\"\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=74904, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff549e63000
mmap(NULL, 77192, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549e50000
mmap(0x7ff549e52000, 53248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ff549e52000
mmap(0x7ff549e5f000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7ff549e5f000
mmap(0x7ff549e61000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7ff549e61000
close(3) = 0
openat(AT_FDCWD, "/usr/lib64/libffi.so.7", 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\300\"\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=43280, ...}) = 0
mmap(NULL, 46728, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549e44000
mprotect(0x7ff549e46000, 32768, PROT_NONE) = 0
mmap(0x7ff549e46000, 24576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ff549e46000
mmap(0x7ff549e4c000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7ff549e4c000
mmap(0x7ff549e4e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7ff549e4e000
close(3) = 0
openat(AT_FDCWD, "/lib64/libdl.so.2", 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\0000\21\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=14320, ...}) = 0
mmap(NULL, 16656, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549e3f000
mmap(0x7ff549e40000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7ff549e40000
mmap(0x7ff549e41000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ff549e41000
mmap(0x7ff549e42000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ff549e42000
close(3) = 0
openat(AT_FDCWD, "/lib64/libblkid.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\20\237\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=328408, ...}) = 0
mmap(NULL, 331432, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff549dee000
mmap(0x7ff549df7000, 208896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7ff549df7000
mmap(0x7ff549e2a000, 65536, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3c000) = 0x7ff549e2a000
mmap(0x7ff549e3a000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4b000) = 0x7ff549e3a000
close(3) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff549dec000
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff549de9000
arch_prctl(ARCH_SET_FS, 0x7ff549de9740) = 0
mprotect(0x7ff54a19f000, 16384, PROT_READ) = 0
mprotect(0x7ff549e3a000, 16384, PROT_READ) = 0
mprotect(0x7ff549e42000, 4096, PROT_READ) = 0
mprotect(0x7ff549e4e000, 4096, PROT_READ) = 0
mprotect(0x7ff549e61000, 4096, PROT_READ) = 0
mprotect(0x7ff549ef1000, 4096, PROT_READ) = 0
mprotect(0x7ff549ed5000, 4096, PROT_READ) = 0
mprotect(0x7ff549f0b000, 4096, PROT_READ) = 0
mprotect(0x7ff549f6b000, 4096, PROT_READ) = 0
mprotect(0x7ff549f86000, 4096, PROT_READ) = 0
mprotect(0x7ff54a378000, 4096, PROT_READ) = 0
mprotect(0x7ff549f8c000, 4096, PROT_READ) = 0
mprotect(0x7ff549fea000, 12288, PROT_READ) = 0
mprotect(0x7ff54a1dc000, 102400, PROT_READ) = 0
mprotect(0x7ff54a21c000, 4096, PROT_READ) = 0
mprotect(0x7ff54a538000, 28672, PROT_READ) = 0
mprotect(0x55e04d057000, 4096, PROT_READ) = 0
mprotect(0x7ff54a56f000, 4096, PROT_READ) = 0
munmap(0x7ff54a21e000, 218596) = 0
set_tid_address(0x7ff549de9a10) = 20864
set_robust_list(0x7ff549de9a20, 24) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7ff549edd650, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7ff549ee9820}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7ff549edd6f0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff549ee9820}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(NULL) = 0x55e04e3e3000
brk(0x55e04e404000) = 0x55e04e404000
futex(0x7ff54a37a618, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7ff54a37a618, FUTEX_WAKE_PRIVATE, 2147483647) = 0
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=225035648, ...}) = 0
mmap(NULL, 225035648, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff53c74c000
close(3) = 0
prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) = 0
prctl(PR_SET_DUMPABLE, SUID_DUMP_DISABLE) = 0
prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) = 0
seccomp(SECCOMP_SET_MODE_STRICT, 1, NULL) = -1 EINVAL (Invalid argument)
seccomp(SECCOMP_SET_MODE_FILTER, 0, 0x55e04e3f0760) = 0
stat(0x55e04e3f0b30, 0x7ffc52d15900) = -1 ENOENT (No such file or directory)
stat(0x55e04e3f0b30, 0x7ffc52d15900) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x55e04e3f4270, O_RDONLY) = 3
fstat(3, 0x7ffc52d159e0) = 0
mmap(NULL, 6652192, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7ff53c0f3000
close(3) = 0
mprotect(0x7ff53c0f3000, 6652192, PROT_READ) = 0
openat(AT_FDCWD, 0x7ff54a1724d0, O_RDONLY) = 3
fstat(3, 0x7ffc52d15710) = 0
mmap(NULL, 26988, PROT_READ, MAP_SHARED, 3, 0) = 0x7ff54a24d000
close(3) = 0
futex(0x7ff54a1a4974, FUTEX_WAKE_PRIVATE, 2147483647) = ?
+++ killed by SIGSYS +++
[1] 20861 invalid system call strace file ~/.bashrc
答案1
从strace file ~/.bashrc
:
seccomp(SECCOMP_SET_MODE_STRICT, 1, NULL) = -1 EINVAL (Invalid argument)
seccomp(SECCOMP_SET_MODE_FILTER, 0, 0x55e04e3f0760) = 0
stat(0x55e04e3f0b30, 0x7ffc52d15900) = -1 ENOENT (No such file or directory)
stat(0x55e04e3f0b30, 0x7ffc52d15900) = -1 ENOENT (No such file or directory)
对我来说一种解决方案是编译系统应用程序/文件禁用 USE 标志的软件包。另一种方法是同时启用和启用 USE 标志seccomp
来编译软件包。seccomp
lzma
从equery uses file
:
lzma : Support for LZMA (de)compression algorithm
seccomp : Enable seccomp (secure computing mode) to perform system call
filtering at runtime to increase security of programs
这似乎是上游的一个错误。https://bugs.gentoo.org/771096