>>>>> On Fri, 11 Sep 2009 16:38:58 -0600, "Leo Bredehoft" 
>>>>> <[email protected]> said:

LB> Startup code is in a main thread, after which a service thread is
LB> spawned to loop on agent_check_and_process().  The failure is
LB> solidly reproducible, too.

Well, threading does cause concerns since the Net-SNMP agent is not
thread-safe at all.  But if it's run in a single thread itself, I think
it should work assuming you take careful control of pointers going into
and out of the Net-SNMP thread and never allowing them to be used in two
threads (IE, always copy the data).

LB> Build_oid_segment() is apparently seeing a non-null, yet invalid,
LB> var->name.  I have reviewed the code I'm generating, and it follows
LB> closely the form of the existing "iterate" code.  I suspect the
LB> problem may have to do with some failure to properly set index
LB> values in the *get_next_data_point(), although they seem to be the
LB> same as the original ones.

Are you using snmp_set_var_value() in the _next_data_point() function?
or copying them in in some other way?  Is the data copied (like
snmp_set_var_value() does)?  Is the pointer just inserted?

You might try using valgrind for doing debugging.  It's great for
detecting memory related errors (once you can get the hang of using it). 

-- 
Wes Hardaker
Please mail all replies to [email protected]

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to