symat commented on issue #1300: ZOOKEEPER-3769: handling malformed Leader 
Election notification messages
URL: https://github.com/apache/zookeeper/pull/1300#issuecomment-605597388
 
 
   I saw two kinds of exceptions, related to this problem. (if I remember 
correctly, the stack traces were gathered on 3.5.7)
   
   ```
   03/24/20 11:16:16,297 [WorkerReceiver[myid=1]] ERROR 
[org.apache.zookeeper.server.NIOServerCnxnFactory] 
(NIOServerCnxnFactory.java:92) - Thread Thread[WorkerReceiver[myid=1],5,main] 
died
   
   java.nio.BufferUnderflowException: null
        at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:178) ~[?:?]
        at java.nio.ByteBuffer.get(ByteBuffer.java:762) ~[?:?]
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerReceiver.run(FastLeaderElection.java:278)
 ~[zookeeper-3.5.7.jar:3.5.7]        
   ```
   And an other case (this can happen when wrong protocol format is expected 
due to the wrong message size):
   ```
   03/23/20 10:14:46,127 [WorkerReceiver[myid=1]] ERROR 
[org.apache.zookeeper.server.NIOServerCnxnFactory] 
(NIOServerCnxnFactory.java:92) - Thread Thread[WorkerReceiver[myid=1],5,main] 
died
   java.lang.NegativeArraySizeException: -1082130432
        at 
org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerReceiver.run(FastLeaderElection.java:276)
 ~[zookeeper-3.5.7.jar:3.5.7]
        at java.lang.Thread.run(Thread.java:835) ~[?:?]
   ```
   
   I was able to reproduce these errors with the unit tests I created. But 
unfortunately I am not able to reproduce the problem with real ZooKeeper.
   
   Lasaro Camargos (who reported the issue) said that the error happened both 
with NIO and Netty.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to