https://bugs.kde.org/show_bug.cgi?id=427433

--- Comment #2 from Thiago Macieira <thi...@kde.org> ---
Relevant section of strace of attachment 132222 (parent process):
eventfd2(0, 0)                          = 3
waitid(P_PIDFD, 2147483647, NULL, WNOHANG|WEXITED, NULL) = -1 EBADF (Bad file
descriptor)
pipe([4, 5])                            = 0
clone(child_stack=NULL, flags=CLONE_PIDFD|SIGCHLD, parent_tid=[6]) = 601608
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
close(5)                                = 0
waitid(P_PIDFD, 6, {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=601608,
si_uid=1000, si_status=0, si_utime=0, si_stime=0}, WEXITED|__WALL, NULL) = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=601608, si_uid=1000,
si_status=0, si_utime=0, si_stime=0} ---

Child process:
read(3, "\1\0\0\0\0\0\0\0", 8)          = 8
close(3)                                = 0
close(4)                                = 0
dup2(5, 1)                              = 1
execve("/bin/true", ["/bin/true"], 0x7ffc69cbd8d8 /* 109 vars */) = 0


Relevant sections of strace of attachment 132203 (parent):
pipe2([3, 4], O_CLOEXEC)                = 0
pipe2([5, 6], O_CLOEXEC)                = 0
pipe2([7, 8], O_CLOEXEC)                = 0
pipe2([9, 11], O_CLOEXEC)               = 0
getcwd("/tmp/qtbug-87230", 4096)        = 17
statx(AT_FDCWD, "/usr/bin/uname", AT_STATX_SYNC_AS_STAT, STATX_ALL,
{stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0755,
stx_size=31464, ...}) = 0
access("/usr/bin/uname", X_OK)          = 0
waitid(P_PIDFD, 2147483647, NULL, WNOHANG|WEXITED, NULL) = -1 EBADF (Bad file
descriptor)
clone(child_stack=NULL, flags=CLONE_PIDFD|SIGCHLD, parent_tid=[12]) = 601703
close(11)                               = 0
close(3)                                = 0
fcntl(4, F_GETFL)                       = 0x1 (flags O_WRONLY)
fcntl(4, F_SETFL, O_WRONLY|O_NONBLOCK)  = 0
close(6)                                = 0
fcntl(5, F_GETFL)                       = 0 (flags O_RDONLY)
fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
close(8)                                = 0
fcntl(7, F_GETFL)                       = 0 (flags O_RDONLY)
fcntl(7, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
ppoll([{fd=9, events=POLLIN}], 1, {tv_sec=10, tv_nsec=0}, NULL, 8) = 1 ([{fd=9,
revents=POLLHUP}], left {tv_sec=9, tv_nsec=999333222})
read(9, "", 12)                         = 0
close(9)                                = 0
ppoll([{fd=-1}, {fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=12,
events=POLLIN}], 4, {tv_sec=10, tv_nsec=0}, NULL, 8) = 1 ([{fd=5,
revents=POLLIN}], left {tv_sec=9, tv_nsec=999564841})
ioctl(5, FIONREAD, [115])               = 0
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=601703, si_uid=1000,
si_status=0, si_utime=0, si_stime=0} ---

Child process:
rt_sigaction(SIGPIPE, {sa_handler=SIG_DFL, sa_mask=[PIPE],
sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f8434879530},
{sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
dup3(3, 0, 0)                           = 0
dup3(6, 1, 0)                           = 1
dup3(8, 2, 0)                           = 2
close(9)                                = 0
execve("/usr/bin/uname", ["/usr/bin/uname", "-a"], 0x7ffceab80858 /* 109 vars
*/) = 0


The QProcess example has 4 pipes instead of 1 and it stops on poll() instead of
waitid(). Otherwise, the code is supposed to be the same.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to