gama-platform / gama

Main repository for developing the 2024+ versions of GAMA
https://gama-platform.org
GNU General Public License v3.0
26 stars 5 forks source link

[serialization] step back is broken on all models #246

Closed lesquoyb closed 1 month ago

lesquoyb commented 3 months ago

Describe the bug Trying the model Backward experiment formats.gaml I realised that the step back is not working anymore. In the eclipse console I have this error stack:

java.io.IOException: java.lang.NullPointerException: Cannot load from object array because the return value of "org.nustaq.serialization.FSTClazzInfo$FSTFieldInfo.getPossibleClasses()" is null
    at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:377)
    at org.nustaq.serialization.FSTConfiguration.asObject(FSTConfiguration.java:801)
    at gama.extension.serialize.binary.BinarySerialiser.restoreAgentFromBytes(BinarySerialiser.java:95)
    at gama.extension.serialize.binary.SimulationSerialiser.restore(SimulationSerialiser.java:95)
    at gama.core.kernel.experiment.ExperimentAgent.lambda$0(ExperimentAgent.java:994)
    at gama.core.runtime.GAMA.runAndUpdateAll(GAMA.java:575)
    at gama.core.kernel.experiment.ExperimentAgent.backward(ExperimentAgent.java:991)
    at gama.core.kernel.experiment.DefaultExperimentController.processUserCommand(DefaultExperimentController.java:106)
    at gama.core.kernel.experiment.AbstractExperimentController.lambda$0(AbstractExperimentController.java:63)
    at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: java.lang.NullPointerException: Cannot load from object array because the return value of "org.nustaq.serialization.FSTClazzInfo$FSTFieldInfo.getPossibleClasses()" is null
    at org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(FSTObjectInput.java:523)
    at org.nustaq.serialization.FSTObjectInput.readObjectInternal(FSTObjectInput.java:487)
    at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:447)
    at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:375)
    ... 9 more
Java error: I/O error
    at gama.core.runtime.exceptions.GamaRuntimeException.create(GamaRuntimeException.java:71)
    at gama.extension.serialize.binary.BinarySerialiser.restoreAgentFromBytes(BinarySerialiser.java:98)
    at gama.extension.serialize.binary.SimulationSerialiser.restore(SimulationSerialiser.java:95)
    at gama.core.kernel.experiment.ExperimentAgent.lambda$0(ExperimentAgent.java:994)
    at gama.core.runtime.GAMA.runAndUpdateAll(GAMA.java:575)
    at gama.core.kernel.experiment.ExperimentAgent.backward(ExperimentAgent.java:991)
    at gama.core.kernel.experiment.DefaultExperimentController.processUserCommand(DefaultExperimentController.java:106)
    at gama.core.kernel.experiment.AbstractExperimentController.lambda$0(AbstractExperimentController.java:63)
    at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: java.io.IOException: java.lang.NullPointerException: Cannot load from object array because the return value of "org.nustaq.serialization.FSTClazzInfo$FSTFieldInfo.getPossibleClasses()" is null
    at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:377)
    at org.nustaq.serialization.FSTConfiguration.asObject(FSTConfiguration.java:801)
    at gama.extension.serialize.binary.BinarySerialiser.restoreAgentFromBytes(BinarySerialiser.java:95)
    ... 7 more
Caused by: java.lang.NullPointerException: Cannot load from object array because the return value of "org.nustaq.serialization.FSTClazzInfo$FSTFieldInfo.getPossibleClasses()" is null
    at org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(FSTObjectInput.java:523)
    at org.nustaq.serialization.FSTObjectInput.readObjectInternal(FSTObjectInput.java:487)
    at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:447)
    at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:375)
    ... 9 more

To Reproduce Steps to reproduce the behavior:

  1. Go to Backward experiment formats.gaml
  2. run a step or more
  3. try to run a step back
  4. See that nothing happens

Expected behavior The simulation steps back as it used to

lesquoyb commented 3 months ago

I found one example of the same issue here seems like it could be related to threading issues as explained in the last message.

AlexisDrogoul commented 3 months ago

It is happening since https://github.com/gama-platform/gama/commit/91f15335e05c8219c2a50aba09ffe9fda5c4b772 in February 😄 guess not a lot of people are using it... It seems to be a distinct issue from the one described above. I will have a look at it.