From owner-freebsd-current@FreeBSD.ORG Mon Apr 12 06:12:54 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18FE7106564A for ; Mon, 12 Apr 2010 06:12:54 +0000 (UTC) (envelope-from hizel@vyborg.ru) Received: from mail.vyborg.ru (mail.vyborg.ru [195.177.105.12]) by mx1.freebsd.org (Postfix) with ESMTP id A247E8FC13 for ; Mon, 12 Apr 2010 06:12:53 +0000 (UTC) Received: from hzwork.vyborg.ru (o.vyborg.ru [195.177.104.22]) by mail.vyborg.ru (8.14.3/8.14.3) with ESMTP id o3C6EFpN058672 for ; Mon, 12 Apr 2010 10:14:15 +0400 (MSD) (envelope-from hizel@vyborg.ru) Date: Mon, 12 Apr 2010 10:12:52 +0400 From: Hizel Ildar To: freebsd-current@freebsd.org Message-ID: <20100412101252.64645a1b@hzwork.vyborg.ru> In-Reply-To: <20100412100756.1ef3af73@hzwork.vyborg.ru> References: <4BC1790F.1020205@lissyara.su> <20100412100756.1ef3af73@hzwork.vyborg.ru> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.20.0; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: ipfw bug on i386 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 06:12:54 -0000 =D0=92 Mon, 12 Apr 2010 10:07:56 +0400 Hizel Ildar =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > =D0=92 Sun, 11 Apr 2010 11:23:59 +0400 > Alex Keda =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 > > srv5# more /tmp/a.sh > > table=3D"24" > > ipfw table $table flush > > for octet3 in `jot - 1 60` > > do > > for octet4 in `jot - 1 254` > > do > > echo "table $table add 192.168.$octet3.$octet4" >> /tmp/$$.txt > > done > > done > > ipfw /tmp/$$.txt > > rm -f /tmp/$$.txt > >=20 > > effect: > >=20 > > srv5# sh /tmp/a.sh > > Abort trap (core dumped) > > srv5# > > srv5# ll ipfw.core > > -rw------- 1 root wheel - 1,9M 11 =D0=B0=D0=BF=D1=80 11:22 ipfw.core > > srv5# > >=20 > > Tested on 8,9 i386 - core dump, amd64 - all OK > > 7 - all OK > >=20 > > _______________________________________________ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to > > "freebsd-current-unsubscribe@freebsd.org" > >=20 >=20 > Hey! I'm fix this bug :D >=20 > patch: >=20 > foo# diff -ruN main.c~ main.c > --- main.c~ 2010-03-04 19:54:56.000000000 +0300 > +++ main.c 2010-04-12 09:37:21.000000000 +0400 > @@ -553,7 +553,7 @@ > } > =20 > while (fgets(buf, BUFSIZ, f)) { /* read commands */ > - char linename[10]; > + char linename[11]; > char *args[2]; > =20 > lineno++; > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to > "freebsd-current-unsubscribe@freebsd.org" >=20 this is backtrace without my patch: foo# gdb /sbin/ipfw ipfw.core=20 GNU gdb 6.1.1 [FreeBSD] Copyright 2004 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 condition= s. 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-marcel-freebsd"... Core was generated by `ipfw'. Program terminated with signal 6, Aborted. Reading symbols from /lib/libutil.so.9...done. Loaded symbols for /lib/libutil.so.9 Reading symbols from /lib/libc.so.7...done. Loaded symbols for /lib/libc.so.7 Reading symbols from /libexec/ld-elf.so.1...done. Loaded symbols for /libexec/ld-elf.so.1 #0 0x281eee1b in kill () at kill.S:3 3 RSYSCALL(kill) (gdb) bt #0 0x281eee1b in kill () at kill.S:3 #1 0x280e8ef5 in __fail (msg=3D0x281f3730 "stack overflow detected; termin= ated") at /usr/src/lib/libc/sys/stack_protector.c:95 #2 0x280e8f30 in __stack_chk_fail () at /usr/src/lib/libc/sys/stack_protec= tor.c:102 #3 0x08057f44 in ipfw_readfile (ac=3D2, av=3D0xbfbfecac) at /usr/src/sbin/= ipfw/main.c:581 #4 0x08057fca in main (ac=3D2, av=3D0xbfbfecac) at /usr/src/sbin/ipfw/main= .c:606 Current language: auto; currently asm foo# uname -a FreeBSD foo.vyborg.ru 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sun Apr 11 21:00:05 MSD 2010 root@foo.vyborg.ru:/usr/obj/usr/src/sys/GENERIC i386