Bug 41600 - pstree is killed by signal if stdout is redirected to a file
Summary: pstree is killed by signal if stdout is redirected to a file
Status: CLOSED DUPLICATE of bug 40857
Alias: None
Product: Sisyphus
Classification: Development
Component: psmisc (show other bugs)
Version: unstable
Hardware: aarch64 Linux
: P5 normal
Assignee: Vitaly Chikunov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-21 04:51 MSK by Vladimir D. Seleznev
Modified: 2021-12-21 04:59 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir D. Seleznev 2021-12-21 04:51:33 MSK
On aarch64:
$ uname -m
aarch64
$ pstree -p > pstree 
File size limit exceeded
$ du pstree
0       pstree
$ pstree -p |tee > pstree 
$ du pstree
16K     pstree

Lets trace it:
$ strace -o pstree.trace pstree -p > pstree
File size limit exceeded
$ tail pstree.trace 
newfstatat(AT_FDCWD, "/proc/4187067/ns/user", 0xffffc7ed6ab0, 0) = -1 EACCES (Permission denied)
newfstatat(AT_FDCWD, "/proc/4187067/ns/uts", 0xffffc7ed6ab0, 0) = -1 EACCES (Permission denied)
close(4)                                = 0
getdents64(3, 0xaaaabee05120 /* 0 entries */, 32768) = 0
close(3)                                = 0
prlimit64(0, RLIMIT_NOFILE, {rlim_cur=0, rlim_max=0}, NULL) = 0
fstat(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(1, "systemd(1)-+-agetty(4099)\n      "..., 4096) = -1 EFBIG (File too large)
--- SIGXFSZ {si_signo=SIGXFSZ, si_code=SI_USER, si_pid=648134, si_uid=1720} ---
+++ killed by SIGXFSZ +++
$

Killed by SIGXFSZ

On x86_64:
$ uname -m
x86_64
$ pstre
pstree      pstree.x11
$ pstree -p > pstree
$ du pstree 
104K    pstree
$ 

It works well.
Comment 1 Vitaly Chikunov 2021-12-21 04:54:54 MSK
Do you forgot to post pstree version on aarch64?
Comment 2 Vitaly Chikunov 2021-12-21 04:59:08 MSK
Already fixed in #40857.

*** This bug has been marked as a duplicate of bug 40857 ***