From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: at@turbinal.org Date: Tue, 17 Sep 2002 01:42:38 +0400 To: sisyphus@altlinux.ru Subject: Re: [sisyphus] Re: tcpdump Message-ID: <20020916214238.GA24382@homestead.turbinal.org> References: <20020916200035.GA17157@homestead.turbinal.org> <20020916205008.GO20694@osdn.org.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20020916205008.GO20694@osdn.org.ua> Sender: sisyphus-admin@altlinux.ru Errors-To: sisyphus-admin@altlinux.ru X-BeenThere: sisyphus@altlinux.ru X-Mailman-Version: 2.0.13 Precedence: bulk Reply-To: sisyphus@altlinux.ru List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Archived-At: List-Archive: 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
) 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
) 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
(gdb) p ap $2 = 0x7ffff8d4 "" (gdb) Короче смысл такой, что va_arg будет разматывать стек, которого нет. $ grep 'error *(' tcpdump-*/*.h tcpdump-3.7.1/interface.h:extern void error(const char *, ...) $ Вывод: tcpdump битый.