Skip to content

[TreeUnpickler] hitting assertion failure: -Yread-docs enabled, but no docCtx is set. #14190

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
tpolecat opened this issue Dec 30, 2021 · 6 comments

Comments

@tpolecat
Copy link

Hi,

I'm running into an assertion failure here when trying to use Scala 3 with Metals (which uses InteractiveDriver, which seems to set the -Yread-docs option).

Exception in thread "pool-10-thread-9" java.lang.AssertionError: assertion failed: `-Yread-docs` enabled, but no `docCtx` is set.
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
        at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readNewDef(TreeUnpickler.scala:901)
        at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readIndexedDef(TreeUnpickler.scala:776)
        ...

This only happens for me as far as I can tell (nobody can reproduce it) but it's consistent. I was hoping someone here might be able to explain the circumstance in which this assertion would be triggered, to help us track down what's going on.

The related Metals issue is scalameta/metals#3414

Thanks!

rob

@tgodzik
Copy link
Contributor

tgodzik commented Dec 30, 2021

We checked and this seems to happen only on graalvm-ce-java8 and most likely MacOS

@kpodsiad
Copy link

It happens also on openjdk_1.8.0_292, so it may be related to the java version and not just the vendor.

@smarter
Copy link
Member

smarter commented Dec 30, 2021

This needs reproduction steps to be actionable.

@tgodzik
Copy link
Contributor

tgodzik commented Dec 30, 2021

It seems that it works if we generate Bloop configuration from sbt, but not scalacli, so this might actually be some misconfiguration in scalacli. I will come back with some more info.

@tgodzik
Copy link
Contributor

tgodzik commented Jan 18, 2022

I dug a bit deeper here and it seems this is failing due to a release flag:

8 is not a valid choice for -release
  scalac -help  gives more information
exception caught when loading module class package$: java.lang.AssertionError: assertion failed: `-Yread-docs` enabled, but no `docCtx` is set.
exception caught when loading module class language$: java.lang.AssertionError: assertion failed: `-Yread-docs` enabled, but no `docCtx` is set.
Exception in thread "pool-6-thread-5" java.lang.AssertionError: assertion failed: `-Yread-docs` enabled, but no `docCtx` is set.

If I remove -release 8 it works, but 8 should be a valid choice here. Why would it break?

@tgodzik
Copy link
Contributor

tgodzik commented Jan 18, 2022

Actually, this got already fixed by #13811

@tgodzik tgodzik closed this as completed Jan 18, 2022
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

4 participants