You are not logged in.

#1 2020-01-18 16:34:32

zw963
Member
Registered: 2018-06-18
Posts: 200

[Solved] /usr/bin/file issue which introduced by recent pacman -Syu

e.g.  /home/zw963/Dropbox/common/git/git_reset_1 is a bash script.

$: /usr/bin/file -L /home/zw963/Dropbox/common/git/git_reset_1
/home/zw963/Dropbox/common/git/git_reset_1: Bourne-Again shell script, UTF-8 Unicode text executable
Bad system call
$: echo $?
159

As example above, file command return 159, which cause bash script return status code issue

$ pacman -F /usr/bin/file
usr/bin/file is owned by core/file 5.37-4
$: ldd /usr/bin/file
        linux-vdso.so.1 (0x00007ffd8f076000)
        /lib/$LIB/liblsp.so => /lib/lib/liblsp.so (0x00007f13d5882000)
        libmagic.so.1 => /usr/lib/libmagic.so.1 (0x00007f13d5817000)
        libseccomp.so.2 => /usr/lib/libseccomp.so.2 (0x00007f13d57ce000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f13d57ac000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f13d55e5000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f13d55e0000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f13d55b6000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f13d55a3000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007f13d5589000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f13d5a92000)

$: bash --version
GNU bash, version 5.0.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Thank you.

Last edited by zw963 (2020-02-11 18:31:49)

Offline

#2 2020-01-18 16:35:46

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,582

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

pacman -F doesn't do what you think it does. See what version you actually have installed.

Offline

#3 2020-01-18 16:42:09

zw963
Member
Registered: 2018-06-18
Posts: 200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

@Scimmia, thank you for replied.

$: pacman -S file
warning: file-5.38-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) file-5.38-1

Total Installed Size:  5.75 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] ^C
Interrupt signal received

$: /usr/bin/file --version
file-5.38
magic file from /usr/share/file/misc/magic
seccomp support included

$: file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=62d57fc858465b6c1ac7a60c89da4e077fb13e87, for GNU/Linux 3.2.0, stripped
Bad system call

Last edited by zw963 (2020-01-18 16:43:10)

Offline

#4 2020-01-19 03:49:30

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

Under what circumstances would running file without options on an ELF file produce a seccomp violation?

Do you have LD_PRELOAD exported to your environment in order to inject random libraries into file's runtime? This error has previously shown up when e.g. running makepkg's packaging functions under fakeroot.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2020-01-19 14:35:50

zw963
Member
Registered: 2018-06-18
Posts: 200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

eschwartz wrote:

Under what circumstances would running file without options on an ELF file produce a seccomp violation?

Do you have LD_PRELOAD exported to your environment in order to inject random libraries into file's runtime? This error has previously shown up when e.g. running makepkg's packaging functions under fakeroot.

╰─ $ file 1.txt
1.txt: JSON data
Bad system call

 ╭─ 22:34  zw963 ⮀ ~/Airhost/airhost_ror ⮀ ⭠ (415fb9863) production *$%  ➦ ruby-2.6.1@airhost_ror
 ╰─ $ 159  echo -$LD_PRELOAD-
--

In fact, i never change anything before update file command use "pamcan -Syu".

Offline

#6 2020-01-19 14:46:37

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

So, that doesn't look like your interactive shell is bash.

If you were using bash, I might ask you to run "type -a file" to see what possible copies of "file" you have, and which aliases or functions may be modifying how it is called. I'm not sure how you would check this while using another shell, though.

Also, please tell me you are not using oh-my-zsh...

EDIT: also why is this reporting both:

1.txt: JSON data
Bad system call

You only ran "file" on one argument, so it should only report one thing. I don't understand how this output could come from file itself, or file alone. So it now becomes extremely important to figure out, just what are you running???

Last edited by eschwartz (2020-01-19 14:48:50)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2020-01-20 13:08:46

zw963
Member
Registered: 2018-06-18
Posts: 200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

eschwartz wrote:

So, that doesn't look like your interactive shell is bash.

If you were using bash, I might ask you to run "type -a file" to see what possible copies of "file" you have, and which aliases or functions may be modifying how it is called. I'm not sure how you would check this while using another shell, though.

Also, please tell me you are not using oh-my-zsh...

EDIT: also why is this reporting both:

1.txt: JSON data
Bad system call

You only ran "file" on one argument, so it should only report one thing. I don't understand how this output could come from file itself, or file alone. So it now becomes extremely important to figure out, just what are you running???

Thank you for replied.

 ╰─ $ type -a file
file is /usr/sbin/file
file is /sbin/file
file is /usr/bin/file

 ╭─ 21:01  zw963 ⮀ ~/Dropbox/common/ruby ⮀ ⭠ (ca22abeff) test *$%  ➦
 ╰─ $ echo $$
12704

 ╭─ 21:02  zw963 ⮀ ~/Dropbox/common/ruby ⮀ ⭠ (ca22abeff) test *$%  ➦
 ╰─ $ ps aux |grep 12704
zw963      12704  0.0  0.0  20712 12860 pts/1    Ss   20:48   0:00 /bin/bash
zw963      17678  0.0  0.0  13092  4512 pts/1    S+   21:02   0:00 /bin/bash /home/zw963/Dropbox/common/wrapper/grep 12704

 ╭─ 21:02  zw963 ⮀ ~/Dropbox/common/ruby ⮀ ⭠ (ca22abeff) test *$%  ➦
 ╰─ $ ls -alh /usr/sbin/file /sbin/file /usr/bin/file
-rwxr-xr-x 1 root root 31K 2020-01-08 06:59 /sbin/file*
-rwxr-xr-x 1 root root 31K 2020-01-08 06:59 /usr/bin/file*
-rwxr-xr-x 1 root root 31K 2020-01-08 06:59 /usr/sbin/file*

EDIT: ----------------------------------------

In fact, i create a fresh new user, and logged in, get same error, i use konsole, same issue happen on Gnome Terminal.

BTW: i use budgie-desktop, hope not bug from it, and never use oh-my-zsh. : )

Last edited by zw963 (2020-01-20 13:20:02)

Offline

#8 2020-01-20 15:07:38

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

 ╰─ $ ps aux |grep 12704
zw963      12704  0.0  0.0  20712 12860 pts/1    Ss   20:48   0:00 /bin/bash
zw963      17678  0.0  0.0  13092  4512 pts/1    S+   21:02   0:00 /bin/bash /home/zw963/Dropbox/common/wrapper/grep 12704

o_O

...

What is the sha256sum of /usr/bin/file?

What is the output of running:

set -x
file /usr/bin/file

Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#9 2020-01-20 21:03:20

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,881
Website

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

As another datapoint, it seems like the new version of file doesn't like stdout being redirected to /dev/null (and seemingly exclusively so).

$ touch testfile
$ file testfile
testfile: empty
$ file testfile >/dev/null
Bad system call

## can redirect to a file:
$ file testfile >/tmp/file
$ cat /tmp/file
testfile: empty

## Can redirect stderr
$ file testfile 2>/dev/null
testfile: empty

$ strace file testfile >/dev/null
execve("/usr/bin/file", ["file", "testfile"], 0x7ffd0f27d888 /* 51 vars */) = 0
brk(NULL)                               = 0x55ea34686000
arch_prctl(0x3001 /* ARCH_??? */, 0x7fff69ba9d90) = -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=258531, ...}) = 0
mmap(NULL, 258531, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f24f02b6000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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\0 @\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=153584, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f24f02b4000
mmap(NULL, 156648, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f24f028d000
mmap(0x7f24f0291000, 98304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f24f0291000
mmap(0x7f24f02a9000, 32768, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c000) = 0x7f24f02a9000
mmap(0x7f24f02b1000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x23000) = 0x7f24f02b1000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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 0\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=292560, ...}) = 0
mmap(NULL, 294960, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f24f0244000
mmap(0x7f24f0267000, 40960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x23000) = 0x7f24f0267000
mmap(0x7f24f0271000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2d000) = 0x7f24f0271000
mmap(0x7f24f0275000, 98304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x30000) = 0x7f24f0275000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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\360\201\0\0\0\0\0\0"..., 832) = 832
lseek(3, 824, SEEK_SET)                 = 824
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\213\4\321\202[c\331\246\0\343\325z\307\20X\223"..., 68) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=159824, ...}) = 0
lseek(3, 824, SEEK_SET)                 = 824
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\213\4\321\202[c\331\246\0\343\325z\307\20X\223"..., 68) = 68
mmap(NULL, 135592, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f24f0222000
mmap(0x7f24f0229000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f24f0229000
mmap(0x7f24f0239000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f24f0239000
mmap(0x7f24f023e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f24f023e000
mmap(0x7f24f0240000, 12712, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f24f0240000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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`r\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\0003\321\363P\3617(e\35t\335*V\272\321\344"..., 68) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2149496, ...}) = 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\0003\321\363P\3617(e\35t\335*V\272\321\344"..., 68) = 68
mmap(NULL, 1860536, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f24f005b000
mprotect(0x7f24f0080000, 1671168, PROT_NONE) = 0
mmap(0x7f24f0080000, 1363968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f24f0080000
mmap(0x7f24f01cd000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x172000) = 0x7f24f01cd000
mmap(0x7f24f0218000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bc000) = 0x7f24f0218000
mmap(0x7f24f021e000, 13240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f24f021e000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/liblzma.so.5", 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 0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=157440, ...}) = 0
mmap(NULL, 159760, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f24f0033000
mprotect(0x7f24f0036000, 143360, PROT_NONE) = 0
mmap(0x7f24f0036000, 94208, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f24f0036000
mmap(0x7f24f004d000, 45056, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a000) = 0x7f24f004d000
mmap(0x7f24f0059000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f24f0059000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libbz2.so.1.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  \0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=74440, ...}) = 0
mmap(NULL, 76840, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f24f0020000
mmap(0x7f24f0022000, 53248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f24f0022000
mmap(0x7f24f002f000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f24f002f000
mmap(0x7f24f0031000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7f24f0031000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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 0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=100096, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f24f001e000
mmap(NULL, 102416, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f24f0004000
mprotect(0x7f24f0007000, 86016, PROT_NONE) = 0
mmap(0x7f24f0007000, 57344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f24f0007000
mmap(0x7f24f0015000, 24576, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11000) = 0x7f24f0015000
mmap(0x7f24f001c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f24f001c000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f24f0001000
arch_prctl(ARCH_SET_FS, 0x7f24f0001740) = 0
mprotect(0x7f24f0218000, 12288, PROT_READ) = 0
mprotect(0x7f24f001c000, 4096, PROT_READ) = 0
mprotect(0x7f24f0031000, 4096, PROT_READ) = 0
mprotect(0x7f24f023e000, 4096, PROT_READ) = 0
mprotect(0x7f24f0059000, 4096, PROT_READ) = 0
mprotect(0x7f24f0275000, 94208, PROT_READ) = 0
mprotect(0x7f24f02b1000, 8192, PROT_READ) = 0
mprotect(0x55ea334df000, 4096, PROT_READ) = 0
mprotect(0x7f24f0320000, 4096, PROT_READ) = 0
munmap(0x7f24f02b6000, 258531)          = 0
set_tid_address(0x7f24f0001a10)         = 274532
set_robust_list(0x7f24f0001a20, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f24f0229c40, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f24f0236930}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f24f0229ce0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f24f0236930}, 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)                               = 0x55ea34686000
brk(0x55ea346a7000)                     = 0x55ea346a7000
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3039760, ...}) = 0
mmap(NULL, 3039760, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f24efd1a000
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, 0x55ea34687b60) = 0
stat(0x55ea34687f30, 0x7fff69ba9b00)    = -1 ENOENT (No such file or directory)
stat(0x55ea34687f30, 0x7fff69ba9b00)    = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x55ea3468d2a0, O_RDONLY) = 3
fstat(3, 0x7fff69ba9be0)                = 0
mmap(NULL, 5818072, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7f24ef78d000
close(3)                                = 0
mprotect(0x7f24ef78d000, 5818072, PROT_READ) = 0
openat(AT_FDCWD, 0x7f24f01e9a10, O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, 0x7fff69ba99c0, O_RDONLY|O_CLOEXEC) = 3
fstat(3, 0x7fff69ba9830)                = 0
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 4096
brk(0x55ea346c8000)                     = 0x55ea346c8000
read(3, 0x55ea3468e370, 4096)           = 4096
read(3, 0x55ea3468e370, 4096)           = 3104
read(3, "", 4096)                       = 0
close(3)                                = 0
futex(0x7f24f021d494, FUTEX_WAKE_PRIVATE, 2147483647) = 0
fstat(1, 0x7fff69ba9510)                = 0
ioctl(1, TCGETS <unfinished ...>)       = ?
+++ killed by SIGSYS +++
Bad system call (core dumped)

$ coredumpctl gdb                
           PID: 2123 (strace)
           UID: 1000 (wormzy)
           GID: 1000 (wormzy)
        Signal: 31 (SYS)
     Timestamp: Mon 2020-01-20 20:48:14 GMT (5s ago)
  Command Line: strace file testfile
    Executable: /usr/bin/strace
 Control Group: /user.slice/user-1000.slice/session-2.scope
          Unit: session-2.scope
         Slice: user-1000.slice
       Session: 2
     Owner UID: 1000 (wormzy)
       Boot ID: 6e2151d49ed2488098cbe537b96e6fff
    Machine ID: 43402ea1a3ed4af3a2101aaecf0eb8fb
      Hostname: sakura
       Storage: none
       Message: Process 2123 (strace) of user 1000 dumped core.

Coredump entry has no core attached (neither internally in the journal nor externally on disk).

However, I also don't understand how you are getting both the file output and the bad system call message, especially with a new user.

EDIT: I can't reproduce this with file-5.37-5, or with 5.38 with seccomp disabled.

Last edited by WorMzy (2020-01-20 21:36:59)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#10 2020-01-20 21:37:28

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

While I'm still confused about the double results, it looks like there's one "good" reason to have file return a bad system call on some systems but not others: you might be using the tty directly, not via an X/Wayland session in turn running some terminal emulator.

https://bugs.astron.com/view.php?id=130


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#11 2020-01-20 22:33:45

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,881
Website

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

I trigger the same behaviour whether I'm in X, on a TTY, or SSH'd in from another host, and can reproduce it on two different systems, but that patch fixes it on both. Thanks for the link, good to know it'll be fixed in the next version.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#12 2020-01-20 23:26:59

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

The tty issue manifests regardless of whether you redirect to /dev/null, but your strace for /dev/null *also* uses TCGETS, so it will fix that too.

Last edited by eschwartz (2020-01-20 23:27:57)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#13 2020-01-25 11:03:42

zw963
Member
Registered: 2018-06-18
Posts: 200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

Thank you for let me know will be fix on next version.


What is the sha256sum of /usr/bin/file?

 ╰─ $ sha256sum /usr/bin/file
c2c23c376e00fadbe2967165d900664628024bfa625bc5a3b1e76b6e981eec67  /usr/bin/file

What is the output of running:

set -x
file /usr/bin/file

╰─ $ file /usr/bin/file
+ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=62d57fc858465b6c1ac7a60c89da4e077fb13e87, for GNU/Linux 3.2.0, stripped
Bad system call
++ __powerbash_ps1 on
++ local RETURN_CODE=159
++ case "$1" in
++ __powerbash_colors
+++ tput colors
++ ((  256 < 256  ))
+++ tput setaf 15
+++ tput setab 8
++ COLOR_USER='\[\]\[\]'

.... 
a very long output

BTW: i test on raw terminal. (After press Ctrl+Alt+F3, logged in as root user) when run file command there, get same error.


Thank you.

-------------------------------------------------

UPDATE:

Following is the strace result after i switch to root.

[root@lggram treemacs]# strace file /
execve("/usr/sbin/file", ["file", "/"], 0x7ffee32156c8 /* 20 vars */) = 0
brk(NULL)                               = 0x55599e5d2000
arch_prctl(0x3001 /* ARCH_??? */, 0x7fff392e2f80) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK)      = 0
openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=20, ...}) = 0
mmap(NULL, 20, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7f936a9ad000
close(3)                                = 0
readlink("/proc/self/exe", "/usr/bin/file", 4096) = 13
openat(AT_FDCWD, "/lib/lib/liblsp.so", 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\0P\24\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=18896, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f936a982000
mmap(NULL, 2114376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a77d000
mprotect(0x7f936a781000, 2093056, PROT_NONE) = 0
mmap(0x7f936a980000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f936a980000
close(3)                                = 0
munmap(0x7f936a9ad000, 20)              = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=275822, ...}) = 0
mmap(NULL, 275822, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f936a739000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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\0 @\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=153584, ...}) = 0
mmap(NULL, 156648, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a712000
mmap(0x7f936a716000, 98304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f936a716000
mmap(0x7f936a72e000, 32768, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c000) = 0x7f936a72e000
mmap(0x7f936a736000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x23000) = 0x7f936a736000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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 0\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=292560, ...}) = 0
mmap(NULL, 294960, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a6c9000
mmap(0x7f936a6ec000, 40960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x23000) = 0x7f936a6ec000
mmap(0x7f936a6f6000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2d000) = 0x7f936a6f6000
mmap(0x7f936a6fa000, 98304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x30000) = 0x7f936a6fa000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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\360\201\0\0\0\0\0\0"..., 832) = 832
lseek(3, 824, SEEK_SET)                 = 824
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\213\4\321\202[c\331\246\0\343\325z\307\20X\223"..., 68) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=159824, ...}) = 0
lseek(3, 824, SEEK_SET)                 = 824
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\213\4\321\202[c\331\246\0\343\325z\307\20X\223"..., 68) = 68
mmap(NULL, 135592, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a6a7000
mmap(0x7f936a6ae000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f936a6ae000
mmap(0x7f936a6be000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f936a6be000
mmap(0x7f936a6c3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f936a6c3000
mmap(0x7f936a6c5000, 12712, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f936a6c5000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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`r\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\0003\321\363P\3617(e\35t\335*V\272\321\344"..., 68) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2149496, ...}) = 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\0003\321\363P\3617(e\35t\335*V\272\321\344"..., 68) = 68
mmap(NULL, 1860536, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a4e0000
mprotect(0x7f936a505000, 1671168, PROT_NONE) = 0
mmap(0x7f936a505000, 1363968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f936a505000
mmap(0x7f936a652000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x172000) = 0x7f936a652000
mmap(0x7f936a69d000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bc000) = 0x7f936a69d000
mmap(0x7f936a6a3000, 13240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f936a6a3000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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\0\20\22\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=14512, ...}) = 0
mmap(NULL, 16528, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a4db000
mmap(0x7f936a4dc000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f936a4dc000
mmap(0x7f936a4dd000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f936a4dd000
mmap(0x7f936a4de000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f936a4de000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/liblzma.so.5", 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 0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=157440, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f936a4d9000
mmap(NULL, 159760, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a4b1000
mprotect(0x7f936a4b4000, 143360, PROT_NONE) = 0
mmap(0x7f936a4b4000, 94208, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f936a4b4000
mmap(0x7f936a4cb000, 45056, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a000) = 0x7f936a4cb000
mmap(0x7f936a4d7000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f936a4d7000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libbz2.so.1.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  \0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=74440, ...}) = 0
mmap(NULL, 76840, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a49e000
mmap(0x7f936a4a0000, 53248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f936a4a0000
mmap(0x7f936a4ad000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f936a4ad000
mmap(0x7f936a4af000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7f936a4af000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/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 0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=100096, ...}) = 0
mmap(NULL, 102416, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f936a484000
mprotect(0x7f936a487000, 86016, PROT_NONE) = 0
mmap(0x7f936a487000, 57344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f936a487000
mmap(0x7f936a495000, 24576, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11000) = 0x7f936a495000
mmap(0x7f936a49c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f936a49c000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f936a482000
arch_prctl(ARCH_SET_FS, 0x7f936a482b80) = 0
mprotect(0x7f936a69d000, 12288, PROT_READ) = 0
mprotect(0x7f936a49c000, 4096, PROT_READ) = 0
mprotect(0x7f936a4af000, 4096, PROT_READ) = 0
mprotect(0x7f936a6c3000, 4096, PROT_READ) = 0
mprotect(0x7f936a4d7000, 4096, PROT_READ) = 0
mprotect(0x7f936a4de000, 4096, PROT_READ) = 0
mprotect(0x7f936a6fa000, 94208, PROT_READ) = 0
mprotect(0x7f936a736000, 8192, PROT_READ) = 0
mprotect(0x7f936a980000, 4096, PROT_READ) = 0
mprotect(0x55599ddfa000, 4096, PROT_READ) = 0
mprotect(0x7f936a9ae000, 4096, PROT_READ) = 0
munmap(0x7f936a739000, 275822)          = 0
set_tid_address(0x7f936a482e50)         = 73944
set_robust_list(0x7f936a482e60, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f936a6aec40, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f936a6bb930}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f936a6aece0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f936a6bb930}, 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
futex(0x7f936a4df048, FUTEX_WAKE_PRIVATE, 2147483647) = 0
brk(NULL)                               = 0x55599e5d2000
brk(0x55599e5f3000)                     = 0x55599e5f3000
openat(AT_FDCWD, "/etc/lsp.exclude", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=72, ...}) = 0
read(3, "# Exclude apps if they crash by "..., 4096) = 72
read(3, "", 4096)                       = 0
close(3)                                = 0
uname({sysname="Linux", nodename="lggram", ...}) = 0
shmget(0xa5723213, 16384, IPC_CREAT|IPC_EXCL|0666) = -1 EEXIST (File exists)
shmget(0xa5723213, 16384, 000)          = 0
shmat(0, NULL, SHM_RDONLY)              = 0x7f936a779000
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=6186256, ...}) = 0
mmap(NULL, 6186256, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9369e9b000
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, {len=52, filter=0x55599e5dcdc0}) = 0
stat("/root/.magic.mgc", 0x7fff392e2cf0) = -1 ENOENT (No such file or directory)
stat("/root/.magic", 0x7fff392e2cf0)    = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/file/misc/magic.mgc", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=5818072, ...}) = 0
mmap(NULL, 5818072, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7f936990e000
close(3)                                = 0
mprotect(0x7f936990e000, 5818072, PROT_READ) = 0
openat(AT_FDCWD, "/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=56352, ...}) = 0
read(3, "# GNU libc iconv configuration.\n"..., 4096) = 4096
read(3, "1002//\tJUS_I.B1.002//\nmodule\tJUS"..., 4096) = 4096
read(3, "ISO-IR-110//\t\tISO-8859-4//\nalias"..., 4096) = 4096
read(3, "\t\tISO-8859-14//\nalias\tISO_8859-1"..., 4096) = 4096
read(3, "IC-ES//\nalias\tEBCDICES//\t\tEBCDIC"..., 4096) = 4096
read(3, "DIC-CP-ES//\t\tIBM284//\nalias\tCSIB"..., 4096) = 4096
read(3, "\tIBM863//\nalias\tOSF1002035F//\t\tI"..., 4096) = 4096
read(3, "37//\t\tIBM937//\nmodule\tIBM937//\t\t"..., 4096) = 4096
read(3, "JIS//\t\t\tEUC-JP//\nmodule\tEUC-JP//"..., 4096) = 4096
read(3, "ias\tISO2022CN//\t\tISO-2022-CN//\nm"..., 4096) = 4096
read(3, "_5427-EXT//\nalias\tISO_5427EXT//\t"..., 4096) = 4096
read(3, "st\nmodule\tMAC-SAMI//\t\tINTERNAL\t\t"..., 4096) = 4096
brk(0x55599e614000)                     = 0x55599e614000
read(3, "12//\t\tINTERNAL\t\tIBM1112\t\t1\nmodul"..., 4096) = 4096
read(3, "\tCP9448//\t\tIBM9448//\nalias\tCSIBM"..., 4096) = 3104
read(3, "", 4096)                       = 0
close(3)                                = 0
futex(0x7f936a6a2494, FUTEX_WAKE_PRIVATE, 2147483647) = 0
fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(0x88, 0x1), ...}) = 0
mmap(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f936980d000
lstat("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
munmap(0x7f936980d000, 1052672)         = 0
write(1, "/: directory\n", 13/: directory
)          = 13
munmap(0x7f936990e000, 5818072)         = 0
shmdt(0x7f936a779000)                   = ?
+++ killed by SIGSYS +++
Bad system call (core dumped)

Last edited by zw963 (2020-01-25 11:16:37)

Offline

#14 2020-02-08 17:43:24

zw963
Member
Registered: 2018-06-18
Posts: 200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

BTW: after update (pacman -Syu) file from file-5.38-1 to file-5.38-3,  this issue still happen.

 ╰─ $ pacman -S file
warning: file-5.38-3 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) file-5.38-3

Total Installed Size:  5.75 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] ^C
Interrupt signal received

Offline

#15 2020-02-08 17:50:22

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,881
Website

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

Well sure, that's a pkgrel bump (not an upstream release), and the only changes on Arch's side were to fix https://bugs.archlinux.org/task/65256

https://git.archlinux.org/svntogit/pack … 5158d20e2a

There's no indication that the package maintainer is even aware of this bug, let alone considers it something worth cherrypicking the patch for. Have you opened a bug on the Arch bug tracker?

EDIT: It seems the fix for the TCGETS problem was added in -2, so the maintainer is aware of the bug and has applied the fix, but this still doesn't fix the problem for you?

Last edited by WorMzy (2020-02-08 17:55:23)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#16 2020-02-09 10:07:28

zw963
Member
Registered: 2018-06-18
Posts: 200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

It seems the fix for the TCGETS problem was added in -2, so the maintainer is aware of the bug and has applied the fix, but this still doesn't fix the problem for you?

Yes, i create a new user,  and logged in,  test it once again, still not working.

i upload a screenshot, please check.


http://zw963.github.io/images/31463392921959.png

Mod note: Replaced oversized image with URL. Please read the Code of Conduct and adhere to the image posting guidelines. -- WorMzy

Last edited by WorMzy (2020-02-09 19:06:59)

Offline

#17 2020-02-09 19:10:20

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,881
Website

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

What is the output of

pacman -Qkk bash

EDIT: and

ls -la /etc/skel

Last edited by WorMzy (2020-02-09 19:11:08)


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#18 2020-02-09 19:43:28

zw963
Member
Registered: 2018-06-18
Posts: 200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

I run above command on my own account, not new created account.

 ╰─ $ pacman -Qkk bash
bash: 241 total files, 0 altered files

 ╰─ $ ls -la /etc/skel
total 20
drwxr-xr-x  2 root root 4096 2019-11-30 11:09 ./
drwxr-xr-x 99 root root 4096 2020-02-10 03:36 ../
-rw-r--r--  1 root root   21 2019-11-14 01:31 .bash_logout
-rw-r--r--  1 root root   57 2019-11-14 01:31 .bash_profile
-rw-r--r--  1 root root  141 2019-11-14 01:31 .bashrc

thank you.

Offline

#19 2020-02-09 20:23:10

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

I still do not understand when and why someone would get both the identified output, *and* the "Bad system call" error.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#20 2020-02-09 20:31:37

progandy
Member
Registered: 2012-05-17
Posts: 5,200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

Does the error still occur if you use the "--no-sandbox" option for the file command?

Edit: The trace looks like it crashes on a shmdt syscall. Where does that come from? You seem to have a file called /etc/ld.so.preload, that may be preloading some library causing the problem.

Edit: The preloaded library seems to be liblsp.so. I don't know why you want that.

$ ldd /bin/file
...
/lib/$LIB/liblsp.so => /lib/lib/liblsp.so (0x00007f13d5882000)
# strace file /
...
access("/etc/ld.so.preload", R_OK)      = 0
openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
...
openat(AT_FDCWD, "/lib/lib/liblsp.so", O_RDONLY|O_CLOEXEC) = 3
...

Edit: Is that maybe from Astrill VPN? A search for "preload liblsp" shows topics like these:
https://bugs.launchpad.net/ubuntu/+bug/1173050

Last edited by progandy (2020-02-09 21:06:34)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#21 2020-02-11 18:20:31

zw963
Member
Registered: 2018-06-18
Posts: 200

Re: [Solved] /usr/bin/file issue which introduced by recent pacman -Syu

Does the error still occur if you use the "--no-sandbox" option for the file command?

Not.

Edit: The trace looks like it crashes on a shmdt syscall. Where does that come from? You seem to have a file called /etc/ld.so.preload, that may be preloading some library causing the problem.

Edit: Is that maybe from Astrill VPN? A search for "preload liblsp" shows topics like these:

Yes, i ever install a package, which called Astrill, though, because i never use it, so, i forget it.

╰─ $ \cat /etc/ld.so.preload
/lib/$LIB/liblsp.so

 ╰─ $ file --no-sandbox /lib/lib64/liblsp.so
/lib/lib64/liblsp.so: symbolic link to /lib/x86_64-linux-gnu/liblsp.so

 ╰─ $ file --no-sandbox /lib/x86_64-linux-gnu/liblsp.so
/lib/x86_64-linux-gnu/liblsp.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=363bda4374e44ca21dd1c2208e723a929ed0168a, stripped

-----------------------------

EDIT: After remove above file, reboot, file is working again!

Thank you for all kind help!

Last edited by zw963 (2020-02-11 18:24:01)

Offline

Board footer

Powered by FluxBB