Public bug reported:

lxc 5.0.0 has a critical issue that 'lxc-attach' always returns 0
representing of success if a process running by 'lxc-attach' has been
terminated by all sort of signals. but we are expecting it is on
failure.

As the following logs, although it got SIGHUP, but lxc-attach returns 0.
---------------------------------------
[pid 161677] --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=0, si_uid=0} 
---
[pid 161675] <... epoll_wait resumed>[{events=EPOLLHUP, data={u32=537443984, 
u64=94773285797520}}], 10, -1) = 1
[pid 161675] read(6,  <unfinished ...>
[pid 161677] +++ killed by SIGHUP +++
<... read resumed>0x7ffe320eb4e0, 1024) = -1 EIO (Input/output error)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=161677, si_uid=0, 
si_status=SIGHUP, si_utime=0, si_stime=3} ---
close(3)                                = 0
ioctl(9, TCGETS, {B38400 opost -isig -icanon -echo ...}) = 0
ioctl(9, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = 0
ioctl(9, TCGETS, {B38400 opost isig icanon echo ...}) = 0
close(9)                                = 0
close(6)                                = 0
close(10)                               = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
wait4(161677, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGHUP}], 0, NULL) = 161677
exit_group(0)                           = ?
+++ exited with 0 +++
---------------------------------------

Approach
- update the package to lxc 5.0.2 which the bug has fixed[1] already.
- manually make a patch and apply it to the current package.

I recommend to update the package to lxc 5.0.2.

[1]:
https://github.com/lxc/lxc/commit/011faff362e0e7c1c86121937f284ac8c64aba9f

** Affects: lxc (Ubuntu)
     Importance: Undecided
         Status: New

** Summary changed:

- lxc 5.0.0 couldn't catch exitcode if terminated by signal for jammy
+ lxc-attach always returns 0 as success if child process has terminated by 
signal for jammy

** Description changed:

- lxc 5.0.0 has a critical issue that 'lxc-attach' always returns 0 as
- representing success if a process running by 'lxc-attach' has been
- terminated by all sort of signals, even though we are expecting it would
- be on failure.
+ lxc 5.0.0 has a critical issue that 'lxc-attach' always returns 0
+ representing of success if a process running by 'lxc-attach' has been
+ terminated by all sort of signals. but we are expecting it is on
+ failure.
  
  As the following logs, although it got SIGHUP, but lxc-attach returns 0.
  ---------------------------------------
  [pid 161677] --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=0, 
si_uid=0} ---
  [pid 161675] <... epoll_wait resumed>[{events=EPOLLHUP, data={u32=537443984, 
u64=94773285797520}}], 10, -1) = 1
  [pid 161675] read(6,  <unfinished ...>
  [pid 161677] +++ killed by SIGHUP +++
  <... read resumed>0x7ffe320eb4e0, 1024) = -1 EIO (Input/output error)
  --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=161677, si_uid=0, 
si_status=SIGHUP, si_utime=0, si_stime=3} ---
  close(3)                                = 0
  ioctl(9, TCGETS, {B38400 opost -isig -icanon -echo ...}) = 0
  ioctl(9, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) 
= 0
  ioctl(9, TCGETS, {B38400 opost isig icanon echo ...}) = 0
  close(9)                                = 0
  close(6)                                = 0
  close(10)                               = 0
  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
  wait4(161677, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGHUP}], 0, NULL) = 161677
  exit_group(0)                           = ?
  +++ exited with 0 +++
  ---------------------------------------
  
  Approach
  - update the package to lxc 5.0.2 which the bug has fixed[1] already.
  - manually make a patch and apply it to the current package.
  
  I recommend to update the package to lxc 5.0.2.
  
  [1]:
  https://github.com/lxc/lxc/commit/011faff362e0e7c1c86121937f284ac8c64aba9f

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2073080

Title:
  lxc-attach always returns 0 as success if child process has terminated
  by signal for jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/2073080/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to