SimEthereal StateCollector Error

Hello Everyone,

Was doing some network testing tonight and one of my players managed to basically crash the server with the below error. It was busy dumping these runtimeexceptions and driving my collect underflow FPS to 0. When he disconnected the server recovered. What are my options for dealing with this more gracefully?

21:03:57,343 ERROR [StateCollector] Collection error
java.lang.RuntimeException: Error splitting message. split:0 limit:-864
        at com.simsilica.ethereal.net.FrameState.split(FrameState.java:111) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.net.StateWriter.endFrame(StateWriter.java:327) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.net.StateWriter.startFrame(StateWriter.java:191) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.NetworkStateListener.endFrame(NetworkStateListener.java:283) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector.publishFrame(StateCollector.java:226) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector.collect(StateCollector.java:258) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector$Runner.run(StateCollector.java:313) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
21:03:57,596 ERROR [StateCollector] Collection error
java.lang.RuntimeException: Error splitting message. split:0 limit:-256
        at com.simsilica.ethereal.net.FrameState.split(FrameState.java:111) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.net.StateWriter.endFrame(StateWriter.java:327) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.net.StateWriter.startFrame(StateWriter.java:191) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.NetworkStateListener.endFrame(NetworkStateListener.java:283) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector.publishFrame(StateCollector.java:226) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector.collect(StateCollector.java:258) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector$Runner.run(StateCollector.java:313) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
collect underflow FPS:0
21:03:57,645 ERROR [StateCollector] Collection error
java.lang.RuntimeException: Error splitting message. split:0 limit:-256
        at com.simsilica.ethereal.net.FrameState.split(FrameState.java:111) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.net.StateWriter.endFrame(StateWriter.java:327) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.net.StateWriter.startFrame(StateWriter.java:191) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.NetworkStateListener.endFrame(NetworkStateListener.java:283) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector.publishFrame(StateCollector.java:226) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector.collect(StateCollector.java:258) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector$Runner.run(StateCollector.java:313) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
21:03:57,695 ERROR [StateCollector] Collection error
java.lang.RuntimeException: Error splitting message. split:0 limit:-256
        at com.simsilica.ethereal.net.FrameState.split(FrameState.java:111) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.net.StateWriter.endFrame(StateWriter.java:327) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.net.StateWriter.startFrame(StateWriter.java:191) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.NetworkStateListener.endFrame(NetworkStateListener.java:283) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector.publishFrame(StateCollector.java:226) ~[sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector.collect(StateCollector.java:258) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]
        at com.simsilica.ethereal.zone.StateCollector$Runner.run(StateCollector.java:313) [sim-ethereal-1.2.1-SNAPSHOT.jar:?]

Thanks, Mithrin

Thanks for reporting the error. I’ll have to look into it more detail to figure out what’s going on… and unfortunately I’m slammed trying to get some day-job stuff done before Monday.

How many users did you have one and how many objects were moving around?

It is possible to turn splitting off completely, basically… but this error actually might indicate other problems. I really would like to drill in and fix it when I have the time again.

Turning splitting off is currently per-connection only, though… so not entirely straight forward. If you have the HostedConnection then you can get its NetworkStateListener from the EtherealHost. From there you can call setMaxMessageSize() to something super large.

http://simsilica.github.io/SimEthereal/javadoc/com/simsilica/ethereal/EtherealHost.html#getStateListener(com.jme3.network.HostedConnection)
http://simsilica.github.io/SimEthereal/javadoc/com/simsilica/ethereal/NetworkStateListener.html#setMaxMessageSize(int)

It was 3 total players, myself and 2 other connections. There was at maximum 50 entities ingame. 16 are models, so they don’t move. 16 of them rarely move (player has to pick them up and move them) the rest would be bullets and explosions. Bullets are missiles so they move fairly rapidly.

Ah ok, that makes sense … I’d really rather not disable message splitting though if I can help it. I’ll do some further testing and see how easy this error is to replicate. Then I can hopefully provide some more information.

Thanks, Mithrin

Hello pspeed,

I believe I have located the reason this error starts appearing.

It starts happening for certain when a player turns on a ‘speed hack’ type piece of software. My current hypothesis is that they flood the connection with messages. Which in this case allows them to basically DoS the server. I believe it is also possible when someone turns off vsync and has a high frame rate but I’m am testing that still.

Mithrin

Yes, if you’ve taken the code from the demos then they are not very bullet proof with respect to frame rate and such. For the sim-eth examples, I’m not sure how a speed hack would affect the network messaging, though… since input is just setting booleans basically. But if the frame rate is high I guess we could be sending control messages more often.