Subject: kern/34286: "ippool -f large.pool" gives error: yacc stack overflow error at "0", line 4995
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <yancm@sdf.lonestar.org>
List: netbsd-bugs
Date: 08/26/2006 01:05:00
>Number:         34286
>Category:       kern
>Synopsis:       "ippool -f large.pool" gives error: yacc stack overflow error at "0", line 4995
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 26 01:05:00 +0000 2006
>Originator:     Gene ENonymous
>Release:        3 Stable
>Organization:
>Environment:
NetBSD sleepy 3.1_RC1 NetBSD 3.1_RC1 (GENERIC) #1: Thu Aug 24 06:52:07 EDT 2006  root@sleepy:/usr/obj/sys/arch/i386/compile/GENERIC i386

>Description:
When trying to load large ipf pool (ippool -f large.pool
the operation fails with the following error message: 
   yacc stack overflow error at "0", line 4995
The "0" looks to be whatever numeric value it encounters
when the stack yack occurs. 8-)

I would like to be able to load very large pools bound
only by my available memory resources
(physical/swap/kernel/userland - whatever).

This appears to be a bug, either in the ipf distribution
(v4.1.8 in this case), in the port of that distribution to this
platform or maybe in the compiler or yacc code, if any?





>How-To-Repeat:
Test session; remember, must have:
/dev/iplookup (if not rerun MAKEDEV all)
and compile a GENERIC kernel with 
options IPFILTER_LOOKUP

# ./genpool 4994 > junk.pool
# ippool -f junk.pool
yacc stack overflow error at "130", line 4995
# ippool -l
# ippool -F
0 objects flushed
# ./genpool 4993 > junk.pool
# ippool -f junk.pool
# ippool -F
# 1 objects flushed
# cat genpool
#!/usr/pkg/bin/perl
my $ii = 0;
my $nitems = $ARGV[0];
my $ip0 = 0;
my $ip1 = 0;
my $ip2 = 0;
my $ip3 = 0;


print "table role = ipf type = tree number = 5 {\n";

while ($ii < $nitems){
  if ($ip0++ == 255) {
    $ip0 = 0;
    if ($ip1++ == 255) {
      $ip1 = 0;
      if ($ip2++ == 255) {
        $ip2 = 0;
        if ($ip3++ == 255) {
          print "too many items";
          exit;
        }
      }
    }
  }
  print $ip3,".",$ip2,".",$ip1,".",$ip0,";\n";

  $ii++;
}

print "};\n"

>Fix: