I had crashes due to corrupted pointers and put a hardware watchpoint at the structure in question to figure out who was changing it. It triggered at the code in question, and removing it (by reverting the patch) fixed the issue.
Hi, I believe you need to use Perl callbacks, ie. something like my $cb = sub { print "foo\n"; }; $sess->get(..., $cb); while (1) { SNMP::MainLoop(); } Just print $sess->get(...) won't use a callback, since it's synchronous.
I've tried reproducing by sending to a host that's down, but I haven't managed to make a simple repro that way, no. In any case, I won't be spending much more time making a repro for this (it took forever to track down i the first place). The bug is clear enough when you look at the code, although of course a regression test would be nice to have.
It's tricky to make a simple repro, because it depends on a failure condition in the network.
Failing SNMPv3 packets cause crashes
Hi, As far as I can tell, this patch causes a crash when SNMPv3 packets fail. There's simply no guarantee that “magic” points to a struct synch_state, so you end up overwriting a random value in the caller's address space. In particular, I've seen this happen with the Perl module.
I found a small mistake in the patch, that can cause a warning (and seemingly sometimes...
Bugfix for bulk gets in SNMP.pm