Skip to content

"UTF8 string too large" in GenBCode #15850

Open
@keynmol

Description

@keynmol

Compiler version

3.1.3

Minimized code

UPDATE: @s5bug minimised it perfectly

type Level1 = Tuple4[Unit, Unit, Unit, Unit]
type Level2 = Tuple4[Level1, Level1, Level1, Level1]
type Level3 = Tuple4[Level2, Level2, Level2, Level2]
type Level4 = Tuple4[Level3, Level3, Level3, Level3]
type Level5 = Tuple4[Level4, Level4, Level4, Level4]
type Level6 = Tuple4[Level5, Level5, Level5, Level5]
type Level7 = Tuple4[Level6, Level6, Level6, Level6]

def crash(x: Level7): Unit = ()

I don't know how to minimise the code, as it's the first time I'm seeing this error and it only happens with this particular generated file.

Scala Native is also involved, but I don't believe it's in any way responsible (although I have no way of confirming that, given that code heavily relies on the SN definitions)

Here's the reproduction project with a single (huge) file that causes this.

https://github.com/keynmol/dotty-crash-demonstrator

Output (click arrow to expand)

java.lang.IllegalArgumentException: UTF8 string too large while compiling .../example-nuklear/target/scala-3.1.3/src_managed/main/nuklear.scala
[error] ## Exception when compiling 1 sources to .../example-nuklear/target/scala-3.1.3/classes
[error] java.lang.IllegalArgumentException: UTF8 string too large
[error] scala.tools.asm.ByteVector.putUTF8(ByteVector.java:246)
[error] scala.tools.asm.SymbolTable.addConstantUtf8(SymbolTable.java:774)
[error] scala.tools.asm.MethodWriter.<init>(MethodWriter.java:602)
[error] scala.tools.asm.ClassWriter.visitMethod(ClassWriter.java:446)
[error] scala.tools.asm.tree.MethodNode.accept(MethodNode.java:647)
[error] scala.tools.asm.tree.ClassNode.accept(ClassNode.java:452)
[error] dotty.tools.backend.jvm.GenBCodePipeline$Worker2.getByteArray$1(GenBCode.scala:483)
[error] dotty.tools.backend.jvm.GenBCodePipeline$Worker2.addToQ3(GenBCode.scala:489)
[error] dotty.tools.backend.jvm.GenBCodePipeline$Worker2.run(GenBCode.scala:467)
[error] dotty.tools.backend.jvm.GenBCodePipeline.buildAndSendToDisk(GenBCode.scala:568)
[error] dotty.tools.backend.jvm.GenBCodePipeline.run(GenBCode.scala:531)
[error] dotty.tools.backend.jvm.GenBCode.run(GenBCode.scala:67)
[error] dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:311)
[error] scala.collection.immutable.List.map(List.scala:246)
[error] dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:312)
[error] dotty.tools.backend.jvm.GenBCode.runOn(GenBCode.scala:75)
[error] dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:225)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions