Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8915

ArrayIndexOutOfBoundsException while processing some trap varbinds

    Details

    • Sprint:
      Horizon - Nov 23rd, Horizon - Nov 30th, Horizon - Dec 7th, Horizon - Dec 14th

      Description

      Steps to reproduce:

      1. Start up OpenNMS with Trapd enabled (default case)
      2. Send a trap with at least one octet-string varbind containing a series of characters that does not parse as UTF-8 text. The sequence 4f5ffa95 in the following command serves as an example:
      snmptrap -v1 -c public 127.0.0.1 \
       .1.3.6.1.4.1.9.9.5.34 10.20.30.40 5 0 '' \
       .1.3.6.1.4.1.9.9.131.1.5.2.0 i 1 \
       .1.3.6.1.4.1.9.9.131.1.5.3.0 x 4f5ffa95
      

      Expected result: Trap ingested silently and turned into an event

      Actual result: No event is created, and the following appears in trapd.log:

      2016-11-28 15:49:23,756 ERROR [pool-6-thread-1] o.o.n.t.TrapQueueProcessor: Unexpected error processing trap: java.lang.ArrayIndexOutOfBoundsException: 4
      java.lang.ArrayIndexOutOfBoundsException: 4
              at org.opennms.netmgt.snmp.AbstractSnmpValue.allBytesUTF_8(AbstractSnmpValue.java:94) ~[org.opennms.core.snmp.api-18.0.2.jar:?]
              at org.opennms.netmgt.snmp.AbstractSnmpValue.allBytesDisplayable(AbstractSnmpValue.java:34) ~[org.opennms.core.snmp.api-18.0.2.jar:?]
              at org.opennms.netmgt.snmp.snmp4j.Snmp4JValue.isDisplayable(Snmp4JValue.java:309) ~[org.opennms.core.snmp.implementations.snmp4j-18.0.2.jar:?]
              at org.opennms.netmgt.model.events.snmp.SyntaxToEvent.processSyntax(SyntaxToEvent.java:114) ~[opennms-model-18.0.2.jar:?]
              at org.opennms.netmgt.trapd.EventCreator.processVarBind(EventCreator.java:105) ~[org.opennms.features.events.traps-18.0.2.jar:?]
              at org.opennms.netmgt.snmp.TrapInformation.processVarBind(TrapInformation.java:120) ~[org.opennms.core.snmp.api-18.0.2.jar:?]
              at org.opennms.netmgt.snmp.snmp4j.Snmp4JTrapNotifier$Snmp4JV1TrapInformation.processVarBindAt(Snmp4JTrapNotifier.java:111) ~[org.opennms.core.snmp.implementations.snmp4j-18.0.2.jar:?]
              at org.opennms.netmgt.snmp.TrapInformation.processTrap(TrapInformation.java:113) ~[org.opennms.core.snmp.api-18.0.2.jar:?]
              at org.opennms.netmgt.snmp.TrapInformation.getTrapProcessor(TrapInformation.java:84) ~[org.opennms.core.snmp.api-18.0.2.jar:?]
              at org.opennms.netmgt.trapd.TrapQueueProcessor.call(TrapQueueProcessor.java:172) [org.opennms.features.events.traps-18.0.2.jar:?]
              at org.opennms.netmgt.trapd.TrapQueueProcessor.call(TrapQueueProcessor.java:61) [org.opennms.features.events.traps-18.0.2.jar:?]
              at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_73]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_73]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_73]
              at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jeffg Jeff Gehlbach
                Reporter:
                jeffg Jeff Gehlbach
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: