and i got the error from this code:panic: corrupt saved stack index (P) The savestack was requested to restore more localized values than there are in the savestack.
#!/usr/SD/perl/bin/perl use lib './testlib'; use strict; use ObjTest; use Internal::DBI; my $dbh = logon(); my $sth = $dbh->prepare('select hostname from host'); $sth->execute; my @hosts = map { $_ = $_->[0] } @{ $sth->fetchall_arrayref }[0..20]; foreach my $name ( @hosts ) { my $host = ObjTest->new( name => $name ); my $true = $host->is_router(); print "RETURNED: $name is a router\n\n" if ( $true ); undef $host; } $sth->finish; $dbh->disconnect;
where ObjTest is a new module that uses gethostbyname to get the IP addr of a host, and then creates a new SNMP::Session. the SNMP::Session is then used by the 'is_router' command to get 'whyReload' from the router. like so:
sub is_router { my $self = shift; my $session = $self->{SESSION}; my $varbind = SNMP::VarList->new( [ 'whyReload' , 0 ] ); my $result = $session->get( $varbind ); if ( $session->{ErrorStr} ) { return 0; }; if ( $result =~ /winnt/i ) { return 1; }; }
if the above test program is run for 2 hosts ( i've manually defined @hosts ), i don't see the error. but when i run it for 20 hosts, i get the error EVERY time. and I'm not supposed to see it. . . any ideas on how to make it go away?
In reply to an internal error you should never see by geektron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |