On reporting scalac crashes

78 views
Skip to first unread message

Qirun Zhang

unread,
Oct 20, 2016, 5:05:26 PM10/20/16
to scala-internals
Hello all,

I am doing some research on compiler testing. Recently, I started testing scala compiler. I am not sure whether the issue that I discovered is interesting, and should I report it or not. Specifically,

I am running tests against the original test-suite in scala, by changing few tokens. And I noticed a few crashes. For example, the orignal test file "t3683a.scala" in scala repostory is:


==========
sealed trait Foo
sealed trait Bar extends Foo
sealed trait W[T >: Bar <: Foo]
case class X() extends W[Foo]
case class XX() extends W[Bar]
case class Y() extends W[Bar]
case class Z[T >: Bar <: Foo](                     // change "[T >: Bar <: Foo]" to  "[T >: T <: Foo]"
  z1: W[T]
) extends W[T]

object Main {
  // should warn for not including XX()
  def f1(w: W[Bar]): Int = {
    w match {
      // case XX() => 2
      case Y() => 1
      case Z(z) => f1(z)
    }
  }
}
==========

If we made only one change as described in the comment, the modifed testcase can crash the latest scalac and also 2.11.8.

Well, the testcase seems to be invalid code, but it is derived from exsting testsuite, and the code change to trigger the crash is modest. Will that be an interesting case to report?

Thanks,
Qirun

martin odersky

unread,
Oct 20, 2016, 5:16:03 PM10/20/16
to scala-internals
I think any bug involving a compiler crash is interesting to report. Thanks for digging!

 - Martin
 

Thanks,
Qirun

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-internals+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Martin Odersky
EPFL and Lightbend

Adriaan Moors

unread,
Oct 20, 2016, 5:18:23 PM10/20/16
to scala-internals
+1, this does like something someone might write and we shouldn't crash over that. Really cool that you're fuzzing the compiler -- I was wondering when someone would do that :-)

 

Thanks,
Qirun

To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Martin Odersky
EPFL and Lightbend

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.

Qirun Zhang

unread,
Oct 20, 2016, 5:21:11 PM10/20/16
to scala-i...@googlegroups.com
Thanks, let my try to report some of my findings on mutating the original testsuite.

I will also try to avoid reporting duplicates.


Regards,
Qirun

 

Thanks,
Qirun

To unsubscribe from this group and stop receiving emails from it, send an email to scala-internals+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Martin Odersky
EPFL and Lightbend

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-internals+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "scala-internals" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-internals/ErDoM1z8L3M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scala-internals+unsubscribe@googlegroups.com.

Seth Tisue

unread,
Oct 20, 2016, 5:29:06 PM10/20/16
to scala-i...@googlegroups.com
For some context on this, here are links to two bug reports Qirun has already filed:


in a longish comment on the former, I made remarks about what kind of bug reports on the compiler are most valuable:


I would add, now that I’ve seen your new example in this thread, that, compared to generating code ex nihilo, fuzzing existing test cases seems more likely to me to result in actionable bug reports.

Seth Tisue / Scala team / Lightbend, Inc.

Paolo G. Giarrusso

unread,
Oct 28, 2016, 12:00:56 PM10/28/16
to scala-internals
Sorry for the late reply, but have you tried fuzzing dotty? It might be cool to compare the stability of the two compilers. And at least I would hope that dotty is more robust and has a better chance of fixing such bugs.
(Not sure what dotty maintainers think though).
 

Thanks,
Qirun

To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Martin Odersky
EPFL and Lightbend

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "scala-internals" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-internals/ErDoM1z8L3M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scala-interna...@googlegroups.com.

Qirun Zhang

unread,
Oct 28, 2016, 12:30:25 PM10/28/16
to scala-i...@googlegroups.com
Thanks for the suggestion.
No, I haven't tried dotty before. Let me try to test dotty.


Regards,
Qirun

To unsubscribe from this group and all its topics, send an email to scala-internals+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages