FS#65245 - [file] Crashes with SIGSYS when in kernel VT

Attached to Project: Arch Linux
Opened by [] (genkisky) - Thursday, 23 January 2020, 09:29 GMT
Last edited by Levente Polyak (anthraxx) - Thursday, 23 January 2020, 19:19 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: Running file(1) on any file when in the kernel VT crashes with SIGSYS.

It works fine if you pipe the output to something (a file, or another program). It also works fine when in a xorg terminal. But it crashes if you run it directly to stdout in the kernel VT.

I know the file PKGBUILD recently re-enabled compiling-with-libseccomp...

Looks like there've been other problems file(1) has had with libseccomp, but they've already been worked around. I guess this is just one last issue. I don't know if the real problem is code in libseccomp or file itself.

I know using the kernel VT is niche, and this issue is easily worked around (eg, pipe to cat as noted by Cork on #archlinux). But we agreed it was worth filing a bug.

Additional info:
* package version(s): file 5.38-1

Steps to reproduce:
(1) Open up a kernel VT
(2) Run file(1) on any file
This task depends upon

Closed by  Levente Polyak (anthraxx)
Thursday, 23 January 2020, 19:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  5.38-2
Comment by [] (genkisky) - Thursday, 23 January 2020, 09:35 GMT
The "other problems file has had with libseccomp" I was referring to are  FS#65100  and  FS#58626 
Comment by Levente Polyak (anthraxx) - Thursday, 23 January 2020, 11:26 GMT
please attach an strace
Comment by Eli Schwartz (eschwartz) - Thursday, 23 January 2020, 13:02 GMT
Levente, this is the same issue I mentioned on irc from https://bbs.archlinux.org/viewtopic.php?id=252257
Comment by [] (genkisky) - Thursday, 23 January 2020, 13:13 GMT
Thanks for the reply. The problem is that as I said, if I pipe the output to something, it doesn't crash. So I can't really direct an strace to a file. I also can't copy/paste the output because it works fine in xorg terminals, and it works fine in tmux/screen even under the kernel VT.

Here are the last few lines of an strace that I've manually copied (which I guess I should've done in the OP):

read(3, 0x..., 4096) = 3104
read(3, "", 4096) = 0
close(3) = 0
futex(0x..., FUTEX_WAIT_PRIVATE, 2^31 - 1) = 0
fstat(1, 0x...) = 0
ioctl(1, TCGETS <unfinished ...>) = ?
+++ killed by SIGSYS +++
Bad system call (core dumped)

So, if I'm reading it right, it sees stdout is a tty and decides to do an ioctl for some reason, then libseccomp doesn't like the TCGETS ioctl?
Comment by [] (genkisky) - Thursday, 23 January 2020, 13:17 GMT
Thanks Eli, agreed, that seems to be the exact same issue. And so I'm sure https://bugs.astron.com/view.php?id=130 would fix my issue too.
Comment by Levente Polyak (anthraxx) - Thursday, 23 January 2020, 13:36 GMT
I see, thanks to all of you. It will be fixed today in the evening :)

Loading...