Bug 654343 - iftop segfaults when providing multiple -i
Summary: iftop segfaults when providing multiple -i
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: iftop
Version: 14
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-17 16:16 UTC by Thierry Vignaud
Modified: 2010-12-05 00:35 UTC (History)
2 users (show)

Fixed In Version: iftop-0.17-12.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-19 00:02:56 UTC


Attachments (Terms of Use)
GDB trace of "iftop -i eth0 -i eth1" (1.28 KB, text/plain)
2010-11-17 16:16 UTC, Thierry Vignaud
no flags Details
GDB trace of "iftop -i eth0 -i eth1 -i eth2" (2.39 KB, text/plain)
2010-11-17 16:16 UTC, Thierry Vignaud
no flags Details
Proposed patch as lifted from debian (766 bytes, patch)
2010-11-18 21:22 UTC, Brendan Jones
no flags Details | Diff

Description Thierry Vignaud 2010-11-17 16:16:09 UTC
Created attachment 461099 [details]
GDB trace of "iftop -i eth0  -i eth1"

Description of problem:
iftop segfaults when providing multiple -i

Version-Release number of selected component (if applicable):
iftop-0.17-11.fc14.x86_64
glibc-2.12.90-19.x86_64
glibc-debuginfo-2.12.90-19.x86_64

How reproducible:
Everytime

Steps to Reproduce:
1. run "iftop -i eth0 -i eth1"
2.
3.
  
Actual results:
iftop segfaults

Expected results:
It should run and listen only to the latest provided interface (eth1)

Additional info:
"iftop -i eth0 -i eth1 -i eth2" additionally print
*** glibc detected *** /usr/sbin/iftop: double free or corruption (fasttop): 0x000000000060dfe0 ***

The same rebuild package fails the same way on RHEL5.5.

Comment 1 Thierry Vignaud 2010-11-17 16:16:42 UTC
Created attachment 461100 [details]
GDB trace of "iftop -i eth0 -i eth1 -i eth2"

Comment 2 Brendan Jones 2010-11-17 22:03:38 UTC
Reproducible here: full backtrace

Thread 1 (Thread 0x7ffff7fd3720 (LWP 3952)):
#0  0x0000003adcc77e15 in malloc_consolidate (av=0x3adcf9f180) at malloc.c:5169
        fb = <value optimized out>
        maxfb = <value optimized out>
        p = 0x60d9b0
        nextp = 0x0
        unsorted_bin = 0x3adcf9f1d8
        first_unsorted = <value optimized out>
        nextchunk = 0x60da10
        size = 96
        nextsize = <value optimized out>
        prevsize = <value optimized out>
        nextinuse = <value optimized out>
        bck = 0x0
        fwd = 0x0
        __func__ = "malloc_consolidate"
#1  0x0000003adcc798e8 in _int_malloc (av=0x3adcf9f180, bytes=2048) at malloc.c:4373
        nb = 2064
        idx = 80
        bin = <value optimized out>
        victim = <value optimized out>
        size = <value optimized out>
        victim_index = <value optimized out>
        remainder = <value optimized out>
        remainder_size = <value optimized out>
        block = <value optimized out>
        bit = <value optimized out>
        map = <value optimized out>
        fwd = <value optimized out>
        bck = <value optimized out>
        errstr = 0x0
        __func__ = "_int_malloc"
#2  0x0000003adcc7c932 in __libc_malloc (bytes=2048) at malloc.c:3660
        ar_ptr = <value optimized out>
        victim = <value optimized out>
        hook = <value optimized out>
        __func__ = "__libc_malloc"
#3  0x00000000004074b9 in xmalloc (n=<value optimized out>) at util.c:26
        v = 0x0
#4  0x0000000000407a0e in read_config_file (f=0x60d9f0 "/home/fedora/.iftoprc", whinge=0) at cfgfile.c:70
        ret = 0
        fp = <value optimized out>
        line = <value optimized out>
        i = 1
#5  0x0000000000403828 in main (argc=5, argv=0x7fffffffe128) at iftop.c:575
        thread = 4203328
---Type <return> to continue, or q <return> to quit---
        sa = {__sigaction_handler = {sa_handler = 0, sa_sigaction = 0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, 
          sa_restorer = 0}




-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 3 Robert Scheck 2010-11-17 22:08:52 UTC
Does one of you already have a patch for this?

Comment 4 Brendan Jones 2010-11-17 22:38:29 UTC
I believe this has been patched in Debian. I will try and dig it up and post here.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 5 Robert Scheck 2010-11-18 08:13:48 UTC
Yes, looks like Debian addressed this issue in October 2010 ("Fix segfault when 
using the same command line argument multiple time"). I'll have a look to it and
synchronize patches as needed.

Comment 6 Brendan Jones 2010-11-18 21:22:08 UTC
Created attachment 461397 [details]
Proposed patch as lifted from debian

Comment 7 Brendan Jones 2010-11-18 21:23:41 UTC
The patch does not allow you to monitor more than one interface - it simply overwrites any previously read parameters which is in line with the man page.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 8 Robert Scheck 2010-11-18 22:28:15 UTC
Thanks for your patch, unfortunately there's a piece in stringmap.c missing.
I'll add the complete fix to iftop package soon.

Comment 9 Fedora Update System 2010-11-19 00:01:45 UTC
iftop-0.17-12.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/iftop-0.17-12.fc14

Comment 10 Fedora Update System 2010-11-19 00:02:30 UTC
iftop-0.17-12.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/iftop-0.17-12.fc13

Comment 11 Fedora Update System 2010-11-19 00:02:39 UTC
iftop-0.17-12.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/iftop-0.17-12.fc12

Comment 12 Fedora Update System 2010-11-19 00:02:42 UTC
iftop-0.17-12.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/iftop-0.17-12.el5

Comment 13 Fedora Update System 2010-11-19 00:03:43 UTC
iftop-0.17-12.el4 has been submitted as an update for Fedora EPEL 4.
https://admin.fedoraproject.org/updates/iftop-0.17-12.el4

Comment 14 Fedora Update System 2010-12-04 21:28:35 UTC
iftop-0.17-12.el4 has been pushed to the Fedora EPEL 4 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2010-12-04 21:28:48 UTC
iftop-0.17-12.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2010-12-05 00:34:49 UTC
iftop-0.17-12.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2010-12-05 00:35:01 UTC
iftop-0.17-12.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.