ntpsnmpd crash

Hi,

This is on a Linux, machine, git head.

Output of ntpsnmpd -D9:

packetEater got a full packet: GetNextPDU(bigEndian=True, context=None, oidranges=(SearchRange(OID((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 5, 1), False), OID((1, 3, 6, 1, 2, 1, 198), False)),), packetID=7134, pduType=6, sessionID=10, transactionID=7133)

sending packet: ResponsePDU(bigEndian=True, packetID=7134, pduType=18, resError=0, resIndex=0, sessionID=10, sysUptime=0, transactionID=7133, varbinds=[Varbind(vtype=4, oid=OID((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 5, 2), False), payload=[216, 239, 35, 0])])
'\x01\x12\x10\x00\x00\x00\x00\n\x00\x00\x1b\xdd\x00\x00\x1b\xde\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x08\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\xc5\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\x04\xd8\xef#\x00' 
Received data: '\x01\x06\x10\x00\x00\x00\x00\n\x00\x00\x1b\xdf\x00\x00\x1b\xe0\x00\x00\x000\x08\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\xc5\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x02\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\xc6'

packetEater got a full packet: GetNextPDU(bigEndian=True, context=None, oidranges=(SearchRange(OID((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 5, 2), False), OID((1, 3, 6, 1, 2, 1, 198), False)),), packetID=7136, pduType=6, sessionID=10, transactionID=7135)

sending packet: ResponsePDU(bigEndian=True, packetID=7136, pduType=18, resError=0, resIndex=0, sessionID=10, sysUptime=0, transactionID=7135, varbinds=[Varbind(vtype=4, oid=OID((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 5, 3), False), payload=[216, 239, 35, 12])])
'\x01\x12\x10\x00\x00\x00\x00\n\x00\x00\x1b\xdf\x00\x00\x1b\xe0\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x08\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\xc5\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x03\x00\x00\x00\x04\xd8\xef#\x0c' 
Received data: '\x01\x06\x10\x00\x00\x00\x00\n\x00\x00\x1b\xe1\x00\x00\x1b\xe2\x00\x00\x000\x08\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\xc5\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x03\x02\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\xc6'

packetEater got a full packet: GetNextPDU(bigEndian=True, context=None, oidranges=(SearchRange(OID((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 5, 3), False), OID((1, 3, 6, 1, 2, 1, 198), False)),), packetID=7138, pduType=6, sessionID=10, transactionID=7137)
Traceback (most recent call last):
  File "/usr/local/bin/ntpsnmpd", line 1359, in <module>
    mainloop(masterAddr)
  File "/usr/local/bin/ntpsnmpd", line 1280, in mainloop
    control.mainloop(True)
  File "/usr/local/bin/ntpsnmpd", line 973, in mainloop
    self._doloop()
  File "/usr/local/bin/ntpsnmpd", line 994, in _doloop
    self.pduHandlers[ptype](packet)
  File "/usr/local/bin/ntpsnmpd", line 1132, in handle_GetNextPDU
    binds.append(reader(oid))
  File "/usr/local/bin/ntpsnmpd", line 905, in readCallback
    return handler(oid, associd)
  File "/usr/local/bin/ntpsnmpd", line 689, in handler
    srcadr = [int(x) for x in pieces]
ValueError: invalid literal for int() with base 10: ''
root@ntpmon:~/ntpsec# 

Output of snmpwalk at the same time, which was in progress:

iso.3.6.1.2.1.197.1.3.1.1.3.4 = STRING: "192."
iso.3.6.1.2.1.197.1.3.1.1.3.5 = STRING: "INIT"
iso.3.6.1.2.1.197.1.3.1.1.3.6 = STRING: "192."
iso.3.6.1.2.1.197.1.3.1.1.3.7 = STRING: "GPS"
iso.3.6.1.2.1.197.1.3.1.1.3.8 = STRING: "128.237.148.132"
iso.3.6.1.2.1.197.1.3.1.1.3.9 = STRING: "MSF"
iso.3.6.1.2.1.197.1.3.1.1.3.10 = STRING: "INIT"
iso.3.6.1.2.1.197.1.3.1.1.4.0 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.4.1 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.4.2 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.4.3 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.4.4 = INTEGER: 2
iso.3.6.1.2.1.197.1.3.1.1.4.5 = INTEGER: 2
iso.3.6.1.2.1.197.1.3.1.1.4.6 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.4.7 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.4.8 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.4.9 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.4.10 = INTEGER: 1
iso.3.6.1.2.1.197.1.3.1.1.5.0 = Hex-STRING: 7F 7F 1C 01 
iso.3.6.1.2.1.197.1.3.1.1.5.1 = Hex-STRING: 7F 7F 1C 00 
iso.3.6.1.2.1.197.1.3.1.1.5.2 = Hex-STRING: D8 EF 23 00 
iso.3.6.1.2.1.197.1.3.1.1.5.3 = Hex-STRING: D8 EF 23 0C 

Note that this on a server which is in the pool, so heavily used.

Please let me know if you need further information.

@ianbruene , let me know if you need a login to the server.

Edited by Sanjeev Gupta