joulupunikki / Phoenix

Java clone/remake/patch of the game Emperor of the Fading Suns
https://joulupunikki.github.io/Phoenix/
37 stars 14 forks source link

PBEM Game Stackoverflow during save #128

Open vogt31337 opened 4 years ago

vogt31337 commented 4 years ago

Hi,

just found this awesome game and tried to get everything compiled and running. Wasn't a big deal using Win10 and jdk13 (javax.annotation was missing and dependencies needed updating).

But saving doesn't work!

I just started a new game with pbem enabled (and it directly threw me into the game after setting only one password). After pressing end turn, the game crashed with a stackoverflow:

java.lang.StackOverflowError at java.base/java.util.zip.Deflater.ensureOpen(Deflater.java:896) at java.base/java.util.zip.Deflater.deflate(Deflater.java:566) at java.base/java.util.zip.Deflater.deflate(Deflater.java:465) at java.base/java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:251) at java.base/java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:211) at java.base/java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:146) at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1883) at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.write(ObjectOutputStream.java:1847) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1536) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179) ... omitted rest

happens in master branch Gui.java line 2081, s.writeobject. Seems like game has a reference to itself...

BR

mariomalnar commented 4 years ago

?? What game?

Mario s iphonea

On 15 Apr 2020, at 18:21, V3 notifications@github.com wrote:

 Hi,

just found this awesome game and tried to get everything compiled and running. Wasn't a big deal using Win10 and jdk13 (javax.annotation was missing and dependencies needed updating).

But saving doesn't work!

I just started a new game with pbem enabled (and it directly threw me into the game after setting only one password). After pressing end turn, the game crashed with a stackoverflow:

java.lang.StackOverflowError at java.base/java.util.zip.Deflater.ensureOpen(Deflater.java:896) at java.base/java.util.zip.Deflater.deflate(Deflater.java:566) at java.base/java.util.zip.Deflater.deflate(Deflater.java:465) at java.base/java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:251) at java.base/java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:211) at java.base/java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:146) at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1883) at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.write(ObjectOutputStream.java:1847) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1536) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179) ... omitted rest

happens in master branch Gui.java line 2081, s.writeobject. Seems like game has a reference to itself...

BR

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

vogt31337 commented 4 years ago

Emperor of the fading Suns, from which phoenix is derived?

vogt31337 commented 4 years ago

Also happens during a normal game, and also in the tagged released version :(

joulupunikki commented 4 years ago

It has been a while ... the newest release was made with java 8, which has seen the end of public updates sometime in 2019. The current java versions are 14 and 11 for LTS. It may well be that the code no longer works with newer java versions. I will have to check this.

vogt31337 commented 4 years ago

Go for it. I tried also not the latest master but the tagged release version, same problem. If I find some time, I'll try it with my old jdk8.

Main problem is during save of game.java. I think the serialization fails due to a circle reference. But since game.java is a large and very complex object it'll take me too much time to figure this out... Maybe I find a tool or something to help me out. Any ideas?

joulupunikki commented 4 years ago

The latest self contained 0.60 windows package on windows 10 seems to run just fine with end turn button pressed. Even if I start it with an external jdk 14 with java -Xss32m -jar Phoenix.jar. But jdk 14 seems to make a mess of the menubar.

vogt31337 commented 4 years ago

Hmm, I tried running from source code not the compiled package. I don't really see why this could be the issue.

But I tested using jdk8 to build and got the same error again. Maybe the two versions differ?