-
Notifications
You must be signed in to change notification settings - Fork 323
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
Enabling structural equality for MetadataStorage again #11012
Enabling structural equality for MetadataStorage again #11012
Conversation
@@ -214,7 +214,7 @@ public boolean equals(Object obj) { | |||
return true; | |||
} | |||
if (obj instanceof MetadataStorage other) { | |||
return this.metadata == other.metadata; | |||
return Objects.equals(this.metadata, other.metadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change alone is causing StackOverflowError
in IR.duplicate()
, @hubertp, please try to make just this change and check if you get the StackOverflowError
as well. If so, do you have any idea how to prevent it?
"main"
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:529)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:473)
at org.enso.compiler.pass.resolve.TypeSignatures$Signature.duplicate(TypeSignatures.scala:351)
at org.enso.compiler.core.ir.MetadataStorage.duplicate(MetadataStorage.java:95)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:529)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:473)
at org.enso.compiler.pass.resolve.TypeSignatures$Signature.duplicate(TypeSignatures.scala:351)
at org.enso.compiler.core.ir.MetadataStorage.duplicate(MetadataStorage.java:95)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:529)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:473)
at org.enso.compiler.pass.resolve.TypeSignatures$Signature.duplicate(TypeSignatures.scala:351)
at org.enso.compiler.core.ir.MetadataStorage.duplicate(MetadataStorage.java:95)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:529)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:473)
at org.enso.compiler.pass.resolve.TypeSignatures$Signature.duplicate(TypeSignatures.scala:351)
at org.enso.compiler.core.ir.MetadataStorage.duplicate(MetadataStorage.java:95)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:529)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:473)
at org.enso.compiler.pass.resolve.TypeSignatures$Signature.duplicate(TypeSignatures.scala:351)
at org.enso.compiler.core.ir.MetadataStorage.duplicate(MetadataStorage.java:95)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:529)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:473)
at org.enso.compiler.pass.resolve.TypeSignatures$Signature.duplicate(TypeSignatures.scala:351)
at org.enso.compiler.core.ir.MetadataStorage.duplicate(MetadataStorage.java:95)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:529)
at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:473)
at org.enso.compiler.core.ir.DefinitionArgument$Specified.duplicate(DefinitionArgument.scala:159)
at org.enso.compiler.core.ir.DefinitionArgument$Specified.duplicate(DefinitionArgument.scala:56)
at org.enso.compiler.core.ir.module.scope.Definition$Data.$anonfun$duplicate$2(Definition.scala:246)
at org.enso.compiler.core.ir.module.scope.Definition$Data$$Lambda/0x00007b79305fee10.apply
at scala.collection.immutable.List.map(List.scala:246)
at org.enso.compiler.core.ir.module.scope.Definition$Data.duplicate(Definition.scala:242)
at org.enso.compiler.core.ir.module.scope.Definition$Type.$anonfun$duplicate$1(Definition.scala:111)
at org.enso.compiler.core.ir.module.scope.Definition$Type$$Lambda/0x00007b79305fea50.apply
at scala.collection.immutable.List.map(List.scala:246)
at org.enso.compiler.core.ir.module.scope.Definition$Type.duplicate(Definition.scala:107)
at org.enso.compiler.core.ir.module.scope.Definition$Type.duplicate(Definition.scala:56)
at org.enso.compiler.core.ir.Module.$anonfun$duplicate$2(Module.scala:123)
at org.enso.compiler.core.ir.Module$$Lambda/0x00007b79305fe690.apply
at scala.collection.immutable.List.map(List.scala:250)
at org.enso.compiler.core.ir.Module.duplicate(Module.scala:119)
at org.enso.interpreter.runtime.TruffleCompilerContext.serializeModule(TruffleCompilerContext.java:359)
at org.enso.compiler.Compiler.$anonfun$runCompilerPipeline$14(Compiler.scala:433)
at org.enso.compiler.Compiler$$Lambda/0x00007b79305d1bd8.apply
at scala.collection.immutable.List.foreach(List.scala:333)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Disable check for equals when two objects collide #11015 has been proposed as a short term fix for August release until the
StackOverflowError
& other problems are resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With 6f93f4e the StackOverflowError
shall disappear. Unless it doesn't:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid
has introduced cycles in the IR graph - TypeSignatures
metadata may probably point to Name.Literal
that points back to the TypeSignatures
metadata. CCing @radeusgd
Otherwise I cannot explain to myself why there is StackOverflowError
processing a finite tree-like structure.
We have cycles in the |
Pull Request Description
Fixes #10985 and #11004 by enabling structural equality for
MetadataStorage
again.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,