[jboss-jira] [JBoss JIRA] (JGRP-1715) NullPointerException in MessageDispatcher.handleUpEvent

Pierantonio Cangianiello (JIRA) jira-events at lists.jboss.org
Sat Oct 12 12:29:35 EDT 2013


Pierantonio Cangianiello created JGRP-1715:
----------------------------------------------

             Summary: NullPointerException in MessageDispatcher.handleUpEvent
                 Key: JGRP-1715
                 URL: https://issues.jboss.org/browse/JGRP-1715
             Project: JGroups
          Issue Type: Bug
    Affects Versions: 3.4
         Environment: Windows 7 x64 - JDK 1.7.0_40
            Reporter: Pierantonio Cangianiello
            Assignee: Bela Ban


1) Node A starts and becomes master.
2) Node B starts and Node A crashes.
3) Before becoming the new master, Node B calls channel.getState()
4) NullPointer occurs

Stacktrace:

java.lang.NullPointerException
	at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
	at org.jgroups.blocks.MessageDispatcher.handleUpEvent(MessageDispatcher.java:567)
	at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:667)
	at org.jgroups.JChannel.up(JChannel.java:643)
	at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1015)
	at org.jgroups.protocols.Locking.up(Locking.java:269)
	at org.jgroups.protocols.pbcast.STATE_TRANSFER.handleViewChange(STATE_TRANSFER.java:293)
	at org.jgroups.protocols.pbcast.STATE_TRANSFER.up(STATE_TRANSFER.java:168)
	at org.jgroups.protocols.RSVP.up(RSVP.java:187)
	at org.jgroups.protocols.FRAG2.up(FRAG2.java:165)
	at org.jgroups.protocols.FlowControl.up(FlowControl.java:381)
	at org.jgroups.protocols.FlowControl.up(FlowControl.java:381)
	at org.jgroups.protocols.pbcast.GMS.castViewChange(GMS.java:574)
	at org.jgroups.protocols.pbcast.CoordGmsImpl.handleMembershipChange(CoordGmsImpl.java:219)
	at org.jgroups.protocols.pbcast.GMS$ViewHandler.process(GMS.java:1633)
	at org.jgroups.protocols.pbcast.GMS$ViewHandler.run(GMS.java:1587)
	at java.lang.Thread.run(Thread.java:724)

The issue seems to be related to this:

in STATE_TRANSFER, line 292-293:
Exception ex=new EOFException("state provider " + old_coord + " left");
            up_prot.up(new Event(Event.GET_STATE_OK, new StateTransferResult(ex)));
(buffer field is not set on event object)

after, in MessageDispatcher 567:
ByteArrayInputStream input=new ByteArrayInputStream(result.getBuffer());
causes NullPointer, since result.getBuffer() returns null.

A null-check here should resolve this issue, or an empty buffer could be set in STATE_TRANSFER class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list