Description
In letalvoj/loonyssh/tree/bug-report I am getting either
[error] 216 | case `cast128-cbc`
[error] | ^
[error] |children of class EncryptionAlgorithm were already queried before value cast128-cbc was discovered.
[error] |As a remedy, you could move value cast128-cbc on the same nesting level as class EncryptionAlgorithm.
or java.lang.OutOfMemoryError
.
The EncryptionAlgorithm
is an enum
and cast128-cbc
is one of it's cases. It is used inside a case of yet another enum SSHMsg
The proposed remedy is not helpful much, since I can hardly do anything with nesting of the values in the enum.
I tried to minimize the example but it did not work.
Beware! Once the build passes due to some changes in code (like commenting out the cause) it continues to pass long even when it should not due to incremental compilation. It is enough to run ;clean;compile
and the build starts failing again.
Implicits involved in children of ...
The following chain of givens is involved when the issue emerges:
SSHReader[SSHMsg.KexInit]
Reader.scala#L101SSHReader[NameList[EncryptionAlgorithm]]
Reader.scala#L118EnumSupport[EncryptionAlgorithm]
EnumSupport.scala#L13Mirror.SumOf[EncryptionAlgorithm]
Funny enough - if the NameList[EncryptionAlgorithm]
is not nested inside SSHMsg.KexInit
then the 2nd summon[SSHReader[NameList[EncryptionAlgorithm]]]
compiles just fine.
Attempted fixes
- @smarter proposed to move the
EncryptionAlgorithm
to the same file whereSSHMsg.KexInit
, which did not help - letalvoj/loonyssh/tree/bug-report-oome moving
enum
s and other data structures to a separate module fixes the isue but it hangs the compilation. After several minutes I get
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "classloader-cache-cleanup-0"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "task-progress-report-thread"