Scala Programming Language
  1. Scala Programming Language
  2. SI-8131

residual race condition in runtime reflection

    Details

      Description

      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)
      

        Issue Links

          Activity

          Hide
          Jason Zaugg added a comment -

          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)
          
          Show
          Jason Zaugg added a comment - 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)
          Hide
          Jason Zaugg added a comment -

          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)
          
          Show
          Jason Zaugg added a comment - 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)
          Hide
          Jason Zaugg added a comment -

          Moving the test to pending until we sort this out: https://github.com/scala/scala/pull/3350

          Show
          Jason Zaugg added a comment - Moving the test to pending until we sort this out: https://github.com/scala/scala/pull/3350
          Show
          Eugene Burmako added a comment - https://github.com/scala/scala/pull/3386

            People

            • Assignee:
              Jason Zaugg
              Reporter:
              Jason Zaugg
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development