Bug 703549

Summary: wide report option on mtr tool does not output properly (or may just be outright broken)
Product: [Fedora] Fedora Reporter: Chris Marcantonio <cmarcant>
Component: mtrAssignee: Adam Tkac <atkac>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: atkac, jgorig, ovasik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mtr-0.81-1.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-11 01:25:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
patch to correct the issue none

Description Chris Marcantonio 2011-05-10 16:31:34 UTC
Description of problem:
The mtr tool has multiple output options available.  Aside from the normal "interactive" mode, there is also a report mode available that will run for a certain number of cycles and then quit and output the results to the screen.

There is also an option for wide report mode (in both the man page and --help output), but this seems to be ignored and runs the same as interactive mode, updating the screen after each cycle.  At the end of the output, the screen is cleared and output is unavailable to review.


Version-Release number of selected component (if applicable):
sh-4.2$ rpm -q mtr
mtr-0.80-3.fc15.i686
sh-4.2$ mtr --version
mtr 0.80
sh-4.2$


How reproducible:
Every time.


Steps to Reproduce:
1. run mtr with -w (or --report-wide) to not truncate hostnames and -c to specify a number of cycles
2. look at output on screen during and after run completes

  
Actual results:
The output from mtr displays incrementally for each cycle and is cleared off the screen and unavailable when you are returned to a prompt.


Expected results:
The output from the run should be visible on the screen (for parsing, cutting and pasting, etc) when you are returned to a prompt and the screen should not display results (and re-draw results) after each cycle.


Additional info:
When run in report mode normally, there is no output displayed on the screen until the run finishes and the summary prints.  It seems that wide mode should behave almost identically and just have a wider field for hostname.  As it currently stands, the switch appears to be ignored and the mtr runs the same as when the switch isn't supplied...this makes redirecting to a file to capture output kind of worthless (because of all the control characters), not to mention the output doesn't remain on the screen afterwards to parse.

Comment 1 Chris Marcantonio 2011-05-10 16:34:38 UTC
Looking into this a bit more, I think the problem is that the DisplayMode isn't set properly when the wide report mode switch is passed.  I tested the following patch out:

sh-4.2$ cat test.patch 
diff -up ./mtr-0.80/mtr.c.ORIG ./mtr-0.80/mtr.c
--- a/mtr.c             2011-05-10 12:20:51.014296029 -0400
+++ b/mtr.c             2011-05-10 12:21:16.826438824 -0400
@@ -172,6 +172,7 @@ void parse_arg (int argc, char **argv) 
       break;
     case 'w':
       reportwide = 1;
+      DisplayMode = DisplayReport;
       break;
     case 't':
       DisplayMode = DisplayCurses;
sh-4.2$

in order to set DisplayMode properly when wide report mode is triggered as well.  This appears to make things behave much more sanely.

The package builds properly, and the output looks the way I expect it should.  Any chance we can get this included/passed upstream, or do I need to file this upstream myself?

Comment 2 Chris Marcantonio 2011-05-10 16:35:29 UTC
Created attachment 498098 [details]
patch to correct the issue

Comment 3 Chris Marcantonio 2011-05-10 17:10:15 UTC
Meh, screw it.  I finally bit the bullet and created a Launchpad account, so I filed this upstream as well.

https://bugs.launchpad.net/mtr/+bug/780647

Comment 4 Fedora Update System 2011-11-01 11:32:50 UTC
mtr-0.81-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mtr-0.81-1.fc16

Comment 5 Fedora Update System 2011-11-01 11:32:58 UTC
mtr-0.81-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mtr-0.81-1.fc15

Comment 6 Fedora Update System 2011-11-02 06:56:29 UTC
Package mtr-0.81-1.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mtr-0.81-1.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-15240
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-11-11 01:25:26 UTC
mtr-0.81-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2011-11-11 01:25:55 UTC
mtr-0.81-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.