Bug 1640913

Summary: dstat replacement does not do newlines correctly
Product: [Fedora] Fedora Reporter: Zbigniew Jędrzejewski-Szmek <zbyszek>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: dgunchev, fche, lberk, mgoodwin, nathans, scox
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcp-4.2.0-1.fc27 pcp-4.2.0-1.fc29 pcp-4.2.0-1.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-28 02:21:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
gnome-terminal window with dstat running
none
xterm window running dstat with corrupted output none

Description Zbigniew Jędrzejewski-Szmek 2018-10-19 07:22:33 UTC
Created attachment 1495550 [details]
gnome-terminal window with dstat running

Description of problem:
$ dstat 20
You did not select any stats, using -cdngy by default.
----total-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai stl| read  writ| recv  send|  in   out | int   csw 
  5   1  93   0   0|   0    40k|   0     0 |   0     0 |4417  2508  12   3  85   1   0|  96k  520k|   0   219 |24.0     0 |5934  4176  13   4  83   1   0|  44k    0 | 229   465 |11.0     0 |5607  4183  26   6  67   1   0| 144k    0 | 407   390 |36.0     0 |7377  6974  10   2  87   0   0|  16k    0 |   0     0 |4.00     0 |4413  3125  12   4  82   0   0|4092B    0 |   0     0 |1.00     0 |5717  5463  16   4  79   0   0|  20k   12k|   0     0 |5.00     0 |5843  4877   9   2  88   0   0|   0   112k|   0     0 |   0     0 |4681  3041   9   4  86   0   0|8182B    0 | 408   959 |2.00     0 |5051  3826   9   3  88   0   0|   0     0 | 873  2283 |   0     0 |4446  2823   9   3  88   0   0|   0     0 |1532  1115 |   0     0 |4737  2902   7   2  90   0   0|   0    68k| 146   114 |   0     0 |4468  2707   8   2  89   0   0|   0     0 |   0     0 |   0     0 |4387  2636   6   2  92   0   0|   0     0 |   0     0 |   0     0 |3951  2143   8   2  88   0   0|   0     0 | 122   296 |   0     0 |4195  2682   8   2  89   0   0|   0    16k| 224   144 |   0     0 |4388  2704   8   3  89   0   0|   0    48k|   0     0 |   0     0 |4185  2495  11   4  84   0   0|   0   685k|   0     0 |   0     0 |4905  3719   9   3  87   0   0|   0     0 |   0 

When dstat writes the first line, it looks OK. It then writes the replacement line, and then it still looks OK. But when 20 s pass and it is supposed to go to the next line, it instead concatenates at the end of the first line.

Version-Release number of selected component (if applicable):
$  rpm -qf /usr/bin/dstat
pcp-system-tools-4.1.3-1.fc29.x86_64

How reproducible:
Dunno, reproducible in this terminal certainly.

Additional info:
I'm using gnome-terminal-3.30.1-1.fc29.x86_64.
Happens under zsh and bash. 'reset' does not help.

Under xterm the corruption is different, see second attached screenshot.

Comment 1 Zbigniew Jędrzejewski-Szmek 2018-10-19 07:23:26 UTC
Created attachment 1495551 [details]
xterm window running dstat with corrupted output

Comment 2 Nathan Scott 2018-10-26 06:56:44 UTC
Thanks - have reproduced the issue and will have a fix for pcp-4.2.0

Comment 3 Doncho Gunchev 2018-11-02 17:31:32 UTC
In konsole after printing the header line the cursor moves several lines up and the output is garbled.
The command line parameters handling does not work (ex: dstat -df does not show all disks as it used to). I tried several other options and none worked (-D sda,sdb...).

Comment 4 Nathan Scott 2018-11-06 20:53:56 UTC
(In reply to Doncho N. Gunchev from comment #3)
> In konsole after printing the header line the cursor moves several lines up
> and the output is garbled.

This has been resolved now (see comment #2).

> The command line parameters handling does not work (ex: dstat -df does not
> show all disks as it used to). I tried several other options and none worked
> (-D sda,sdb...).

This sounds like an unrelated issue - could you open a new BZ for that please?
It will help with diagnosis if you could also include the output from these commands there:

$ pcp dstat -V
$ pminfo -f disk.dev.read_bytes
$ cat /proc/diskstats

Thanks!

Comment 5 Fedora Update System 2018-11-16 10:24:37 UTC
pcp-4.2.0-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-3b0d7f7858

Comment 6 Fedora Update System 2018-11-16 10:25:43 UTC
pcp-4.2.0-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-ae612244a9

Comment 7 Fedora Update System 2018-11-16 10:26:36 UTC
pcp-4.2.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-8da69c3c21

Comment 8 Fedora Update System 2018-11-17 04:44:01 UTC
pcp-4.2.0-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-3b0d7f7858

Comment 9 Fedora Update System 2018-11-17 05:58:17 UTC
pcp-4.2.0-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-8da69c3c21

Comment 10 Fedora Update System 2018-11-17 06:39:18 UTC
pcp-4.2.0-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-ae612244a9

Comment 11 Doncho Gunchev 2018-11-20 09:56:58 UTC
(In reply to Nathan Scott from comment #4)
> (In reply to Doncho N. Gunchev from comment #3)
> > In konsole after printing the header line the cursor moves several lines up
> > and the output is garbled.
> 
> This has been resolved now (see comment #2).

I concur, it works now (konsole, xterm, terminator, ssh...). Thanks.

> 
> > The command line parameters handling does not work (ex: dstat -df does not
> > show all disks as it used to). I tried several other options and none worked
> > (-D sda,sdb...).
> 
> This sounds like an unrelated issue - could you open a new BZ for that
> please?
> It will help with diagnosis if you could also include the output from these
> commands there:
> 
> $ pcp dstat -V
> $ pminfo -f disk.dev.read_bytes
> $ cat /proc/diskstats
> 
> Thanks!

Reported https://bugzilla.redhat.com/show_bug.cgi?id=1651536 , thank you!

Comment 12 Fedora Update System 2018-11-28 02:21:38 UTC
pcp-4.2.0-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2018-11-28 02:41:45 UTC
pcp-4.2.0-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2018-11-28 02:45:24 UTC
pcp-4.2.0-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.