The use of snmp_api_errstring() (and strcat() !!) inside the python wrapper causes random segmentation faults in a multithreaded application when several error conditions occur.
The following patch uses the snmp_sess_error() instaed of snmp_api_errstring() as described in the README.Thread document.
The patch tries to fix also the returned values of the session's attributes ErrorStr, ErrorNum, ErrorInd.
I'm not sure at 100% the patch is correct. I've been testing it in a production environment with 40000+ SNMP checks per hour for three days and the python wrapper haven't crashed yet. Crashes were almost one per hour before the patch was applied.
The patch file
Thanks for the patch, but we have a problem: It doesn't apply cleanly to the trunk (3 section are failing). I'd try to apply it to another version but I'm not sure what you made the patch from and because the patch is in raw-diff mode, it's not safe at all to apply.
Can you:
1) ideally generate a patch based on the current trunk code?
2) even if not that, at least generate the patch using diff -u instead? That would give us a greater chance of succeeding in applying it.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 180 days (the time period specified by
the administrator of this Tracker).