On Tue, Jan 10, 2012 at 1:20 AM, Joel Avni <[email protected]> wrote:

> I have a question regarding the perl cleanup in snnmptrapd. Why
> shutdown_perl() is called from withithin the term_handler() routine in
> snmptrapd.c? The problem we are seeing is that if a TERM signal is caught
> while a perl handler is still processing an incoming trap, then snmptrapd
> fails to cleanup the perl, as it can not free up the active subroutine.
> We get the warning "Can't undef active subroutine" from Perl_cv_undef() as
> it croaks. This is specifically problematic in SNMPv3 environments as then
> snmptrapd fails to increment engineBoots in the persistent data file,
> leading to a reuse of the same engineBoots on the next startup, which would
> then break time synchronization.
>
> Wouldn't it be better to call shutdown_perl() after the
> while(netsnmp_running) loop, where the rest of the c cleanup code, ie
> snmp_shutdown is called? This assumes that any perl based trap handlers
> have completed before shutting down the perl interpreter.
>

A slightly modified version of your patch has been applied as commit
d059fb878b1436599953cea5a077499ddcdcbcb5 on the 5.5 and above branches.
Does that help ?

Bart.
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to