Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack overflow error (omg programming reference?!?) #173

Closed
2 tasks done
TheGamer1002 opened this issue Jan 29, 2023 · 10 comments
Closed
2 tasks done

stack overflow error (omg programming reference?!?) #173

TheGamer1002 opened this issue Jan 29, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@TheGamer1002
Copy link

Platform: macOS 13 Ventura (yeah i know)

Build: 141.3

Mod Version: 1.09

Issue: literally just crashes (foregoing the error template because i know code [hopefully])

Mindustry has crashed. How unfortunate.
Version: release build 141.3
OS: Mac OS X x64 (x86_64)
Java Version: 1.8.0_361
Runtime Available Memory: 1820mb
Cores: 4
Mods: adc:15.0, betamindy:1.09, cyber-io:5.1, exogenesis:[blue]1.9.1, fooinstaller:1.2.4, informatis:1.7, me:2.1, new-horizon:0.2.7, ol:0.6f, pictologic:1.6.0, prog-mats:26.6, revision:13.3, rtfm:3.15.1, schematics-pack:9, scheme-size:2.7.34, shar:0.2v, time-control:0.2, uaw:v0.8.3, unity:0.2-youngcha.3.3, ui-lib:4.18.0

java.lang.RuntimeException: Error loading mod betamindy
	at mindustry.mod.Mods.contextRun(Mods.java:773)
	at mindustry.mod.Mods.lambda$eachClass$30(Mods.java:761)
	at arc.struct.Seq.each(Seq.java:182)
	at mindustry.mod.Mods.eachClass(Mods.java:761)
	at mindustry.ClientLauncher.update(ClientLauncher.java:215)
	at arc.backend.sdl.SdlApplication.listen(SdlApplication.java:204)
	at arc.backend.sdl.SdlApplication.loop(SdlApplication.java:192)
	at arc.backend.sdl.SdlApplication.<init>(SdlApplication.java:54)
	at mindustry.desktop.DesktopLauncher.main(DesktopLauncher.java:39)
Caused by: java.lang.StackOverflowError
	at betamindy.util.UnitLib.calcCost(UnitLib.java:66)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)
	at betamindy.util.UnitLib.calcCost(UnitLib.java:71)

this goes on for a while uh like hundreds of lines

this is the line in question


Place an X (no spaces) between the brackets to confirm that you have read the line below.

  • I have searched the closed and open issues to make sure that this problem has not already been reported.
  • I have updated to the latest release (https://github.com/sk7725/BetaMindy/releases) to make sure my issue has not been fixed.

The original template is by Anuke, modified by sk7725.

@TheGamer1002 TheGamer1002 added the bug Something isn't working label Jan 29, 2023
@TheGamer1002
Copy link
Author

the line references itself what the heck

public static ItemStack[] calcCost(UnitType u){
...
for(Reconstructor b : recons){
...
if(r != null){
ItemStack[] cost = calcCost(r[0]);
...
}
...
}

so like

@TheGamer1002
Copy link
Author

might add this was on startup of the game

@TheGamer1002
Copy link
Author

am i just using the wrong version of java

@TheGamer1002
Copy link
Author

the code is 18 months old what

@TheGamer1002
Copy link
Author

so i think a different mod is doing this but its still probably not good practice to call something inside itself

@TheGamer1002
Copy link
Author

okay this happens in other places #166

@Weathercold
Copy link

so i think a different mod is doing this but its still probably not good practice to call something inside itself

recursion is good practice
people hated recursion because they hate concepts they don't understand

@Slotterleet
Copy link

recursive methods are pretty good as long as you know what you're doing

@TheGamer1002
Copy link
Author

i mean yeah, that sounds about right. i dont know what im doing.
but like shouldnt there be a thing to prevent the recursiveness? because i dont know how but a different mod somehow interfaced with this mod

@TheGamer1002
Copy link
Author

im just gonna close this because im stupid and opened this issue on 3 hours of sleep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants