Create

Create

86M Downloads

Server crashes when connecting two shafts rotating in opposite directions

NikZapp opened this issue · 9 comments

commented

My contraption was about to get to the stress limit, so i tried to add another windmill.
I connected a motor to stop the current windmill for a moment. The motor broke because it was rotating in the opposite direction so i placed a gearbox in between. Then after i placed the motor the server crashed with this crash log:
[https://mclo.gs/vtJeVbB]

It happened 3 times and i hope the problem will get fixed soon.

commented

Turns out it crashes even with two shafts having the same rotation and speed.

commented

To stop your windmill just turn off the Redstone Signal on the bearing.

commented

I know, the problem is not that i am unable to stop the windmill. The problem is that the server crashes every day because of the same problem of two rotation sources.

commented

I know. Just wanted to let you know that you can’t stop a windmill using a motor.

commented

I replaced it, not stopped.

commented

Yes but i don't think i have any loops in the factory.

commented

I had a similar problem, here is the crash log: https://paste.ee/p/qb9f4
I think I pinned down why it happens, or at least when:
When you have two networks, with a slower network on a rotation speed controller (meaning you force the cog above to be set at a given speed), and you connect the two, the propagateNewSource method fails to overpower the slower network and seems to be stuck in an infinite recursive call...

you can test that pretty easily by connecting one motor to a rotation speed controller, set the rotation speed controller to 12RPM for example, put a large cog on top, have another motor set to 16RPM for example, and connect the 16RPM motor to the 12RPM cog with a shaft. This causes the infinite recursion and then the stack overflow.
I looked a bit at how the propagateNewSource does it's magic, and indeed it seems like it's trying to overpower a network as the first recursive call is in the overpower part of the method. I can't really figure out more as I haven't dug that deep into the code but probably a bad stopping condition.

Edit: when you reload the world, the shaft you placed is there, it is rotating at 16RPM, but the gear above the rotation speed controller is rotating at 12RPM, meaning you have a shaft touching a gear but they are both at different speeds....

also when changing the rotation speed controller settings (clarification: after reloading the save), if you change it to something else than 16RPM, the game crashes too, seems like it's the same thing happening as the crash logs are nearly identical.

commented

doesn't need to be a loop! the code loops, doesn't mean the circuit has to be a loop

commented

This issue has been addressed in 0.2.3. Thanks for the report and feel free to re-open if need be.