Menu

#1050 [python] Segmentation fault on SNMP error or timeout

closed
nobody
None
5
2012-11-09
2010-02-16
Diego Billi
No

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.

Discussion

  • Diego Billi

    Diego Billi - 2010-02-16

    The patch file

     
  • Wes Hardaker

    Wes Hardaker - 2010-09-02

    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.

     
  • SourceForge Robot

    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).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.