This tiny perl script crashes with a segfault: (.1.3.6.1.2.1.2.2.1.1.1 is IF-MIB::ifIndex.1, and localhost actually contains this OID...)

Therefore I took the liberty of filing this bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=1207661&group_id=12694&atid=112694

#!/usr/bin/perl -w
use SNMP;
my $sess = new SNMP::Session(DestHost   => 'localhost',
                             Community  => 'public',
                             Version    => '2c',
                             UseNumeric => 1
                            );

my $varlist = new SNMP::VarList(['.1.3.6.1.2.1.2.2.1.1.1']);

sub cb {
  print 'cb called: ' . join(", ", @_) . "\n";
  exit;
}

$sess->get($varlist, \&cb);
SNMP::MainLoop();

The backtrace is:
> gdb perl
GNU gdb 6.3-debian
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 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 "i386-linux"...(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run o.pl
Starting program: /usr/bin/perl o.pl
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1209785600 (LWP 8475)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209785600 (LWP 8475)]
0xb7ee8363 in strlen () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7ee8363 in strlen () from /lib/tls/libc.so.6
#1  0xb7c32e85 in __snmp_xs_cb () from /usr/lib/perl5/auto/SNMP/SNMP.so
#2  0xb7da597a in snmp_create_sess_pdu () from /usr/lib/libnetsnmp.so.5
#3  0xb7da6b6b in _sess_read () from /usr/lib/libnetsnmp.so.5
#4  0xb7da71e9 in snmp_sess_read () from /usr/lib/libnetsnmp.so.5
#5  0xb7da601c in snmp_read () from /usr/lib/libnetsnmp.so.5
#6 0xb7c46dbe in XS_SNMP__main_loop () from /usr/lib/perl5/auto/SNMP/SNMP.so
#7  0x080c32d6 in Perl_pp_entersub ()
#8  0x080bbdc9 in Perl_runops_standard ()
#9  0x080635e8 in perl_run ()
#10 0x080633f5 in perl_run ()
#11 0x0805fb9f in main ()
(gdb)

I'm running on an up-to-date debian "unstable" with the standard debian 5.1.2-6.1 SNMP versions.
--
Peter Valdemar M�rch
http://www.morch.com


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to