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 48993

Summary: Inconsistent data in JTree's layout cache from TreeView
Product: platform Reporter: Pavel Rehak <prehak>
Component: ExplorerAssignee: Petr Nejedly <pnejedly>
Status: CLOSED FIXED    
Severity: blocker CC: jtulach, lcincura
Priority: P2 Keywords: RANDOM, THREAD
Version: 4.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:
Attachments: Exception desc.
additional exception

Description Pavel Rehak 2004-09-14 12:14:44 UTC
System Info:
 Product Version       = NetBeans IDE Dev (Build
200409131800)
 Operating System      = Windows XP version 5.1
running on x86
 Java; VM; Vendor      = 1.5.0-rc; Java
HotSpot(TM) Client VM 1.5.0-rc-b63; Sun
Microsystems Inc.
 Java Home             = C:\Program
Files\Java\jdk1.5.0\jre
-------------------------------------------------
Create new repository (with new empty work dir),
create project database on this repository.
Create mew project (Web | Web Application) in your
work directory. Add whole structure to PVCS
repository ( PVCS | Add all, with Add All
Subdirectories checked). Externally erase
directory ./web/* and invoke command ( PVCS |
Refresh ) 

Exception appears.
Comment 1 Pavel Rehak 2004-09-14 12:15:36 UTC
Created attachment 17611 [details]
Exception desc.
Comment 2 Pavel Rehak 2004-09-14 12:25:31 UTC
>System Info:
  Product Version       = NetBeans IDE Dev (Build 200409100847)
  Operating System      = Windows XP version 5.1 running on x86
  Java; VM; Vendor      = 1.5.0-rc; Java HotSpot(TM) Client VM
1.5.0-rc-b63; Sun Microsystems Inc.
  Java Home             = C:\Program Files\Java\jdk1.5.0\jre

Also when i same scenario invoke on "Promoted Beta 2" version and try
expand nodes ./web/META-INF and expand version-node on file
context.xml [Missing] exception appears.
Comment 3 Martin Entlicher 2004-09-14 21:15:57 UTC
This is completely out of control of VCS.
Comment 4 Martin Entlicher 2004-09-14 21:16:53 UTC
A problem in explorer view.
Comment 5 Petr Nejedly 2004-09-15 13:54:31 UTC
Reproducible?
(I don't have PVCS here, so I don't like to invest my time on
preparing it just to fing out it is not reproducible / tight to PVCS)

Seems like threading issue to me.
Comment 6 Petr Nejedly 2004-09-15 13:57:48 UTC
*** Issue 29255 has been marked as a duplicate of this issue. ***
Comment 7 Pavel Rehak 2004-09-15 14:12:32 UTC
I've tried reproduce it with todays Build 20040915-0830, first part of
test passed somehow, but additional exception (after expanding version
node on context.html file) appears - thus its reproducible.
Comment 8 Petr Nejedly 2004-09-16 14:03:55 UTC
*** Issue 48725 has been marked as a duplicate of this issue. ***
Comment 9 Pavel Rehak 2004-09-21 13:30:40 UTC
i'll add exception for scenario "expanding version node on A_File
[Missing]" - check it out, i think it might be problem of vcscore.
Comment 10 Pavel Rehak 2004-09-21 13:31:21 UTC
Created attachment 17787 [details]
additional exception
Comment 11 Petr Nejedly 2004-09-21 13:47:18 UTC
I still can't reproduce it.
Please note that neither the last exception nor the previous one
("Missing, check it out") are related.
We need to track the AIOOBException here. Is that one reproducible?
Comment 12 Petr Nejedly 2004-09-21 14:54:01 UTC
In fact, it don't need to be threading issue and most probably isn't
as we try hard to serialize all the node changes using the Visualizers
 layer.
But it is possible that some node modified its own structure from a
getter, which resulted in such inconsistency using only one thread.
I've developed a simple swing app that simulates such a behaviour w/o
using nodes (or any other NB API).

Maybe there is some wrong usage of Mutex.EVENT in the explorer code...
Comment 13 Jaroslav Tulach 2004-09-21 17:07:43 UTC
Problem is that the code in VisualizerNode or bellow (swing) is not
reentrant.

The proper fix is to wrap the runnable in VisualizerNode that executes
tasks in AWT queue with Children.MUTEX.readAccess, so no one is
allowed to do any changes to structure while painting.
Comment 14 Jaroslav Tulach 2004-09-22 12:09:14 UTC
I've put the test that simulates similar problems on a branch. Use:

cd openide/test/unit/src/org/openide/explorer/view
cvs upd -r reentrant_48993 TreeView48993Test.java

to get it and update it.
Comment 15 Petr Nejedly 2004-09-27 15:23:23 UTC
Fixed in
openide/src/org/openide/explorer/view/TreeView.java,v1.174
openide/src/org/openide/explorer/view/VisualizerNode.java,v1.44

I had a deadlock problem with the test even before fixing the issue,
so I haven't merged the test yet.
Comment 16 Petr Nejedly 2004-10-01 12:23:23 UTC
*** Issue 49783 has been marked as a duplicate of this issue. ***
Comment 17 Petr Nejedly 2004-10-01 12:24:35 UTC
Happened again, even with the readLock in the VisualizerNode.
Comment 18 Petr Nejedly 2004-10-01 12:30:09 UTC
As it is reproducible from the time it happens for the first time, we
can probably dismiss both concurent modification and in-listener
modification, and should look for a mechanism that could cause
disharmony between TreeModel and its layout cache copy.
Comment 19 Petr Hrebejk 2004-10-11 10:54:52 UTC
*** Issue 50052 has been marked as a duplicate of this issue. ***
Comment 20 Petr Nejedly 2004-10-27 10:02:00 UTC
*** Issue 50869 has been marked as a duplicate of this issue. ***
Comment 21 Petr Nejedly 2004-11-09 14:57:07 UTC
Seems like it got fixed by fix of issue #40152.
Comment 22 Pavel Rehak 2005-04-04 14:12:13 UTC
For VCS part of problem verified with build 200504031800.