Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: ioto...@packages.debian.org
Control: affects -1 + src:iotop-c

[ Reason ]
This update fixes 3 bugs in iotop-c:
- the program will busy loop after pressing ESC key, eating 100% on one core
- pseudo graphs in ASCII mode display incorrect/garbage values
- the logic behind showing only IO active processes incorrectly hides active 
ones

All the bugs were reported via IRC or via the upstream tracker and have no 
debian bug ids

[ Impact ]
Each of those 3 bugs severly affects user experience

[ Tests ]
Fixes were verified by manual testing and also confirmed as fixed by the 
reporters

[ Risks ]
Risks are very low - it is a leaf package, fixes are near trivial

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
All changes are cherry-picked upstream commits

[ Other info ]
N/A
diff -Nru iotop-c-1.23/debian/changelog iotop-c-1.23/debian/changelog
--- iotop-c-1.23/debian/changelog       2023-01-23 22:56:03.000000000 +0000
+++ iotop-c-1.23/debian/changelog       2023-10-17 01:06:47.000000000 +0000
@@ -1,3 +1,13 @@
+iotop-c (1.23-1+deb12u1) bookworm; urgency=medium
+
+  * Backport fixes from 1.25
+    - Fix ESC makes iotop busy loop
+    - Fix the logic in 'only' option
+  * Backport fixes from 1.24
+    - Fix ASCII graph problem in R, W & RW modes
+
+ -- Boian Bonev <bbo...@ipacct.com>  Tue, 17 Oct 2023 01:06:47 +0000
+
 iotop-c (1.23-1) unstable; urgency=medium
 
   [ Debian Janitor ]
diff -Nru iotop-c-1.23/debian/patches/fix-ascii-graph.patch 
iotop-c-1.23/debian/patches/fix-ascii-graph.patch
--- iotop-c-1.23/debian/patches/fix-ascii-graph.patch   1970-01-01 
00:00:00.000000000 +0000
+++ iotop-c-1.23/debian/patches/fix-ascii-graph.patch   2023-10-17 
01:06:47.000000000 +0000
@@ -0,0 +1,33 @@
+From: Boian Bonev <bbo...@ipacct.com>
+Date: Tue Oct 17 01:23:35 UTC 2023
+Forwarded: 629d80290c34b3a6a2e6f6400d8e277597547c93
+Subject: Fix ASCII graph problem in R, W & RW modes
+
+---
+--- a/src/view_curses.c
++++ b/src/view_curses.c
+@@ -969,21 +969,21 @@ static inline void view_curses(struct xx
+                                                               
v1=value2scale(s->readhist[j*2],maxvisible);
+                                                               
v2=value2scale(s->readhist[j*2+gi],maxvisible);
+                                                       } else
+-                                                              
v1=value2scale(s->readhist[j*2],maxvisible);
++                                                              
v1=value2scale(s->readhist[j],maxvisible);
+                                                       break;
+                                               case E_GR_W:
+                                                       if 
(has_unicode&&config.f.unicode) {
+                                                               
v1=value2scale(s->writehist[j*2],maxvisible);
+                                                               
v2=value2scale(s->writehist[j*2+gi],maxvisible);
+                                                       } else
+-                                                              
v1=value2scale(s->writehist[j*2],maxvisible);
++                                                              
v1=value2scale(s->writehist[j],maxvisible);
+                                                       break;
+                                               case E_GR_RW:
+                                                       if 
(has_unicode&&config.f.unicode) {
+                                                               
v1=value2scale(s->readhist[j*2]+s->writehist[j*2],maxvisible);
+                                                               
v2=value2scale(s->readhist[j*2+gi]+s->writehist[j*2+gi],maxvisible);
+                                                       } else
+-                                                              
v1=value2scale(s->readhist[j*2]+s->writehist[j*2],maxvisible);
++                                                              
v1=value2scale(s->readhist[j]+s->writehist[j],maxvisible);
+                                                       break;
+                                               case E_GR_SW:
+                                                       if 
(has_unicode&&config.f.unicode) {
diff -Nru iotop-c-1.23/debian/patches/fix-esc-busy-loop.patch 
iotop-c-1.23/debian/patches/fix-esc-busy-loop.patch
--- iotop-c-1.23/debian/patches/fix-esc-busy-loop.patch 1970-01-01 
00:00:00.000000000 +0000
+++ iotop-c-1.23/debian/patches/fix-esc-busy-loop.patch 2023-10-17 
01:06:47.000000000 +0000
@@ -0,0 +1,24 @@
+From: Boian Bonev <bbo...@ipacct.com>
+Date: Tue Oct 17 01:23:35 UTC 2023
+Forwarded: 4d0ccbbc62237b7b48764244461b5d47a1befb67
+Subject: Fix busy looping after ESC key
+
+---
+--- a/src/view_curses.c
++++ b/src/view_curses.c
+@@ -1562,6 +1562,7 @@ static inline int curses_key_search(int
+                       nocbreak();
+                       k2=getch();
+                       cbreak();
++                      halfdelay(2);
+                       key_log(k2,1);
+                       if (k2!=ERR) {
+                               switch (k2) {
+@@ -1995,6 +1996,7 @@ static inline int curses_key(int ch) {
+                       nocbreak();
+                       k2=getch();
+                       cbreak();
++                      halfdelay(2);
+                       key_log(k2,1);
+                       if (k2!=ERR) {
+                               switch (k2) {
diff -Nru iotop-c-1.23/debian/patches/fix-only-option.patch 
iotop-c-1.23/debian/patches/fix-only-option.patch
--- iotop-c-1.23/debian/patches/fix-only-option.patch   1970-01-01 
00:00:00.000000000 +0000
+++ iotop-c-1.23/debian/patches/fix-only-option.patch   2023-10-17 
01:06:47.000000000 +0000
@@ -0,0 +1,64 @@
+From: Boian Bonev <bbo...@ipacct.com>
+Date: Tue Oct 17 01:23:35 UTC 2023
+Forwarded: b787f78c578563f3c2ca158e02619695167f2b03
+Subject: Let option only never hide processes with current IO
+
+---
+--- a/src/view_curses.c
++++ b/src/view_curses.c
+@@ -289,10 +289,10 @@ static inline int filter_view(struct xxx
+               if (config.f.hidegraph) {
+                       if (has_tda) {
+                               if (s->blkio_val<=0)
+-                                      return 1;
++                                      goto dohide;
+                       } else {
+                               if (s->read_val+s->write_val<=0)
+-                                      return 1;
++                                      goto dohide;
+                       }
+               } else {
+                       double su=0;
+@@ -301,32 +301,37 @@ static inline int filter_view(struct xxx
+                       switch (masked_grtype(0)) {
+                               case E_GR_IO:
+                                       if 
(!memcmp(s->iohist,iohist_z,gr_width))
+-                                              return 1;
++                                              goto dohide;
+                                       break;
+                               case E_GR_R:
+                                       for (i=0;i<gr_width;i++)
+                                               su+=s->readhist[i];
+                                       if (su<=0)
+-                                              return 1;
++                                              goto dohide;
+                                       break;
+                               case E_GR_W:
+                                       for (i=0;i<gr_width;i++)
+                                               su+=s->writehist[i];
+                                       if (su<=0)
+-                                              return 1;
++                                              goto dohide;
+                                       break;
+                               case E_GR_RW:
+                                       for (i=0;i<gr_width;i++)
+                                               
su+=s->readhist[i]+s->writehist[i];
+                                       if (su<=0)
+-                                              return 1;
++                                              goto dohide;
+                                       break;
+                               case E_GR_SW:
+                                       if 
(!memcmp(s->sihist,iohist_z,gr_width))
+-                                              return 1;
++                                              goto dohide;
+                                       break;
+                       }
+               }
++              if (0) {
++              dohide:
++                      if (s->blkio_val<=0&&s->read_val+s->write_val<=0)
++                              return 1;
++              }
+       }
+       if (config.f.hideexited&&s->exited)
+               return 1;
diff -Nru iotop-c-1.23/debian/patches/series iotop-c-1.23/debian/patches/series
--- iotop-c-1.23/debian/patches/series  1970-01-01 00:00:00.000000000 +0000
+++ iotop-c-1.23/debian/patches/series  2023-10-17 01:06:47.000000000 +0000
@@ -0,0 +1,3 @@
+fix-only-option.patch
+fix-ascii-graph.patch
+fix-esc-busy-loop.patch

Reply via email to