Skip to content
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

2.10.0-M7 compiler crash in backend #6274

Closed
scabug opened this issue Aug 23, 2012 · 7 comments
Closed

2.10.0-M7 compiler crash in backend #6274

scabug opened this issue Aug 23, 2012 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Aug 23, 2012

NOTE: I've marked the affected version as Unreleased-2.10.x since JIRA doesn't know about 2.10.0-M7 yet, but it is that specific version.

This program causes the backend of the 2.10.0-M7 compiler to crash. I have no idea why, but I've marked a few things in the code that affect whether it crashes or not.

trait Crash {

    // USE THIS VERSION OF rewrite AND WE GET THE CRASH
    def rewrite (s : => String => String) (t : String) : String

    // USE THIS VERSION OF rewrite AND THERE IS NO CRASH
    // def rewrite (s : => String => String) : String => String

    def rule (f : String => String) : String => String

    def func : String => String = {
        // PUT DECLARATION OF count HERE AND THERE IS NO CRASH
        // var count = 0
        rewrite {
            // PUT DECLARATION OF count HERE AND WE GET THE CRASH
            var count = 0
            // THE REFERENCE TO count IN THE NEXT LINE IS NEEDED TO INDUCE THE CRASH
            rule { case s => s + count.toString }
        }
    }

}

The top part of the stack trace is as follows. I've attached the full log from sbt's "last" command.

symbol variable count does not exist in Crash$class.func
	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:48)
	at scala.tools.nsc.Global.abort(Global.scala:246)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadIdent$1(GenICode.scala:1092)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1098)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1306)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1304)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 23, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6274?orig=1
Reporter: Tony Sloane (asloane)
Affected Versions: 2.10.0-M7
Other Milestones: 2.10.0
Attachments:

  • log.txt (created on Aug 23, 2012 4:50:16 AM UTC, 48599 bytes)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 23, 2012

@paulp said:
Compiles in M3, crashes M4, M5, M6.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 23, 2012

@paulp said:
Seems like a lock to be e339010842, the only commit to EtaExpansion.scala between M3 and M4.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 7, 2012

@lrytz said (edited on Sep 7, 2012 11:14:17 AM UTC):
fixed in [https://github.com/scala/scala/commit/ec39e1ca82ea26429c140f120831b01cae65853c]

@scabug scabug closed this Sep 7, 2012
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 3, 2012

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 13, 2012

Tony Sloane (asloane) said:
Just to confirm: I'm not seeing this problem in 2.10.0-RC1. Thanks.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 14, 2012

@lrytz said:
pas de quoi

@scabug scabug added this to the 2.10.0-M7 milestone Apr 7, 2017
retronym added a commit to retronym/scala that referenced this issue Nov 21, 2017
The fix for scala/bug#6274 did this selectively when function symbols
were introduced, but we really ought to insert the eta$n temp vals into
the owner chain of all lifted expressions.
adriaanm added a commit to retronym/scala that referenced this issue Aug 3, 2018
The fix for scala/bug#6274 did this selectively when function symbols
were introduced, but we really ought to insert the eta$n temp vals into
the owner chain of all lifted expressions.
adriaanm added a commit to retronym/scala that referenced this issue Aug 3, 2018
The fix for scala/bug#6274 did this selectively when function symbols
were introduced, but we really ought to insert the eta$n temp vals into
the owner chain of all lifted expressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.