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

Comments

Projects
None yet
4 participants
@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

scabug commented Mar 16, 2013

@scabug

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

scabug commented Feb 13, 2014

@SethTisue said:
fix version is...?

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Feb 13, 2014

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

@scabug

This comment has been minimized.

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

This comment has been minimized.

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.

@scabug scabug added the backend label Apr 7, 2017

@scabug scabug added this to the Backlog milestone Apr 7, 2017

@SethTisue SethTisue modified the milestones: Backlog, 2.12.0 Mar 2, 2018

@SethTisue SethTisue assigned lrytz and unassigned retronym Mar 2, 2018

@SethTisue

This comment has been minimized.

Copy link
Member

SethTisue commented Mar 2, 2018

fixed by new back end in 2.12

@SethTisue SethTisue closed this Mar 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment