Dave Shield wrote:
> On 02/11/06, Josef Moellers <[EMAIL PROTECTED]> wrote:
>
>> Can somebody explain to me why, in close_agentx_session(), part of the
>> session infrastructure is taken down first
>> (unregister_XXX_by_session()), and _then_ the requests are cleaned up,
>> rather than the other way round?
>
>
> Probably because the session infrastructure closedown was implemented
> some six years ago, while the removal of delegated requests was added
> a couple of years later.
> I hope you're not making the erroneous assumption that any of this
> software was actually *designed*, are you? Like Topsy, it Just Growed :-)
>
>
>
>> We're having problems as subtrees are already freed (by
>> unregister_mibs_by_session()) which are later referenced by
>> netsnmp_remove_delegated_requests_for_session().
>>
>> Wouldn't it make more sense to take something down in the reverse order
>> in which it was constructed?
>
>
> Sounds logical.
> What happens if you reorder things in that way?
>
> Does moving this second block (remove_delegated) to before the
> uneregister_by_session block cause your problems to disappear?
Partly.
During analysis, I already tried *not* freing certain data structures to
see how far I got and the first thing I did was deepcopying a
netsnmp_subtree rather than assigning the pointer in
netsnmp_add_varbind_to_cache() (request->subtree, and later
request->range_end).
This fixed stale references to subtrees later.
When I re-arrange the code (first netsnmp_remove... fo session _and_ its
subtrees, then unregister_*_by_session), this cause for an snmpd crash
is gone.
However, I still get a crash in
netsnmp_handler_mark_requests_as_delegated() where a requests pointer is
stale.
This can be "fixed" by not freeing asp->requests in
free_agent_snmp_session(), but this will, most likely, result in a
merory leak.
These crashes occur when a SNMPGET(NEXT?) arrives with more than one OID
and the agentx subagent does not respond.
Josef
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders