Skip to content

Fuzzing test succeeds even though the compiler crashes #6403

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

Closed
smarter opened this issue Apr 30, 2019 · 5 comments
Closed

Fuzzing test succeeds even though the compiler crashes #6403

smarter opened this issue Apr 30, 2019 · 5 comments

Comments

@smarter
Copy link
Member

smarter commented Apr 30, 2019

cp tests/pending/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala
> testCompilation tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala

[warn] Multiple main classes detected.  Run show discoveredMainClasses to see the list
[info] Test run started
[info] Test dotty.tools.dotc.CompilationTests.negAll started
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
[info] Test dotty.tools.dotc.CompilationTests.runAll started
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
[info] Test dotty.tools.dotc.CompilationTests.pickling started
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
[info] Test dotty.tools.dotc.CompilationTests.pos started
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
[info] Test dotty.tools.dotc.CompilationTests.tastyBootstrap started
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
[info] Test dotty.tools.dotc.CompilationTests.posTwice started
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test
[info] Test dotty.tools.dotc.CompilationTests.fuzzyAll started
java.lang.StackOverflowError            ] completed (0/1, 0 failed, 3s)
        at java.util.IdentityHashMap.remove(IdentityHashMap.java:520)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.recur$1(SymDenotations.scala:1860)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.baseTypeOf(SymDenotations.scala:1867)
        at dotty.tools.dotc.core.Types$Type.baseType(Types.scala:925)
        at dotty.tools.dotc.core.Types$NamedType.argForParam(Types.scala:2060)
        at dotty.tools.dotc.core.Types$NamedType.derivedSelect(Types.scala:2112)
        at dotty.tools.dotc.core.Types$TypeMap.derivedSelect(Types.scala:4345)
        at dotty.tools.dotc.core.Types$ApproximatingTypeMap.derivedSelect(Types.scala:4637)
        at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.apply(TypeOps.scala:63)
        at dotty.tools.dotc.core.Types$TypeMap.mapArgs$1(Types.scala:4407)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:4415)
        at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.apply(TypeOps.scala:69)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:4437)
        at dotty.tools.dotc.core.TypeOps$AsSeenFromMap.apply(TypeOps.scala:69)
        at dotty.tools.dotc.core.TypeOps.asSeenFrom(TypeOps.scala:30)
        at dotty.tools.dotc.core.Contexts$Context.asSeenFrom(Contexts.scala:71)
        at dotty.tools.dotc.core.Types$Type.asSeenFrom(Types.scala:832)
        at dotty.tools.dotc.core.Types$Type.memberInfo(Types.scala:825)
        at dotty.tools.dotc.transform.GenericSignatures$.jsig$1(GenericSignatures.scala:219)
        at dotty.tools.dotc.transform.GenericSignatures$.boxedSig$1(GenericSignatures.scala:64)
        at dotty.tools.dotc.transform.GenericSignatures$.argSig$1(GenericSignatures.scala:145)
        at dotty.tools.dotc.transform.GenericSignatures$.classSig$1$$anonfun$1(GenericSignatures.scala:174)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:392)
        at dotty.tools.dotc.transform.GenericSignatures$.classSig$2(GenericSignatures.scala:174)
        at dotty.tools.dotc.transform.GenericSignatures$.jsig$1(GenericSignatures.scala:228)
        at dotty.tools.dotc.transform.GenericSignatures$.boxedSig$1(GenericSignatures.scala:64)
        at dotty.tools.dotc.transform.GenericSignatures$.argSig$1(GenericSignatures.scala:145)
        at dotty.tools.dotc.transform.GenericSignatures$.classSig$1$$anonfun$1(GenericSignatures.scala:174)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
    
[...]
[=======================================] completed (1/1, 0 failed, 4s)
[info] Test dotty.tools.dotc.CompilationTests.genericJavaSignatures started
No files matched "tests/fuzzy/SOE-9cb9025fd025d2e548933c770ce32877f4e21b50.scala" in test

================================================================================
Test Report
================================================================================

1 suites passed, 0 failed, 1 total

[info] Test run finished: 0 failed, 0 ignored, 8 total, 5.452s
[info] Test run started
[info] Test run finished: 0 failed, 0 ignored, 0 total, 0.0s
[info] Passed: Total 8, Failed 0, Errors 0, Passed 8
[success] Total time: 8 s, completed 30 avr. 2019 15:54:00
@nicolasstucki
Copy link
Contributor

The test framework is doing the correct. That stack trace is caught, printed and an error is emitted https://github.com/lampepfl/dotty/blob/master/compiler/src/dotty/tools/backend/jvm/GenBCode.scala#L184. Hence the compiler does not actually crash.

@smarter
Copy link
Member Author

smarter commented Apr 30, 2019

OK we shouldn't catch the exception then, that's not a proper way to report any kind of error.

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 30, 2019
Emitting an error when the backend crashes hides the crash from the reporter and fails which cannot be identified by the testing framework.
@nicolasstucki
Copy link
Contributor

Agreed. I already opened #6408 with this fix.

@sir-wabbit
Copy link

sir-wabbit commented May 1, 2019

This makes me very very happy. @nicolasstucki I used to modify the compiler as described in the #5006 (comment)

I believe there might still be other places where exceptions are ignored.

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 1, 2019
Emitting an error when the backend crashes hides the crash from the reporter and fails which cannot be identified by the testing framework.
@nicolasstucki
Copy link
Contributor

@alexknvl thanks for the link to your diff. I would have missed someone of those crashes.

nicolasstucki added a commit that referenced this issue May 1, 2019
anatoliykmetyuk pushed a commit to dotty-staging/dotty that referenced this issue May 2, 2019
Emitting an error when the backend crashes hides the crash from the reporter and fails which cannot be identified by the testing framework.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants