Skip to content

Method call in object with more than 109 parameters fails assertion in TastyPickler. #1544

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
nicolasstucki opened this issue Sep 27, 2016 · 2 comments

Comments

@nicolasstucki
Copy link
Contributor

This issue is similar to #1542 but it manifests itself in a different place. It might have a shared fix with #1542.

object Foo {
  def foo(p1: Int, p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int, p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int, p20: Int, p21: Int, p22: Int, p23: Int, p24: Int, p25: Int, p26: Int, p27: Int, p28: Int, p29: Int, p30: Int, p31: Int, p32: Int, p33: Int, p34: Int, p35: Int, p36: Int, p37: Int, p38: Int, p39: Int, p40: Int, p41: Int, p42: Int, p43: Int, p44: Int, p45: Int, p46: Int, p47: Int, p48: Int, p49: Int, p50: Int, p51: Int, p52: Int, p53: Int, p54: Int, p55: Int, p56: Int, p57: Int, p58: Int, p59: Int, p60: Int, p61: Int, p62: Int, p63: Int, p64: Int, p65: Int, p66: Int, p67: Int, p68: Int, p69: Int, p70: Int, p71: Int, p72: Int, p73: Int, p74: Int, p75: Int, p76: Int, p77: Int, p78: Int, p79: Int, p80: Int, p81: Int, p82: Int, p83: Int, p84: Int, p85: Int, p86: Int, p87: Int, p88: Int, p89: Int, p90: Int, p91: Int, p92: Int, p93: Int, p94: Int, p95: Int, p96: Int, p97: Int, p98: Int, p99: Int, p100: Int, p101: Int, p102: Int, p103: Int, p104: Int, p105: Int, p106: Int, p107: Int, p108: Int, p109: Int): Int = 42
  foo(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109)
}
java.lang.AssertionError: assertion failed: number 221 too large to fit in 1 bytes
    at scala.Predef$.assert(Predef.scala:165)
    at dotty.tools.dotc.core.tasty.TastyBuffer.putNat(TastyBuffer.scala:129)
    at dotty.tools.dotc.core.tasty.NameBuffer.withLength(NameBuffer.scala:48)
    at dotty.tools.dotc.core.tasty.NameBuffer.pickleName(NameBuffer.scala:66)
    at dotty.tools.dotc.core.tasty.NameBuffer$$anonfun$assemble$2.apply(NameBuffer.scala:89)
    at dotty.tools.dotc.core.tasty.NameBuffer$$anonfun$assemble$2.apply(NameBuffer.scala:86)
    at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:778)
    at scala.collection.mutable.LinkedHashMap.foreach(LinkedHashMap.scala:139)
    at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:777)
    at dotty.tools.dotc.core.tasty.NameBuffer.assemble(NameBuffer.scala:86)
    at dotty.tools.dotc.core.tasty.TastyPickler.dotty$tools$dotc$core$tasty$TastyPickler$$lengthWithLength$1(TastyPickler.scala:36)
    at dotty.tools.dotc.core.tasty.TastyPickler.assembleParts(TastyPickler.scala:41)
    at dotty.tools.backend.jvm.GenBCodePipeline$Worker1$$anonfun$visit$1.apply(GenBCode.scala:207)
    at dotty.tools.backend.jvm.GenBCodePipeline$Worker1$$anonfun$visit$1.apply(GenBCode.scala:206)
    at scala.Option.foreach(Option.scala:257)
    at dotty.tools.backend.jvm.GenBCodePipeline$Worker1.visit(GenBCode.scala:206)
    at dotty.tools.backend.jvm.GenBCodePipeline$Worker1.run(GenBCode.scala:154)
    at dotty.tools.backend.jvm.GenBCodePipeline.buildAndSendToDisk(GenBCode.scala:358)
    at dotty.tools.backend.jvm.GenBCodePipeline.run(GenBCode.scala:324)
    at dotty.tools.backend.jvm.GenBCode.run(GenBCode.scala:56)
    at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:276)
    at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:274)
    at scala.collection.immutable.List.map(List.scala:273)
    at dotty.tools.dotc.core.Phases$Phase$class.runOn(Phases.scala:274)
    at dotty.tools.backend.jvm.GenBCode.runOn(GenBCode.scala:40)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:69)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:66)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
    at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply$mcV$sp(Run.scala:66)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:60)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:60)
    at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:69)
    at dotty.tools.dotc.Run.compileUnits(Run.scala:60)
    at dotty.tools.dotc.Run.compileSources(Run.scala:57)
    at dotty.tools.dotc.Run.compile(Run.scala:41)
    at dotty.tools.dotc.Driver.doCompile(Driver.scala:26)
    at dotty.tools.dotc.Driver.process(Driver.scala:124)
    at dotty.tools.dotc.Driver.process(Driver.scala:93)
    at dotty.tools.dotc.Driver.process(Driver.scala:105)
    at dotty.tools.dotc.Driver.main(Driver.scala:132)
    at dotty.tools.dotc.Main.main(Main.scala)
@nicolasstucki nicolasstucki changed the title Method call with more than 109 parameters fails assertion in TastyPickler. Method call in object with more than 109 parameters fails assertion in TastyPickler. Sep 27, 2016
@odersky
Copy link
Contributor

odersky commented Sep 27, 2016

No the reason for this is completely unrelated to #1542. Have a look at the
actual assert. It's a length field in TASTY that overflows.

On Tue, Sep 27, 2016 at 4:22 PM, Nicolas Stucki [email protected]
wrote:

This issue is similar to #1542
#1542 but it manifests itself
in a different place. It might have a shared fix with #1542
#1542.

object Foo {
def foo(p1: Int, p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int, p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int, p20: Int, p21: Int, p22: Int, p23: Int, p24: Int, p25: Int, p26: Int, p27: Int, p28: Int, p29: Int, p30: Int, p31: Int, p32: Int, p33: Int, p34: Int, p35: Int, p36: Int, p37: Int, p38: Int, p39: Int, p40: Int, p41: Int, p42: Int, p43: Int, p44: Int, p45: Int, p46: Int, p47: Int, p48: Int, p49: Int, p50: Int, p51: Int, p52: Int, p53: Int, p54: Int, p55: Int, p56: Int, p57: Int, p58: Int, p59: Int, p60: Int, p61: Int, p62: Int, p63: Int, p64: Int, p65: Int, p66: Int, p67: Int, p68: Int, p69: Int, p70: Int, p71: Int, p72: Int, p73: Int, p74: Int, p75: Int, p76: Int, p77: Int, p78: Int, p79: Int, p80: Int, p81: Int, p82: Int, p83: Int, p84: Int, p85: Int, p86: Int, p87: Int, p88: Int, p89: Int, p90: Int, p91: Int, p92: Int, p93: Int, p94: Int, p95: Int, p96: Int, p97: Int, p98: Int, p99: Int, p100: Int, p101: Int, p102: Int, p103: Int, p104: Int, p105: Int, p106: Int, p107: Int, p108: Int, p109: Int): Int = 42
foo(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109)
}

java.lang.AssertionError: assertion failed: number 221 too large to fit in 1 bytes
at scala.Predef$.assert(Predef.scala:165)
at dotty.tools.dotc.core.tasty.TastyBuffer.putNat(TastyBuffer.scala:129)
at dotty.tools.dotc.core.tasty.NameBuffer.withLength(NameBuffer.scala:48)
at dotty.tools.dotc.core.tasty.NameBuffer.pickleName(NameBuffer.scala:66)
at dotty.tools.dotc.core.tasty.NameBuffer$$anonfun$assemble$2.apply(NameBuffer.scala:89)
at dotty.tools.dotc.core.tasty.NameBuffer$$anonfun$assemble$2.apply(NameBuffer.scala:86)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:778)
at scala.collection.mutable.LinkedHashMap.foreach(LinkedHashMap.scala:139)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:777)
at dotty.tools.dotc.core.tasty.NameBuffer.assemble(NameBuffer.scala:86)
at dotty.tools.dotc.core.tasty.TastyPickler.dotty$tools$dotc$core$tasty$TastyPickler$$lengthWithLength$1(TastyPickler.scala:36)
at dotty.tools.dotc.core.tasty.TastyPickler.assembleParts(TastyPickler.scala:41)
at dotty.tools.backend.jvm.GenBCodePipeline$Worker1$$anonfun$visit$1.apply(GenBCode.scala:207)
at dotty.tools.backend.jvm.GenBCodePipeline$Worker1$$anonfun$visit$1.apply(GenBCode.scala:206)
at scala.Option.foreach(Option.scala:257)
at dotty.tools.backend.jvm.GenBCodePipeline$Worker1.visit(GenBCode.scala:206)
at dotty.tools.backend.jvm.GenBCodePipeline$Worker1.run(GenBCode.scala:154)
at dotty.tools.backend.jvm.GenBCodePipeline.buildAndSendToDisk(GenBCode.scala:358)
at dotty.tools.backend.jvm.GenBCodePipeline.run(GenBCode.scala:324)
at dotty.tools.backend.jvm.GenBCode.run(GenBCode.scala:56)
at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:276)
at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:274)
at scala.collection.immutable.List.map(List.scala:273)
at dotty.tools.dotc.core.Phases$Phase$class.runOn(Phases.scala:274)
at dotty.tools.backend.jvm.GenBCode.runOn(GenBCode.scala:40)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:69)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:66)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply$mcV$sp(Run.scala:66)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:60)
at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:60)
at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:69)
at dotty.tools.dotc.Run.compileUnits(Run.scala:60)
at dotty.tools.dotc.Run.compileSources(Run.scala:57)
at dotty.tools.dotc.Run.compile(Run.scala:41)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:26)
at dotty.tools.dotc.Driver.process(Driver.scala:124)
at dotty.tools.dotc.Driver.process(Driver.scala:93)
at dotty.tools.dotc.Driver.process(Driver.scala:105)
at dotty.tools.dotc.Driver.main(Driver.scala:132)
at dotty.tools.dotc.Main.main(Main.scala)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1544, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAwlVi1oVetKjzLbnydg1qciYsN6huXkks5quSakgaJpZM4KHunZ
.
{"api_version":"1.0","publisher":{"api_key":"
05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":
{"external_key":"github/lampepfl/dotty","title":"
lampepfl/dotty","subtitle":"GitHub repository","main_image_url":"
https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-
11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://
cloud.githubusercontent.com/assets/143418/15842166/
7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in
GitHub","url":"https://github.com/lampepfl/dotty"}},"
updates":{"snippets":[{"icon":"DESCRIPTION","message":"Method call with
more than 109 parameters fails assertion in TastyPickler.
(#1544)"}],"action":{"name":"View Issue","url":"https://github.
com//issues/1544"}}}

Prof. Martin Odersky
LAMP/IC, EPFL

@odersky
Copy link
Contributor

odersky commented Sep 28, 2016

More precisely, the signature of a name got longer than 128. Should be easy to fix, as the format allows for an arbitrary number of bytes for length fields.

Blaisorblade added a commit to Blaisorblade/dotty that referenced this issue Oct 6, 2016
Blaisorblade added a commit to Blaisorblade/dotty that referenced this issue Oct 9, 2016
Blaisorblade added a commit to Blaisorblade/dotty that referenced this issue Oct 10, 2016
Blaisorblade added a commit to Blaisorblade/dotty that referenced this issue Oct 10, 2016
Blaisorblade added a commit to Blaisorblade/dotty that referenced this issue Oct 10, 2016
odersky added a commit to dotty-staging/dotty that referenced this issue Oct 13, 2016
Fixes scala#1544 by making the length field use 1 or 2 bytes,
depending on the number of parameters in a signature.
odersky added a commit that referenced this issue Oct 16, 2016
Fix #1544: Allow long signatures in names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants