[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-bugs
Subject:    [ net-snmp-Bugs-3164831 ] net-snmp should use clock_gettime( ..., CLOCK_MONOTONIC, ...
From:       SourceForge.net <noreply () sourceforge ! net>
Date:       2012-02-15 10:11:43
Message-ID: E1Rxbpw-0008Ku-Lk () sfs-ml-2 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Bugs item #3164831, was opened at 2011-01-24 08:28
Message generated for change (Comment added) made by bvassche
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3164831&group_id=12694

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: library
Group: None
> Status: Closed
Resolution: None
Priority: 9
Private: No
Submitted By: Bill Fenner (fenner)
Assigned to: Nobody/Anonymous (nobody)
Summary: net-snmp should use clock_gettime( ..., CLOCK_MONOTONIC, ...

Initial Comment:
I had the following scenario occur:

1. subagent starts, can't connect to snmpd, sets 15 second retry timer
2. snmpd starts
3. something else sets the clock back by 9 hours

This caused 2 things:

a. the subagent's 15 second timer became 9 hours and 15 seconds, because it was \
waiting for gettimeofday() to catch up with the t_next that had been set when the \
timer was scheduled; b. snmpd was reporting sysUpTime values of 497 days, since the \
gettimeofday() value that it got at startup was in the future relative to the current \
values.

Both of these failure modes could be addressed by using clock_gettime( ..., \
CLOCK_MONOTONIC, ... ) if it is available on the host system (it's available on all \
modern systems).  The only place where using gettimeofday() is required is when \
serving a DateAndTime TC or some other wall-clock-based value.  For internal \
timekeeping, including timers and sysUpTime, CLOCK_MONOTONIC is way better.


----------------------------------------------------------------------

> Comment By:  (bvassche)
Date: 2012-02-15 02:11

Message:
Fixed by commit f8a3ef0d3d4e530279900101049b8de98a44a6fb, which has been
applied on the v5.7 and master branches.

----------------------------------------------------------------------

Comment By: Marius Heuler (mheuler)
Date: 2011-02-03 10:30

Message:
This would create a negative uptime value which if casted to an unsigned
value could trigger the overflow described in bug 3165878. We had crashes
of SNMP clients accessing due to this bug. They could be triggerd by this
problem described here.

----------------------------------------------------------------------

Comment By: Robert Story (rstory)
Date: 2011-01-24 08:32

Message:
assuming this affects all timers, bumping priority to 9...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3164831&group_id=12694

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Net-snmp-bugs mailing list
Net-snmp-bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic