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 212862 - Stack overflow in LazyLookupProviders$1$1.beforeLookup
Summary: Stack overflow in LazyLookupProviders$1$1.beforeLookup
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: RANDOM
: 213927 214173 (view as bug list)
Depends on:
Blocks: 209322
  Show dependency tree
 
Reported: 2012-05-22 20:00 UTC by toben
Modified: 2012-06-17 02:16 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 188233


Attachments
stacktrace (84.88 KB, text/plain)
2012-05-22 20:00 UTC, toben
Details

Note You need to log in before you can comment on or make changes to this bug.
Description toben 2012-05-22 20:00:43 UTC
This bug was originally marked as duplicate of bug 210481, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build nbms-and-javadoc-9263-on-20120501)
VM: Java HotSpot(TM) Client VM, 23.0-b21, Java(TM) SE Runtime Environment, 1.7.0_04-b20
OS: Windows XP

User Comments:
toben: local browser test of a restlet webservice started

GUEST: After deleting a project

GUEST: Deleting a maven project.




Stacktrace: 
org.openide.util.lookup.AbstractLookup$CycleError: StackOverflowError. There is 1 listeners:
Round 1

   at org.openide.util.lookup.AbstractLookup.notifyListeners(AbstractLookup.java:574)
   at org.openide.util.lookup.ProxyLookup$R.collectFires(ProxyLookup.java:633)
   at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:170)
   at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:126)
   at org.netbeans.modules.projectapi.LazyLookupProviders$1$1.beforeLookup(LazyLookupProviders.java:108)
   at org.openide.util.lookup.ProxyLookup$R.myBeforeLookup(ProxyLookup.java:646)
Comment 1 toben 2012-05-22 20:00:51 UTC
Created attachment 119748 [details]
stacktrace
Comment 2 Jesse Glick 2012-05-24 00:43:12 UTC
Why is this a P2? There were three reports from two reporters over the course of three weeks.

Possibly caused by fix of bug #209322. No idea how to reproduce. Could perhaps break recursion manually though it is hard to be sure that would not just cause some other problem.
Comment 3 Exceptions Reporter 2012-05-25 11:56:34 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=188233
Comment 4 Jesse Glick 2012-06-11 16:47:33 UTC
*** Bug 213927 has been marked as a duplicate of this bug. ***
Comment 5 Jesse Glick 2012-06-11 16:51:14 UTC
Can try to fix; without a way to reproduce, can neither verify fix, nor be sure it does not make something worse.
Comment 6 mienamoo 2012-06-12 06:43:54 UTC
Steps to reproduce with build 201206100001 on Windows 7:

1. Create a new Maven-based web application.
2. Create a new servlet in the web app project.
3. Run the project.
4. Move the project (context menu > Move).
5. Move the project again to a different location, or delete the project with sources.
Comment 7 Jesse Glick 2012-06-13 18:33:07 UTC
Can reproduce (on Linux) using these instructions - thanks for test case.
Comment 8 Jesse Glick 2012-06-13 19:24:36 UTC
Seems to be hitting a cycle in lookup for CosChecker, and if I comment that out, in DebuggerChecker. Both register multiple interfaces on one class, which is probably the trigger. This ProxyLookup.beforeLookup impl is just calling setLookups, which is explicitly permitted by the Javadoc, but that seems to not be working in this case; I suspect the fix of bug #209322 (lazy iterators) broke this use case. I do not know how to reproduce inside a unit test, unfortunately.

Can just manually break the cycle by making nested calls to bL a no-op, though it is unclear what this might hurt - nested calls to allItems will incorrectly return an empty list. Cannot set serviceNames=null (the flag that the ProxyLookup has been initialized) _before_ calling setLookups, since that would allow another thread to see an uninitialized lookup; nor can the flag and setLookups be wrapped in a single synchronized block, since that would deadlock (cf. bug #205533).
Comment 9 Jesse Glick 2012-06-13 19:26:29 UTC
core-main #8c856611ef52
Comment 10 Milos Kleint 2012-06-14 08:17:10 UTC
*** Bug 214173 has been marked as a duplicate of this bug. ***
Comment 11 Quality Engineering 2012-06-15 06:13:14 UTC
Integrated into 'main-golden', will be available in build *201206150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8c856611ef52
User: Jesse Glick <jglick@netbeans.org>
Log: #212862: Stack overflow in LazyLookupProviders$1$1.beforeLookup
Comment 12 mienamoo 2012-06-15 13:33:40 UTC
Verified with build 201206150001.