Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jun 2003 02:26:34 -0700
From:      Luigi Rizzo <rizzo@icir.org>
To:        ticso@cicely.de
Cc:        current@freebsd.org
Subject:   Re: 5.1-RELEASE TODO
Message-ID:  <20030601022633.A4287@xorpc.icir.org>
In-Reply-To: <20030601013256.GH503@cicely12.cicely.de>; from ticso@cicely12.cicely.de on Sun, Jun 01, 2003 at 03:32:56AM %2B0200
References:  <3ED94166.7070300@btc.adaptec.com> <Pine.NEB.3.96L.1030531201712.3370J-100000@fledge.watson.org> <20030531173958.C91048@xorpc.icir.org> <20030601013256.GH503@cicely12.cicely.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 01, 2003 at 03:32:56AM +0200, Bernd Walter wrote:
...
> :)
> And I hoped a programmer who knows the source could find out and fix
> very quickly.

sorry, i missed the offending line number in your previous email.

I think i missed a & in all the first arguments to bcopy in
the src/sbin/ipfw2.c changes :(

this happens at lines 818, 1224, 1461 and 1701. Fortunately
the kernel part seems correct.

In detail, the fix should be the following:

818:
-       bcopy(rule->next_rule, &set_disable, sizeof(set_disable));
+       bcopy(&rule->next_rule, &set_disable, sizeof(set_disable));

1224:
-       bcopy(d->rule, &rulenum, sizeof(rulenum));
+       bcopy(&d->rule, &rulenum, sizeof(rulenum));

1461:
-               bcopy(((struct ip_fw *)data)->next_rule,
+               bcopy(&((struct ip_fw *)data)->next_rule,

1701:
-                               bcopy(d->rule, &rulenum, sizeof(rulenum));
+                               bcopy(&d->rule, &rulenum, sizeof(rulenum));

	thanks
	luigi


> To be honest - I did not investigate the reason for the failure as
> there were other things on my todo list.
> Well after getting some sleep I will check that again.
> 
> Nevertheless here are the stack traces again - in case someone else can
> identify the cause in the meantime:
> cicely12# ipfw flush
> Are you sure? [yn] y
> 
> Flushed all rules.
> cicely12# ipfw show
> Segmentation fault (core dumped)
> cicely12# May 23 17:09:50 cicely12 kernel: pid 601 (ipfw), uid 0: exited on signal 11 (core dumped)
> cicely12# gdb /usr/obj/var/d3/FreeBSD-2003-05-22/src/sbin/ipfw/ipfw ipfw.core
> GNU gdb 5.2.1 (FreeBSD)
> Copyright 2002 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 "alpha-undermydesk-freebsd"...
> Core was generated by `ipfw'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x120044794 in bcopy ()
> (gdb) bt
> #0  0x120044794 in bcopy ()
> #1  0x120001564 in show_ipfw (rule=0x1200ac000, pcwidth=3, bcwidth=5)
>     at /var/d3/FreeBSD-2003-05-22/src/sbin/ipfw/ipfw2.c:818
> (gdb)
> 
> cicely12# ipfw add allow ip from any to any
> Segmentation fault (core dumped)
> cicely12# May 23 17:13:40 cicely12 kernel: pid 644 (ipfw), uid 0: exited on signal 11 (core dumped)
> cicely12# gdb /usr/obj/var/d3/FreeBSD-2003-05-22/src/sbin/ipfw/ipfw ipfw.core
> GNU gdb 5.2.1 (FreeBSD)
> Copyright 2002 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 "alpha-undermydesk-freebsd"...
> Core was generated by `ipfw'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x120044794 in bcopy ()
> (gdb) bt
> #0  0x120044794 in bcopy ()
> #1  0x120001564 in show_ipfw (rule=0x120099cb0, pcwidth=10, bcwidth=10)
>     at /var/d3/FreeBSD-2003-05-22/src/sbin/ipfw/ipfw2.c:818
> warning: Hit beginning of text section without finding
> warning: enclosing function for address 0x8
> This warning occurs if you are debugging a function without any symbols
> (for example, in a stripped executable).  In that case, you may wish to
> increase the size of the search with the `set heuristic-fence-post' command.
> 
> Otherwise, you told GDB there was a function where there isn't one, or
> (more likely) you have encountered a bug in GDB.
> (gdb)
> 
> -- 
> B.Walter                   BWCT                http://www.bwct.de
> ticso@bwct.de                                  info@bwct.de
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030601022633.A4287>