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-M6: spurious SCOPE_EXIT warnings #6191

Closed
scabug opened this issue Aug 5, 2012 · 16 comments
Closed

2.10.0-M6: spurious SCOPE_EXIT warnings #6191

scabug opened this issue Aug 5, 2012 · 16 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Aug 5, 2012

this is a less severe form of #6049. #6049 was closed because the back end no longer crashes, but there are still spurious warnings.

so e.g. borrowing Miguel's minimized code from #6049:

Welcome to Scala version 2.10.0-M6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_33).

scala> :paste
object O {
  while(true) {
    var j = 0
    try j
    catch { case t: Throwable => }
  }
}
// Exiting paste mode, now interpreting.

<console>:11: warning: Visited SCOPE_EXIT before visiting corresponding SCOPE_ENTER. SI-6049
           try j
           ^
defined module O

at #6049 Miguel said this warning could also be a sign of issues with "whether the debugger shows the variable in question"

@scabug
Copy link
Author

scabug commented Aug 5, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6191?orig=1
Reporter: @SethTisue
Affected Versions: 2.10.0-M6

@scabug
Copy link
Author

scabug commented Aug 28, 2012

@SethTisue said:
warning still present in 2.10.0-M7. the warning references #6049, should probably reference this ticket instead

@scabug
Copy link
Author

scabug commented Feb 8, 2013

Jeff Olson (jdolson) said:
FYI, I'm getting this warning with the following code:

import java.util.concurrent.ExecutorService
import java.util.Queue

class Spinner[-T](f: T => Unit, execService: ExecutorService, queue: Queue[T]) {
  @volatile private[this] var runFlag = true

  def start() {
    execService.execute(new Runnable() {
      def run() {
        while (runFlag) {
          val item = queue.poll()
          if (item != null) {
            try {
              f(item)
            }
            catch {
              case t: Throwable => t.printStackTrace()
            }
          }
        }
      }
    })
  }

}

Running scalac [Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_29)] gives the following:

test.scala:12: warning: Visited SCOPE_EXIT before visiting corresponding SCOPE_ENTER. SI-6049
          if (item != null) {
          ^
one warning found

@scabug
Copy link
Author

scabug commented Feb 16, 2013

Lars Hupel (larsrh) said:
This also happens in the scalaz codebase and I'm unsure what to do with it. Is this warning bogus or should I change the code until it disappears?

@scabug
Copy link
Author

scabug commented Feb 21, 2013

@nilskp said:
Yep, just hit this one. Not sure if I should care. Is the byte code broken or what's going on?

@scabug
Copy link
Author

scabug commented Feb 21, 2013

@magarciaEPFL said:
This amounts to some debugging information missing, about the scope of a method variable. The debugger will show that variable as having a scope either too large or too small, or might not display it at all. The bytecode instructions are fine.

@scabug
Copy link
Author

scabug commented Mar 16, 2013

@som-snytt said:
I also just noticed GenASM report this on itself. Just a bit of irony.

...jvm/GenASM.scala:133: warning: Visited SCOPE_EXIT before visiting...

I agree that the warning is a distraction. Shouldn't it sit behind -Xdev?

@scabug
Copy link
Author

scabug commented Mar 16, 2013

@retronym said:
scala/scala#2182

@scabug
Copy link
Author

scabug commented Mar 17, 2013

@som-snytt said:
OK, then you don't need mine. I see the semantics of devWarning is Xdev || Ydebug.

That might be more useful, on the theory that if a dev sees the SCOPE_EXIT enough to be annoyed, they might be motivated to remedy it.

@scabug
Copy link
Author

scabug commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

@scabug
Copy link
Author

scabug commented Jan 29, 2014

@adriaanm said:
Debug info still needs to be improved, but the warning is nog longer emitted by default.

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@SethTisue said:
fix version is...?

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@adriaanm said:
2.11.x? This didn't seem urgent?

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@SethTisue said:
the ticket is closed as fixed. essentially, I'm asking what branch the fix has already been made on. (I'm not suggesting a 2.10.x backport)

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@adriaanm said:
Oh, I was thinking we were fixing it in the future. Looks like an accidental close -- I really need SI-autocorrect.

@SethTisue
Copy link
Member

fixed by new back end in 2.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants