Skip to content

WebSocket frame decoding fails if first 2 bytes are received in separate data frames #22

@Anisotrop

Description

@Anisotrop

Use this branch to reproduce the issue:

  • build the spec project locally
  • change this project's pom.xml to use the develop-SNAPSHOT version of the spec
  • run the test BaseFramingIT.shouldEchoBinaryFrameWithPayloadLength125

The test fails with exceptions:

org.junit.ComparisonFailure: Specified behavior did not match  <Click to see difference>


	at org.junit.Assert.assertEquals(Assert.java:115)
	at org.kaazing.k3po.junit.rules.SpecificationStatement.evaluate(SpecificationStatement.java:132)
	at org.junit.rules.Verifier$1.evaluate(Verifier.java:35)
	at org.reaktivity.reaktor.test.ReaktorRule$1.evaluate(ReaktorRule.java:212)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:54)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


java.lang.IllegalStateException: Buffer pool has unreleased slots: 1

	at org.reaktivity.reaktor.Reaktor$1.onClose(Reaktor.java:150)
	at org.agrona.concurrent.AgentRunner.close(AgentRunner.java:182)
	at org.reaktivity.reaktor.Reaktor.close(Reaktor.java:197)
	at org.reaktivity.reaktor.test.ReaktorRule$1.evaluate(ReaktorRule.java:222)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:54)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

The incoming data seems wrongly accumulating into the bufferPool when the first 2 bytes of the header are not received in the same data frame. Should confirm that the mask is not correctly read. Should also check the logic of the release of the accumulation buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions