Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 234438 - net-analyzer/iptraf does not update its window during resize
Summary: net-analyzer/iptraf does not update its window during resize
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks: 305781
  Show dependency tree
 
Reported: 2008-08-11 03:14 UTC by Roger
Modified: 2010-04-26 05:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
GNU Screen with Urxvt & IPTraf using unicode (Screenshot.png,70.98 KB, image/png)
2008-09-16 23:13 UTC, Roger
Details
Screen started in tty (Screenshot-tty.png,97.92 KB, image/png)
2008-09-18 20:21 UTC, Roger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roger 2008-08-11 03:14:45 UTC
IPTraf does not display unicode terminal graphics properly.

(It's very possible iftop has a similar problem but I don't know if the fix is the same.  If iftop is started in a unicode terminal/gnu screen session, iftop displays the same terminal graphics abnormality.  Disabiling the unicode feature for the terminal resolves the problem.)

Reproducible: Always




For fixing, information can be found here:
http://bugs.centos.org/view.php?id=2676
http://bugs.centos.org/print_bug_page.php?bug_id=2676

According to the above posts, the solution is to set locale within iptraf with:

#include <locale.h>
[...]
setlocale(LC_ALL, "");

Pretty simple patch if anybody else has time to create the patch/diff!
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2008-09-15 19:09:11 UTC
roger, please, describe what problem do you experience. Also what iptraf version are you talking about. We already have this patch for very long time:

http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/iptraf/files/iptraf-3.0.0-setlocale.patch?rev=1.1&view=markup

... or what's wrong with this patch?
Comment 2 Roger 2008-09-16 07:03:48 UTC
I just know, iptraf, as well as iftop, distributes problems displaying (ncurses) graphics when GNU screen is started using the unicode flag.

ie. 

$ screen -DR -U

vs.

$ screen -DR


(Took me awhile to find this problem with the GNU Screen -U flag)
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2008-09-16 07:19:23 UTC
Please attach screen shot. Also give me step by step instructions how to reproduce this problem, because I've tried iptraf inside screen many times but failed to see any problem.
Comment 4 Roger 2008-09-16 23:10:31 UTC
Seen the problem on 2 or 3 diff boxes here.  It's how I found the problem.

... attaching screenshot now.
Comment 5 Roger 2008-09-16 23:13:31 UTC
Created attachment 165604 [details]
GNU Screen with Urxvt & IPTraf using unicode

GNU Screen with Urxvt & IPTraf using unicode

What's causing this graphic/ncurses anomaly is "screen -U" switch.


urxvt -g 125x61+200+0 -rv -sbt 15 -si -sk -sr \
  -fn '-adobe-courier-medium-r-normal--17-120-100-100-m-100-iso10646-1' \
  -n "GNU Screen: Localhost2" -title "GNU Screen: Localhost2" \
  -e sh -c "screen -URD -S roger ; sleep 2s &"
Comment 6 Peter Volkov (RETIRED) gentoo-dev 2008-09-17 03:25:13 UTC
This looks like font problem. Please, set your console to use e.g. terminus fonts. "emerge -va media-fonts/terminus-font" and then configure your terminal to use that. Does this fixes problem for you? 
Comment 7 Roger 2008-09-18 20:19:53 UTC
Already have terminus fonts installed... used:

$ screen -URD -S roger

... and it looks even cr*ppier.  Wanna screenshot? ;-)

(If you must, I also tried w/o using "-S". ... I'm sure this is an issue directly related with the "screen -U" switch.  I have several diff boxes here and use multiple types of terminals, all display similar stuff with the "-U" arg.)

But when "screen -URD" is started via tty, it display ncurses IPTraf graphics just fine.  Then I switch back to X, and the terminal is stuck at the small size, but does display ncurses graphics fine.  (Attaching screenshot.)
Comment 8 Roger 2008-09-18 20:21:45 UTC
Created attachment 165750 [details]
Screen started in tty

Started GNU Screen in tty using "screen -URD" and then went to X and got this.  Displays graphics fine here... whether or not starting "screen -URD" actually uses the "-U" switch while in tty is questionable?
Comment 9 Roger 2008-09-18 20:26:02 UTC
Verified tty drops the "-U"

$ ps -ax |grep screen

 1240 pts/0    S+     0:00 screen -RD

And starting with "-URD" in X

$ ps -ax |grep screen

 1447 pts/0    S+     0:00 screen -URD

(... some interesting stuff to note.)
Comment 10 Peter Volkov (RETIRED) gentoo-dev 2008-10-24 15:46:45 UTC
Ah, now I got, what your are talking about. So if you start screen in console and then start iptraf inside screen, then detach screen session and attach it in X-terminal - iptraf window will be corrupted.

But the same problem occurs if you start iptraf in X-terminal of one size e.g. in konsole with 80x24 size and then change size e.g. to 119x46: at this point iptraf still thinks that window still have same 80x24 size. This problem has nothing to do with screen and utf8.

At this point somebody should sit and write patch for iptraf :)
Comment 11 Roger 2008-10-24 20:16:25 UTC
Sorry.  Forgot to delete "Screen started in tty" ... as that too was being run w/o the "-U" (unicode) flag for screen.  (Slight anomaly & oversight on my part.)


Simply put, running screen -RDU gives me the stated attached screenshot.
Comment 12 Peter Volkov (RETIRED) gentoo-dev 2008-10-25 11:31:18 UTC
roger have you read what I wrote? This issue has nothing to do with screen.
Comment 13 Roger 2008-10-25 18:38:59 UTC
No where did I state the problem was explicitly with screen.

All I said was "screen -DRU" produces this problem on this box, as well as others here on my pentium3 network.

Now if you're saying I'm getting handy with The Gimp at creating the attached Screenshot.png, all I can say is, thanks for the compliment.
Comment 14 Roger 2008-10-25 18:54:31 UTC
I also said "delete" what I said about resizing or running screen -U within terminal & then resizing.

I just did some more debugging.

I finally was able to get "screen -URD" & iptraf running w/i the tty (console) without a corrupted display.

I then switched to Xorg and ran "screen -URD" within XFCE terminal.  I could have sworn iptraf display fine at this point.  I ps -ax before and after to verfiy "screen -URD" was present (and not "screen -RD"), and it was "screen -URD".

I then, again, detached went back to tty/console and ran screen -URD (reattaching) and iptraf was just fine and then detached.  Switched back to Xorg and  reattached using "screen -URD" within XFCE terminal and then this display bug with iptraf was present, including the screen of iptraf being resized to the size of tty/console, similar to the attached obsolete Screenshot-tty.png, but with a corrupted screen.


(Golly.  After all this typing, could have probably tried applying one of 'dem old patches & recompiled to see if it works.)

Comment 15 Peter Volkov (RETIRED) gentoo-dev 2008-10-25 19:33:27 UTC
(In reply to comment #14)
> (Golly.  After all this typing, could have probably tried applying one of 'dem
> old patches & recompiled to see if it works.)

And again, may be I don't understand what you wrote here (English is not my native language after all) but I already stated (see comment 1), that the patches you told us about in comment 0 *are already applied* in iptraf. Or are you talking about some different patches? If so, then please attach them to this bug and I'll be happy to review them.
Comment 16 Roger 2008-10-26 07:11:37 UTC
I understand.

Well, I'm going to try to see if I can't further find the cause of this.  In the process of setting up a Gentoo beta test box to build gcc-4.3, etc.


If anybody has any other ideas, post them here.
Comment 17 Jeroen Roovers (RETIRED) gentoo-dev 2010-04-25 23:55:04 UTC
Roger, could you check whether iptraf-ng (bug #305781) fixes this problem?
Comment 18 Roger 2010-04-26 05:15:38 UTC
Ok.  I checked by unmasking iptraf-ng and running it within a "screen -URD" session and then connecting to it from my other boxes.

I'm not sure if I followed the testing scenario I described previously step-by-step, but to me this bug looks fixed now.

No real corruption of screen graphics except for a few character spacing & color issues when moving/connection from other sized terminals.

Marking as fixed?