Re: Peculiar behaviour with snmp get - scotty 2.0.2

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Tue, 10 Sep 1996 05:47:16 +0200

michele@pqtech.com (Michele Chen) said:

Michele> I'm running scotty 2.0.2 with itcl 2.0 under SunOS
Michele> 4.1.3 and am seeing very peculiar behaviour when I
Michele> send out a lot of SNMP get requests to a single agent.

[ ... problem description removed ... ]

Michele> First, any ideas on why this is happening and what I
Michele> can do to eliminate it? Also, any insights on using
Michele> 'update' would also help. Any thoughts would be
Michele> greatly appreciated.

Looks like a serious problem in 2.0.2. Can you check if the same
problem exists with 2.1.3 or later? If you do not have access to
2.1.3, can you please send me a small example script that triggers
this problem?

In general, you should not worry about how many async requests you
generate. The C code should take care of it and process them when
appropriate. However, there have been (and there still are) some
problems with protecting pointers to internal data structures during
callback processing. A typical problem is a SNMP session which is
destroyed during callback processing and leads to a dangling
pointer. Using "update" makes these things even more complicated
because you add more potentially dangling pointers to the execution
stack.

Your problem might also have to do with the fact that 2.0.2 deletes
the internal request data structure after callback processing. This
protects the request data structure but has strange effects since
events processed during the callback (e.g. "update") can trigger a
noResponse callback (a timeout occurs during callback processing since
the internal request has not yet been removed).

I hope to get rid of all these problems in the next 2.1.* patches by
adding Tcl_Preserve() and Tcl_Release() calls to protect whatever
needs protection. However, this needs good tests because it is easy to
miss something which leads either to a dangling pointer or a memory
leak.
Juergen

--
Juergen Schoenwaelder schoenw@cs.utwente.nl http://www.cs.utwente.nl/~schoenw
Computer Science Department, University of Twente,   (Fax: +31-53-489-3247)
P.O. Box 217, NL-7500 AE Enschede, The Netherlands.  (Tel. +31-53-489-3678)