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

ConcurrentModificationException on editor update of dynamic language that is currently built #133

Open
AZWN opened this issue Apr 16, 2024 · 0 comments
Labels
C-Bug Category: bug. Not working as expected

Comments

@AZWN
Copy link
Contributor

AZWN commented Apr 16, 2024

Summary

When rebuilding a language, and triggering an editor update at the same time, a ConcurrentModificationException exception is thrown.

What you did

  1. Import some language in Spoofax
  2. Create a file in that language
  3. Make some changes to the language definition
  4. Rebuild the language
  5. While the rebuild in in progress, change the object language file

What you expected to happen

The editor update job should wait until the language is rebuilt (or perhaps use the old language definition)

What actually happened

A ConcurrentModificationException exception is thrown

Context

  • Spoofax version: 0.19.6
  • Operating system & version: MacOs
  • Java version (if applicable): Java 11

Additional information

Stacktrace:

java.util.ConcurrentModificationException
	at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1511)
	at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1544)
	at java.base/java.util.HashMap$EntryIterator.next(HashMap.java:1542)
	at org.nustaq.serialization.serializers.FSTMapSerializer.writeObject(FSTMapSerializer.java:44)
	at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:476)
	at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:369)
	at org.nustaq.serialization.FSTObjectOutput.writeObjectFields(FSTObjectOutput.java:664)
	at org.nustaq.serialization.FSTObjectOutput.defaultWriteObject(FSTObjectOutput.java:546)
	at org.nustaq.serialization.FSTObjectOutput.writeObjectWithContext(FSTObjectOutput.java:458)
	at org.nustaq.serialization.FSTObjectOutput.writeObjectInternal(FSTObjectOutput.java:327)
	at org.nustaq.serialization.FSTObjectOutput.writeObject(FSTObjectOutput.java:294)
	at mb.pie.serde.fst.FstSerde.serialize(FstSerde.java:35)
	at mb.pie.runtime.store.SerializingStore.serialize(SerializingStore.java:86)
	at mb.pie.runtime.store.SerializingStore.close(SerializingStore.java:80)
	at mb.pie.runtime.PieImpl.close(PieImpl.java:79)
	at mb.pie.dagger.PieComponent.close(PieComponent.java:49)
	at mb.spoofax.core.component.ComponentImpl.close(ComponentImpl.java:59)
	at mb.spoofax.lwb.dynamicloading.component.DynamicComponent.close(DynamicComponent.java:67)
	at mb.spoofax.lwb.dynamicloading.component.DynamicComponentManagerImpl.loadOrReloadFromCompiledSources(DynamicComponentManagerImpl.java:271)
	at mb.spoofax.lwb.dynamicloading.DynamicLoad.run(DynamicLoad.java:116)
	at mb.spoofax.lwb.dynamicloading.DynamicLoad.lambda$exec$0(DynamicLoad.java:93)
	at mb.common.option.Option.mapOrElse(Option.java:146)
	at mb.common.result.Result.flatMap(Result.java:417)
	at mb.spoofax.lwb.dynamicloading.DynamicLoad.exec(DynamicLoad.java:93)
	at mb.spoofax.lwb.dynamicloading.DynamicLoad.exec(DynamicLoad.java:28)
	at mb.pie.api.Task.exec(Task.java:56)
	at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:130)
	at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:87)
	at mb.pie.runtime.exec.BottomUpRunner.exec(BottomUpRunner.java:419)
	at mb.pie.runtime.exec.BottomUpRunner.execAndSchedule(BottomUpRunner.java:132)
	at mb.pie.runtime.exec.BottomUpRunner.execScheduled(BottomUpRunner.java:119)
	at mb.pie.runtime.exec.BottomUpRunner.requireInitial(BottomUpRunner.java:82)
	at mb.pie.runtime.MixedSessionImpl.lambda$updateAffectedBy$0(MixedSessionImpl.java:72)
	at mb.pie.runtime.SessionImpl.handleException(SessionImpl.java:233)
	at mb.pie.runtime.MixedSessionImpl.updateAffectedBy(MixedSessionImpl.java:72)
	at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilder.bottomUpBuild(SpoofaxLwbBuilder.java:132)
	at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilderBase.incrBuild(SpoofaxLwbBuilderBase.java:88)
	at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilderBase$1.run(SpoofaxLwbBuilderBase.java:59)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
	at mb.spoofax.lwb.eclipse.SpoofaxLwbBuilderBase.build(SpoofaxLwbBuilderBase.java:68)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:846)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:229)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:277)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:330)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:333)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:385)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:406)
	at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:515)
	at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:405)
	at org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:180)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
@AZWN AZWN added the C-Bug Category: bug. Not working as expected label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Category: bug. Not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant