JDK-8030182 : scopeCall with -1 as line number
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 8u20,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-12-16
  • Updated: 2014-08-01
  • Resolved: 2014-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u20Fixed 9 b02Fixed
Description
Hard to reproduce and reduce...
The pasted testcase gets you the scopeCall with -1 as line number. As soon as one of the fn declaration is commented, scopeCall vanishes.

It is observed in avatar-js dumped stacks.

function fail() {
    throw new Error("Strange...");
}

var f2 = fail;
var f3 = fail;
var f4 = fail;
var f5 = fail;

try {
    fail();
}catch(err) {
    print(err.stack);
}
Comments
verified in jdk9 b25
01-08-2014

Fix pushed to nashorn-jdk9 forest: changeset: 684:cade47c36c6c tag: tip user: sundar date: Mon Dec 16 23:25:50 2013 +0530 summary: 8030182: scopeCall with -1 as line number
16-12-2013

Another internal method escaping to stack trace in JDK-8024970: jjs> s = ""; for (i = 0; i < 1000; ++i) s+="o = new Object()\n"; s+="g()"; try{eval("function f(){"+s+"}")()}catch(e){e.stack+""} Expected: $split method not present in stacktrace Actual: $split method in stacktrace
16-12-2013

Reproduces with tip as described. (comment out "var f5.." line, the scopeCall frame goes away)
16-12-2013