scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Problem with pickling/unpickling of complex traits and type parameters #715

Closed scabug closed 13 years ago

scabug commented 16 years ago

Hello,

Using lift 0.7-SNAPSHOT, if I override the definition of Menu I get a "malformed Scala signature of MenuItem" runtime exception.

I have attached an archive of the project with the issue. To recreate it, expand the tar and run "mvn install"

If you do not include the file "src/main/scala/com/tyler/fb/snippet/Menu.scala" no exception appears.

This is my first report, so please, if you need more let me know.

Thanks

Here is my scala version and stack trace is at the end:

~/src/_sandbox/fb
$$ scala -version
Scala code runner version 2.7.0.r14476-b20080402080027 -- (c) 2002-2008 LAMP/EPFL

~/src/_sandbox/fb
$$ mvn install[[BR]]
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building fb
[INFO]    task-segment: [clean, install]
[INFO] ----------------------------------------------------------------------------
[INFO] artifact net.sf.alchim:yuicompressor-maven-plugin: checking for updates from scala-tools.org
[INFO] [clean:clean]
[INFO] Deleting directory /Users/tjweir/src/_sandbox/fb/target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [yuicompressor:compress {execution: default}]
[INFO] nb warnings: 0, nb errors: 0
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]
[INFO] Compiling 5 source files to /Users/tjweir/src/_sandbox/fb/target/classes
[WARNING] Exception in thread "main" java.lang.RuntimeException: malformed Scala signature of MenuItem at 2891; reference type T of package sitemap refers to nonexisting symbol.
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.errorBadSignature(UnPickler.scala:755)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readSymbol(UnPickler.scala:172)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle$$$$anonfun$$scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readSymbolRef$$1.apply(UnPickler.scala:707)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle$$$$anonfun$$scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readSymbolRef$$1.apply(UnPickler.scala:707)
[WARNING]   at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$at(UnPickler.scala:139)
scabug commented 16 years ago

Imported From: https://issues.scala-lang.org/browse/SI-715?orig=1 Reporter: Tyler Weir (tjweir) Attachments:

scabug commented 16 years ago

@lrytz said: Hi!

We don't have the resources to analyze whole projects. What we need is a small example, a single Scala object, which lets us more easily reproduce and analyze the problem.

scabug commented 16 years ago

David Pollak (dpp) said: This is a persistent problem. There is a problem with the Byte Pickler. I see this problem over and over. Yes, it's a hassle to download lift and reproduce the issue, but there is a problem with the way the types are stored in classes. Please continue to investigate.

scabug commented 16 years ago

@odersky said: I believe #715 and #1122 are duplicates. Since #1122 is fixed in r15700, this one is presumed fixed also. Let me know if you find out this is not the case.

scabug commented 16 years ago

Tyler Weir (tjweir) said: Thanks Martin, I'll test with a nightly when r15700 is rolled in.

scabug commented 15 years ago

@odersky said: Milestone 2.7.1 deleted

scabug commented 15 years ago

Svein Otto Solem (sottos) said: I had an error like this using version 2.7.3. I just followed the example in http://static.liftweb.net/StartingWithLift.pdf

and having one typing error at one of the first examples (page 15)

class Util { def in(html: NodeSeq) = if (User.loggedIn_ ?) html else NodeSeq.Empty // note the space before the question mark

def out(html : NodeSeq ) = if (! User.loggedIn_?) html else NodeSeq.Empty } Compiling (i.e. mvn jetty:run) gives this error [INFO] Compiling 1 source files to C:\Svein\scalating\todo\target \classes [WARNING] Exception in thread "main" java.lang.RuntimeException: malformed Scala signature of User at 13804; reference type _1 of

refers to nonexisting symbol. [WARNING] at scala.tools.nsc.symtab.classfile.UnPickler $$UnPickle.errorBadSignature(UnPickler.scala:762) [WARNING] at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala $$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readSymbol (UnPickler.scala:172) ....
scabug commented 15 years ago

@paulp said: As the reports to this point have been less than impressive in terms of ease of reproduction, I'm attaching some code just sent to the mailing list which reproduces this bug. Compile the attached file meredith.scala and then reference thePOJO2XMLRenderer and you will see:

Exception in thread "main" java.lang.RuntimeException: malformed Scala signature of XMLRenderer at 1019; reference type _1 of <none> refers to nonexisting symbol.
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.errorBadSignature(UnPickler.scala:763)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readSymbol(UnPickler.scala:172)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle$$$$anonfun$$scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readSymbolRef$$1.apply(UnPickler.scala:715)

[...]
scabug commented 15 years ago

David Pollak (dpp) said: Who do we have to bribe to get this year-old, bites everyone who does Lift development, bug?

scabug commented 15 years ago

@paulp said: OK, I got it in r17716. Before:

$$ scalac28 meredith.scala  ; scala28 -e 'println(com.sap.dspace.model.othello.thePOJO2XMLRenderer)'
java.lang.RuntimeException: malformed Scala signature of XMLRenderer at 1152; reference type _2 of <none> refers to nonexisting symbol.
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.errorBadSignature(UnPickler.scala:760)
    at scala.tools.nsc.symtab.classfile.UnPickler$$UnPickle.scala$$tools$$nsc$$symtab$$classfile$$UnPickler$$UnPickle$$$$readSymbol(UnPickler.scala:172)

After:

$$ scalac meredith.scala  ; scala -e 'println(com.sap.dspace.model.othello.thePOJO2XMLRenderer)'
POJO2XMLRenderer(true)

Pickler's pretty freaking complicated so there could be any number of additional bugs in there (and I still hope to rewrite it with my almost-provably-correct strategy) but hopefully the existing troubles all stemmed from this bug.

scabug commented 15 years ago

@paulp said: OK, I had to revert that. I'm pretty sure I'm in the right ballpark, but more pickle juice remains to be spilled.

scabug commented 15 years ago

@lrytz said: paul,

i was looking at that bug today as well, see my comment in #1896

scabug commented 15 years ago

@paulp said: Replying to [comment:15 rytz]:

paul,

i was looking at that bug today as well, see my comment in #1896

Distressingly, it took me until now to figure out that what looked like purely my breakage was some kind of interaction with the new starr which was coincidentally committed just before my patch. So one more joker in the deck over here. You're right, #1896 looks intimately related.

scabug commented 15 years ago

@paulp said: I am fairly sure I have both #715 and #1896 fixed, but I'm stymied until I figure out why I can't build with the new starr. Stay tuned to this channel for further developments.

scabug commented 15 years ago

@paulp said: Now that I've sorted out the starr issues, #715, #1896, and everything else look to be working in r17719. I haven't committed tests cases yet but those are cooking.