well, at least that's what perldiag tells me about this error:

panic: corrupt saved stack index (P) The savestack was requested to restore more localized values than there are in the savestack.
and i got the error from this code:
#!/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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.