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

residual race condition in runtime reflection #8131

Closed
scabug opened this issue Jan 9, 2014 · 5 comments
Closed

residual race condition in runtime reflection #8131

scabug opened this issue Jan 9, 2014 · 5 comments

Comments

@scabug
Copy link

@scabug scabug commented Jan 9, 2014

sync-potpourri.check--- empty
+++ reflection-sync-potpourri-run.log
@@ -1,0 +1,35 @@
+Exception in thread "Reflector-117" scala.reflect.internal.FatalError: unsupported completer: Any {
+  def equals(x$1: Any): Boolean
+  def toString(): java.lang.String
+  def hashCode(): Int
+  def annotationType(): java.lang.Class[_ <: java.lang.annotation.Annotation]
+  def <init>(): java.lang.annotation.Annotation
+} of class class scala.reflect.internal.Types$ClassInfoType for symbol java.lang.annotation.Annotation
+	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:56)
+	at scala.reflect.internal.Symbols$class.shouldTriggerCompleter(Symbols.scala:65)
+	at scala.reflect.runtime.JavaUniverse.scala$reflect$runtime$SymbolTable$$super$shouldTriggerCompleter(JavaUniverse.scala:11)
+	at scala.reflect.runtime.SymbolTable$class.shouldTriggerCompleter(SymbolTable.scala:44)
+	at scala.reflect.runtime.JavaUniverse.shouldTriggerCompleter(JavaUniverse.scala:11)
+	at scala.reflect.internal.Symbols$Symbol.needsInitialize(Symbols.scala:1524)
+	at scala.reflect.internal.Symbols$Symbol.hasFlag(Symbols.scala:618)
+	at scala.reflect.internal.Symbols$TypeSymbol.newPrefix(Symbols.scala:2889)
+	at scala.reflect.internal.Symbols$TypeSymbol.newTypeRef(Symbols.scala:2890)
+	at scala.reflect.internal.Symbols$TypeSymbol.typeConstructor(Symbols.scala:2912)
+	at scala.reflect.internal.Symbols$SymbolContextApiImpl.toTypeConstructor(Symbols.scala:126)
+	at scala.reflect.internal.Symbols$TypeSymbol.toTypeConstructor(Symbols.scala:2838)
+	at Test$$anonfun$3$$typecreator2$1.apply(reflection-sync-potpourri.scala:14)
+	at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe$lzycompute(TypeTags.scala:231)
+	at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe(TypeTags.scala:231)
+	at scala.reflect.api.TypeTags$class.typeOf(TypeTags.scala:335)
+	at scala.reflect.api.Universe.typeOf(Universe.scala:61)
+	at Test$$anonfun$3.apply(reflection-sync-potpourri.scala:14)
+	at Test$$anonfun$3.apply(reflection-sync-potpourri.scala:14)
+	at Test$.force(reflection-sync-potpourri.scala:19)
+	at Test$$anonfun$6$$anon$1$$anonfun$7.apply(reflection-sync-potpourri.scala:26)
+	at Test$$anonfun$6$$anon$1$$anonfun$7.apply(reflection-sync-potpourri.scala:26)
+	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
+	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
+	at scala.collection.immutable.List.foreach(List.scala:302)
+	at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
+	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
+	at Test$$anonfun$6$$anon$1.run(reflection-sync-potpourri.scala:26)

The race condition stems from:

    protected def needsInitialize(isFlagRelated: Boolean, mask: Long) =
      !isInitialized && (flags & LOCKED) == 0 && shouldTriggerCompleter(this, if (infos ne null) infos.info else null, isFlagRelated, mask)
@scabug
Copy link
Author

@scabug scabug commented Jan 9, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8131?orig=1
Reporter: @retronym
Affected Versions: 2.11.0-M7
See #6240

@scabug
Copy link
Author

@scabug scabug commented Jan 10, 2014

@retronym said:
Another one:

 qbin/scalac test/files/run/reflection-sync-potpourri.scala && (for i in {1..100}; do parallel -j 50 qbin/scala -J-Xmx1G Test ::: {1..10} || break; printf . ;done)
......Exception in thread "Reflector-1" java.lang.AssertionError: assertion failed: class Codec
	at scala.Predef$.assert(Predef.scala:167)
	at scala.reflect.internal.Symbols$TypeSymbol.setTyconCache(Symbols.scala:2921)
	at scala.reflect.internal.Symbols$TypeSymbol.typeConstructor(Symbols.scala:2912)
	at scala.reflect.internal.Symbols$SymbolContextApiImpl.toTypeConstructor(Symbols.scala:126)
	at scala.reflect.internal.Symbols$TypeSymbol.toTypeConstructor(Symbols.scala:2838)
	at Test$$anonfun$5$$typecreator4$1.apply(reflection-sync-potpourri.scala:16)
	at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe$lzycompute(TypeTags.scala:231)
	at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe(TypeTags.scala:231)
	at scala.reflect.api.TypeTags$class.typeOf(TypeTags.scala:335)
	at scala.reflect.api.Universe.typeOf(Universe.scala:61)
	at Test$$anonfun$5.apply(reflection-sync-potpourri.scala:16)
	at Test$$anonfun$5.apply(reflection-sync-potpourri.scala:16)
	at Test$.force(reflection-sync-potpourri.scala:19)
	at Test$$anonfun$6$$anon$1$$anonfun$7.apply(reflection-sync-potpourri.scala:26)
	at Test$$anonfun$6$$anon$1$$anonfun$7.apply(reflection-sync-potpourri.scala:26)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
	at scala.collection.immutable.List.foreach(List.scala:302)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at Test$$anonfun$6$$anon$1.run(reflection-sync-potpourri.scala:26)

@scabug
Copy link
Author

@scabug scabug commented Jan 10, 2014

@retronym said:
Another:

Exception in thread "Reflector-4" java.lang.NullPointerException
	at Test$.force(reflection-sync-potpourri.scala:19)
	at Test$$anonfun$6$$anon$1$$anonfun$7.apply(reflection-sync-potpourri.scala:26)
	at Test$$anonfun$6$$anon$1$$anonfun$7.apply(reflection-sync-potpourri.scala:26)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
	at scala.collection.immutable.List.foreach(List.scala:302)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at Test$$anonfun$6$$anon$1.run(reflection-sync-potpourri.scala:26)

@scabug
Copy link
Author

@scabug scabug commented Jan 10, 2014

@retronym said:
Moving the test to pending until we sort this out: scala/scala#3350

@scabug
Copy link
Author

@scabug scabug commented Jan 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants