StackOverflowError with pumps

If you're having problems with your installation of Better Than Wolves, or if you've woken up in the future and are beginning to doubt the nature of reality, here's the place to post about it.
Locked
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

StackOverflowError with pumps

Post by Magnavode »

I'm getting the occasional crash when messing around with the new pumps and I'm wondering if anyone else is getting it. I have the pumps spread out in a channel with 8 blocks between them. While the pumps feed the next pump in the line, they also feed into themselves (though fc would have thought of that). They also seem turn on and off at random, this might be a feature, though this wasn't mentioned on the wiki.

No other mods installed, only btw. Installed with mcpatcher.
Spoiler
Show
---- Minecraft Crash Report ----
// My bad.

Time: 18-9-12 20:19
Description: Exception in server tick loop

java.lang.StackOverflowError
at if.b(SourceFile:53)
at gq.a(ChunkProviderServer.java:42)
at up.c(World.java:407)
at up.c(World.java:392)
at FCBlockScrewPump.DoesWaterHaveValidSource(FCBlockScrewPump.java:461) //note: 461 is unique
at FCBlockScrewPump.DoesWaterHaveValidSourceWithSourceCheck(FCBlockScrewPump.java:611)
at FCBlockScrewPump.DoesWaterHaveValidSource(FCBlockScrewPump.java:486)
at FCBlockScrewPump.DoesWaterHaveValidSourceWithSourceCheck(FCBlockScrewPump.java:611)
at FCBlockScrewPump.DoesWaterHaveValidSource(FCBlockScrewPump.java:544)
at FCBlockScrewPump.DoesWaterHaveValidSourceWithSourceCheck(FCBlockScrewPump.java:611)
at FCBlockScrewPump.DoesWaterHaveValidSource(FCBlockScrewPump.java:582)
at FCBlockScrewPump.DoesWaterHaveValidSourceWithSourceCheck(FCBlockScrewPump.java:611)
at FCBlockScrewPump.DoesWaterHaveValidSource(FCBlockScrewPump.java:486)
at FCBlockScrewPump.DoesWaterHaveValidSourceWithSourceCheck(FCBlockScrewPump.java:611)
at FCBlockScrewPump.DoesWaterHaveValidSource(FCBlockScrewPump.java:544)
at FCBlockScrewPump.DoesWaterHaveValidSourceWithSourceCheck(FCBlockScrewPump.java:611)
at FCBlockScrewPump.DoesWaterHaveValidSource(FCBlockScrewPump.java:582)
at FCBlockScrewPump.DoesWaterHaveValidSourceWithSourceCheck(FCBlockScrewPump.java:611)
ad infinum

Relevant Details:
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (x86) version 6.1
- Java Version: 1.7.0_07, Oracle Corporation
- Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
- Memory: 253359552 bytes (241 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
- JVM Flags: 2 total; -Xms512m -Xmx1024m
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_FCBetterThanWolves 4.12

- Is Modded: Very likely
- Profiler Position: N/A (disabled)
- Player Count: 1 / 8; [gu['TurboSlow'/15309282, l='Survival 3', x=-227,35, y=68,00, z=-47,12]]
- World Survival 3 Entities: 0 total; []
- World Survival 3 Players: 0 total; []
- World Survival 3 Chunk Stats: ServerChunkCache: 0 Drop: 0
- Type: Integrated Server
Dwarg91
Posts: 38
Joined: Tue Sep 11, 2012 11:42 am

Re: StackOverflowError with pumps

Post by Dwarg91 »

Could you also give us a pic of your build? Because it seems like this has to do with how your pumps are getting there water. If they have no protection from feedback the checks that they do will cause minecraft to crash since there water source would be simultaneously valid and invalid.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: StackOverflowError with pumps

Post by FlowerChild »

Magnavode wrote:(though fc would have thought of that).
...
Magnavode wrote:They also seem turn on and off at random, this might be a feature, though this wasn't mentioned on the wiki.
Genius.
Dwarg91 wrote:Could you also give us a pic of your build? Because it seems like this has to do with how your pumps are getting there water. If they have no protection from feedback the checks that they do will cause minecraft to crash since there water source would be simultaneously valid and invalid.
Ummmm...wtf? Would you care to explain where you got the above extremely dangerous assumption from?

Don't get me wrong, this very well may be a bug in the recursive checking I do for valid water sources, but really...you're just spouting off complete bullshit with the above.
Dwarg91
Posts: 38
Joined: Tue Sep 11, 2012 11:42 am

Re: StackOverflowError with pumps

Post by Dwarg91 »

Ah sorry was thinking of it kind of like audio, obviously it's not like that if you said extremely dangerous assumption. Though pics of the build might still give insight as to the problem, at least to you.
Once again Sorry FlowerChild for my dangerous, uninformed thoughts.
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: StackOverflowError with pumps

Post by Magnavode »

FlowerChild wrote:...
'fc would have thought of that' as in 'fc would have thought of the feedback loop that would occur when the pump feeds back into itself when the player turns on the pump, making the game crash.'
FlowerChild wrote:Genius.
Care to explain? I know the wiki isn't the end all awnser to everything secret about the mod. What I'm really saying there is that I've searched for solutions to this problem and the pumps deactivating might be related to it. So it's either a feature or the pumps are deactivating because it's not recognizing itself as a valid watersource.

Image
Last edited by Magnavode on Tue Sep 18, 2012 3:37 pm, edited 2 times in total.
Dwarg91
Posts: 38
Joined: Tue Sep 11, 2012 11:42 am

Re: StackOverflowError with pumps

Post by Dwarg91 »

Yea Magnavode, no matter what you need to isolate the pumps inputs from there outputs to get a steady flow without interrupts.
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: StackOverflowError with pumps

Post by Magnavode »

Dwarg91 wrote:Yea Magnavode, no matter what you need to isolate the pumps inputs from there outputs to get a steady flow without interrupts.
That's not what I'm asking, but thanks for the help.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: StackOverflowError with pumps

Post by FlowerChild »

The Pumps are powering down periodically BECAUSE I anticipated that kind of exploit, and shut down the pump when it's feeding back into itself. That's what was genius about your initial statement.

Now, it appears that you've created some kind of infinite loop which is causing the code that handles that to cause a stack overflow...which is bad, and is probably a problem on my end.
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: StackOverflowError with pumps

Post by Magnavode »

Needless to say it's not immediately obvious what's going on when the pump does deactivate.

glhf fixing the error. If you need any information/ pictures/ worldfile just let me know.

Also, if it's of any use, the crash doesn't occur immediately. It happens after a long play session.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: StackOverflowError with pumps

Post by FlowerChild »

Magnavode wrote:Needless to say it's not immediately obvious what's going on when the pump does deactivate.
You try to cheat, and your pump stops working. How obvious does it need to be?
User avatar
Graphite
Posts: 390
Joined: Sun Mar 18, 2012 3:12 am

Re: StackOverflowError with pumps

Post by Graphite »

FlowerChild wrote:You try to cheat, and your pump stops working. How obvious does it need to be?
"don't attribute to malice what can be explained by ignorance"

From the looks of that aquaduct, he just wanted to make it as 'lightweight' as possible. Probably figured the water overflowing on both sides was harmless even as it did save him from putting some unseemly blocks in the way of the backward flow.
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: StackOverflowError with pumps

Post by Magnavode »

FlowerChild wrote:
Magnavode wrote:Needless to say it's not immediately obvious what's going on when the pump does deactivate.
You try to cheat, and your pump stops working. How obvious does it need to be?
It's not direct feedback. If you connect 4 axles to a powered gearbox, it breaks off. If you throw 8 ground nether rack into an unpowered hopper it breaks and a ghast spawns. If you try to make concentrated hellfire, but forgot to turn off the bellows you get scarred for life. If you let a pump feed back into itself it powers down... every now and then.
Graphite wrote:"don't attribute to malice what can be explained by ignorance"

From the looks of that aquaduct, he just wanted to make it as 'lightweight' as possible. Probably figured the water overflowing on both sides was harmless even as it did save him from putting some unseemly blocks in the way of the backward flow.
Yes, my intention was not to create infinite water, but to have a trench of water.
here's the full design:
Spoiler
Show
Image
Last edited by Magnavode on Tue Sep 18, 2012 4:26 pm, edited 2 times in total.
User avatar
Sarudak
Site Admin
Posts: 2786
Joined: Thu Nov 24, 2011 7:59 pm

Re: StackOverflowError with pumps

Post by Sarudak »

It is kinda a funny edge case because it's being fed by a valid source but it's also feeding back onto itself. Sure he could fix the feedback but intuitively it's hard to explain why he should need to. The stopping and starting thing is confusing too possibly resulting from the pump shutting down when it detects feedback then trying to start up again once the feedback is gone and the original (valid) source is detected again.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: StackOverflowError with pumps

Post by FlowerChild »

Instant feedback is not possible in this case, because to detect such circumstances requires some VERY performance intensive code.

The only way I can get around that is to stagger the tests and only do them periodically.

And sorry man, but no, I will not shed a tear for inconveniencing those attempting to use exploits by not providing them with instantaneous feedback about whether they've pulled it off or not. As mentioned above, you probably weren't trying to cheat in this case, as all it would take is an extra stone block at each of your pumping points for your build to be legit, but is it really surprising that a pump will eventually shut down if it's feeding back into itself?
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: StackOverflowError with pumps

Post by Magnavode »

Well I guess it's sufficient feedback. I would have gotten it eventually. And Minecraft is one of those games where you have to switch over to the wiki every now and then. But hey, I'm not the one that has to reply to all those 'hey fc, my pumps don't work' messages.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: StackOverflowError with pumps

Post by FlowerChild »

Magnavode wrote:Well I guess it's sufficient feedback. I would have gotten it eventually. And Minecraft is one of those games where you have to switch over to the wiki every now and then. But hey, I'm not the one that has to reply to all those 'hey fc, my pumps don't work' messages.
Yours is literally the first, so no, it's not a problem. Everyone else seems to have figured it out just fine.

Thanks for pointing out the stack overflow though. I'll get right to fixing that.
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: StackOverflowError with pumps

Post by Magnavode »

FlowerChild wrote:Yours is literally the first, so no, it's not a problem. Everyone else seems to have figured it out just fine.

Thanks for pointing out the stack overflow though. I'll get right to fixing that.
I doubt I'll be the last. My own mod recently got reviewed by Antvenom and all of his fanboys were suggesting a feature that was already in the mod but wasn't covered by Antvenom's review, all because they were to lazy to open a menu and see what's in there. So I know how annoying repeatedly getting asked the same questions can be.

Also I wouldn't have posted if I didn't have the crash. It's not about why the pumps stopped working, it's about the stackoverflowerror

lock plox
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: StackOverflowError with pumps

Post by FlowerChild »

Out of curiosity, which mod is yours?
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: StackOverflowError with pumps

Post by Magnavode »

Woo! pluggin my own mod on flowerchild's forum! The Advanced Hud mod

here's the link to Antvenom's modreview: http://www.youtube.com/watch?v=qhYXChsBrxE
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: StackOverflowError with pumps

Post by FlowerChild »

Huh. Neat mod man :)

And yeah, plugging other mods isn't allowed on these forums, but I was curious, and I don't consider somebody mentioning their mod once to be "plugging" ;)
User avatar
Magnavode
Posts: 42
Joined: Fri Sep 14, 2012 6:51 pm

Re: StackOverflowError with pumps

Post by Magnavode »

Thank you, that means a lot coming from the guy who made Minecraft fun again.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: StackOverflowError with pumps

Post by FlowerChild »

Magnavode wrote:Thank you, that means a lot coming from the guy who made Minecraft fun again.
Well, it's a good idea and seems very well implemented from the video I watched, so props are definitely deserved man :)
Locked