This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271676 - StackOverflowError at java.lang.Math.min
Summary: StackOverflowError at java.lang.Math.min
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: Dev
Hardware: All All
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-20 08:06 UTC by _ tboudreau
Modified: 2017-11-27 17:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 230643


Attachments
stacktrace (94.83 KB, text/plain)
2017-10-20 08:06 UTC, _ tboudreau
Details
Patch to avoid recursively trying to resolve the same element (1.30 KB, patch)
2017-11-27 17:26 UTC, _ tboudreau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2017-10-20 08:06:15 UTC
Build: NetBeans IDE Dev (Build 20171012-8fbff2d899d9)
VM: OpenJDK 64-Bit Server VM, 9+181, OpenJDK Runtime Environment, 9+181
OS: Linux

User Comments:
tboudreau: Editing a js source




Stacktrace: 
java.lang.StackOverflowError
   at java.lang.Math.min(Math.java:1512)
   at java.util.Arrays.copyOf(Arrays.java:3722)
   at java.util.Arrays.copyOf(Arrays.java:3688)
   at java.util.ArrayList.toArray(ArrayList.java:381)
   at java.util.ArrayList.addAll(ArrayList.java:598)
   at org.netbeans.modules.javascript2.model.JsObjectImpl.getAssignments(JsObjectImpl.java:351)
Comment 1 _ tboudreau 2017-10-20 08:06:18 UTC
Created attachment 165327 [details]
stacktrace
Comment 2 _ tboudreau 2017-10-23 17:07:46 UTC
Okay, something is haywire in Bugzilla's spam filter and it's not letting me post the clone message.

I have a github project in which simply opening one file reproduces this bug 100% of the time.  Link is here:  https://timboudreau.com/files/nb_bug_271676.txt
Comment 3 _ tboudreau 2017-11-27 17:24:35 UTC
100% reproducible if you clone https://github.com/timboudreau/cfig and open cfig.js

I will attach a simple patch that fixes the problem.
Comment 4 _ tboudreau 2017-11-27 17:26:06 UTC
Created attachment 165500 [details]
Patch to avoid recursively trying to resolve the same element

Simply tests to see if the method is going to call itself with the same arguments as it is currently called with.