[sisyphus] Re: tcpdump

=?iso-8859-1?q?at_=CE=C1_turbinal=2Eorg?= =?iso-8859-1?q?at_=CE=C1_turbinal=2Eorg?=
Вт Сен 17 01:42:38 MSD 2002


On Mon, Sep 16, 2002 at 11:50:08PM +0300, Michael Shigorin wrote:
> On Tue, Sep 17, 2002 at 12:00:35AM +0400, at на turbinal.org wrote:
> > # tcpdump
> 
> -i?

А у вас всё нормально?

# tcpdump -i lo
tcpdump: Segmentation fault
#

Вопросец: есть какой-нибудь ключик к rpm, чтобы собирать -bi только с -g
и без стрипа? А то я типа спек правлю.

(gdb) r -i lo
Starting program: /var/tmp/tcpdump-buildroot/usr/sbin/tcpdump -i lo
tcpdump:
Program received signal SIGSEGV, Segmentation fault.
0x2abed3aa in vfprintf () from /lib/libc.so.6
(gdb) bt
#0  0x2abed3aa in vfprintf () from /lib/libc.so.6
#1  0x2abf1008 in vfprintf () from /lib/libc.so.6
#2  0x2abf09b4 in vfprintf () from /lib/libc.so.6
#3  0x08083d54 in error (fmt=0x1 <Address 0x1 out of bounds>) at util.c:252
#4  0x08084110 in drop_priv () at droppriv.c:25
#5  0x08083274 in main (argc=3, argv=0x7ffffac4) at tcpdump.c:481
#6  0x2abbf4d2 in __libc_start_main () from /lib/libc.so.6

(gdb) b drop_priv
Note: breakpoint 1 also set at pc 0x808409a.
Breakpoint 2 at 0x808409a: file droppriv.c, line 13.
(gdb) r -i lo
Starting program: /var/tmp/tcpdump-buildroot/usr/sbin/tcpdump -i lo
Breakpoint 1, drop_priv () at droppriv.c:13
13              const char *user = "tcpdump";
(gdb) n
14              const char *dir = "/var/resolv";
(gdb) n
17              if (geteuid ())
(gdb) n
20              if ((setgroups (0, NULL) < 0))
(gdb) n
23              pw = getpwnam (user);
(gdb) n
24              if (!pw)
(gdb) s
25                      error (EXIT_FAILURE, 0, "lookup of user \"%s\" failed", user);
(gdb) s
error (fmt=0x1 <Address 0x1 out of bounds>) at util.c:250
250             (void)fprintf(stderr, "%s: ", program_name);
(gdb) s
tcpdump: 251            va_start(ap, fmt);
(gdb) s
252             (void)vfprintf(stderr, fmt, ap);
(gdb) p fmt
$1 = 0x1 <Address 0x1 out of bounds>
(gdb) p ap
$2 = 0x7ffff8d4 ""
(gdb)

Короче смысл такой, что va_arg будет разматывать стек, которого нет.

$ grep 'error *(' tcpdump-*/*.h
tcpdump-3.7.1/interface.h:extern void error(const char *, ...)
$

Вывод: tcpdump битый.



Подробная информация о списке рассылки Sisyphus