Richard
As root with .iftoprc in /root/ on a Dell laptop running Fedora, iftop works for me.
Is your .iftoprc ok?
Steve
On Wed, 17 Mar 2004 13:22:09 +0000 Steven J Baker sjb@ambrielconsulting.com wrote:
As root with .iftoprc in /root/ on a Dell laptop running Fedora, iftop works for me.
Is your .iftoprc ok?
The iftoprc is included in the tarball. But even if there is rubbish in the file, iftop should not segfault IMHO ;-)
Here is the .iftoprc (which works on other machines):
interface: eth0 dns-resolution: no port-resolution: no filter-code: not udp port 53 show-bars: yes promiscuous: yes port-display: on hide-source: no hide-destination: no use-bytes: no #sort: 2s #sort: 10s sort: 40s #sort: source #sort: destination line-display: one-line-both #line-display: two-line #line-display: one-line-sent #line-display: one-line-received show-totals: yes log-scale: no max-bandwidth: 512k #net-filter: net/mask #screen-filter: regexp
On Wed, Mar 17, 2004 at 02:28:43PM +0100, richard lucassen wrote:
On Wed, 17 Mar 2004 13:22:09 +0000 Steven J Baker sjb@ambrielconsulting.com wrote:
As root with .iftoprc in /root/ on a Dell laptop running Fedora, iftop works for me.
Is your .iftoprc ok?
The iftoprc is included in the tarball. But even if there is rubbish in the file, iftop should not segfault IMHO ;-)
This is true.
The iftop you're running doesn't appear to have debugging info in it, so I can't tell much from the bt. Can you recompile with debugging info. I think "CFLAGS=-g && make clean && make" should do the trick.
Please just cut and paste the trace into the email - I'll respond quicker that way :-)
thanks,
Paul
On Thu, 18 Mar 2004 21:59:37 +0000 Paul Warren pdw@ex-parrot.com wrote:
The iftoprc is included in the tarball. But even if there is rubbish in the file, iftop should not segfault IMHO ;-)
This is true.
The iftop you're running doesn't appear to have debugging info in it, so I can't tell much from the bt. Can you recompile with debugging info. I think "CFLAGS=-g && make clean && make" should do the trick.
Please just cut and paste the trace into the email - I'll respond quicker that way :-)
Ok, here it is:
GNU gdb Red Hat Linux (5.3.90-0.20030710.41rh) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
Core was generated by `/usr/local/sbin/iftop'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/lib/libpcap.so.0.6.2...done. Loaded symbols for /usr/lib/libpcap.so.0.6.2 Reading symbols from /lib/tls/libm.so.6...done. Loaded symbols for /lib/tls/libm.so.6 Reading symbols from /usr/lib/libncurses.so.5...done. Loaded symbols for /usr/lib/libncurses.so.5 Reading symbols from /lib/tls/libpthread.so.0...done. Loaded symbols for /lib/tls/libpthread.so.0 Reading symbols from /lib/tls/libc.so.6...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /usr/lib/libgpm.so.1...done. Loaded symbols for /usr/lib/libgpm.so.1 #0 0x00c39f4a in strcmp () from /lib/tls/libc.so.6 (gdb) where #0 0x00c39f4a in strcmp () from /lib/tls/libc.so.6 #1 0x0804e456 in is_cfgdirective_valid (s=0x96ce178 "port-resolution") at cfgfile.c:50 #2 0x0804e646 in read_config_file (f=0x96ce020 "/root/.iftoprc", #whinge=0) at cfgfile.c:119 #3 0x0804ac20 in main (argc=1, argv=0xbfefbbc4) at iftop.c:531 (gdb) q
On Fri, Mar 19, 2004 at 10:16:24AM +0100, richard lucassen wrote:
On Thu, 18 Mar 2004 21:59:37 +0000 Paul Warren pdw@ex-parrot.com wrote:
The iftoprc is included in the tarball. But even if there is rubbish in the file, iftop should not segfault IMHO ;-)
This is true.
The iftop you're running doesn't appear to have debugging info in it, so I can't tell much from the bt. Can you recompile with debugging info. I think "CFLAGS=-g && make clean && make" should do the trick.
Please just cut and paste the trace into the email - I'll respond quicker that way :-)
Ok, here it is:
#1 0x0804e456 in is_cfgdirective_valid (s=0x96ce178 "port-resolution") at cfgfile.c:50
-- could you try this patch?
diff -u -r1.4 cfgfile.c --- cfgfile.c 4 Nov 2003 11:57:45 -0000 1.4 +++ cfgfile.c 19 Mar 2004 09:38:34 -0000 @@ -45,9 +45,9 @@ extern options_t options ;
int is_cfgdirective_valid(const char *s) { - char* t; - for (t = config_directives[0]; t != NULL; ++t) - if (strcmp(s, t) == 0) return 1; + char **t; + for (t = config_directives; t != NULL; ++t) + if (strcmp(s, *t) == 0) return 1; return 0; }
On Fri, 19 Mar 2004 09:39:02 +0000 Chris Lightfoot chris@ex-parrot.com wrote:
diff -u -r1.4 cfgfile.c --- cfgfile.c 4 Nov 2003 11:57:45 -0000 1.4 +++ cfgfile.c 19 Mar 2004 09:38:34 -0000 @@ -45,9 +45,9 @@ extern options_t options ;
int is_cfgdirective_valid(const char *s) {
- char* t;
- for (t = config_directives[0]; t != NULL; ++t)
if (strcmp(s, t) == 0) return 1;
- char **t;
- for (t = config_directives; t != NULL; ++t)
return 0;if (strcmp(s, *t) == 0) return 1;
}
Yep. This works fine!
R.