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 196228 - Code model repository is unstable
Summary: Code model repository is unstable
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
: 194500 196154 196540 197490 197682 198635 199178 199179 199326 199409 199483 200972 200975 203726 204384 205260 205551 205663 205664 207368 207370 210022 213074 218168 218185 219471 220380 220878 220968 221148 221149 221827 222818 223405 223408 223927 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-03 13:24 UTC by nnnnnk
Modified: 2012-12-17 14:07 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nnnnnk 2011-03-03 13:24:35 UTC
It's umbrella bug for code model repository issues.
Comment 1 nnnnnk 2011-03-03 13:24:59 UTC
*** Bug 196225 has been marked as a duplicate of this bug. ***
Comment 2 nnnnnk 2011-03-03 13:25:35 UTC
*** Bug 194500 has been marked as a duplicate of this bug. ***
Comment 3 Vladimir Voskresensky 2011-03-03 19:32:54 UTC
*** Bug 196154 has been marked as a duplicate of this bug. ***
Comment 4 nnnnnk 2011-03-16 17:26:33 UTC
*** Bug 196540 has been marked as a duplicate of this bug. ***
Comment 5 nnnnnk 2011-04-26 15:04:21 UTC
*** Bug 197682 has been marked as a duplicate of this bug. ***
Comment 6 nnnnnk 2011-04-26 15:04:28 UTC
*** Bug 197490 has been marked as a duplicate of this bug. ***
Comment 7 nnnnnk 2011-05-17 15:26:47 UTC
*** Bug 198635 has been marked as a duplicate of this bug. ***
Comment 8 nnnnnk 2011-06-06 15:51:34 UTC
*** Bug 199178 has been marked as a duplicate of this bug. ***
Comment 9 nnnnnk 2011-06-06 15:51:41 UTC
*** Bug 199179 has been marked as a duplicate of this bug. ***
Comment 10 nnnnnk 2011-06-10 19:57:40 UTC
*** Bug 199326 has been marked as a duplicate of this bug. ***
Comment 11 nnnnnk 2011-08-10 14:55:55 UTC
*** Bug 199409 has been marked as a duplicate of this bug. ***
Comment 12 nnnnnk 2011-08-10 14:56:13 UTC
*** Bug 199483 has been marked as a duplicate of this bug. ***
Comment 13 nnnnnk 2011-09-13 10:09:43 UTC
*** Bug 200972 has been marked as a duplicate of this bug. ***
Comment 14 nnnnnk 2011-09-13 10:09:48 UTC
*** Bug 200975 has been marked as a duplicate of this bug. ***
Comment 15 nnnnnk 2011-10-18 15:26:10 UTC
*** Bug 203726 has been marked as a duplicate of this bug. ***
Comment 16 nnnnnk 2011-10-31 09:54:33 UTC
*** Bug 204384 has been marked as a duplicate of this bug. ***
Comment 17 nnnnnk 2011-11-23 14:52:57 UTC
*** Bug 205260 has been marked as a duplicate of this bug. ***
Comment 18 nnnnnk 2011-11-30 13:09:59 UTC
*** Bug 205663 has been marked as a duplicate of this bug. ***
Comment 19 nnnnnk 2011-11-30 13:10:17 UTC
*** Bug 205664 has been marked as a duplicate of this bug. ***
Comment 20 nnnnnk 2012-01-23 09:36:49 UTC
*** Bug 207370 has been marked as a duplicate of this bug. ***
Comment 21 nnnnnk 2012-01-23 09:36:54 UTC
*** Bug 207378 has been marked as a duplicate of this bug. ***
Comment 22 nnnnnk 2012-01-23 09:37:28 UTC
*** Bug 207368 has been marked as a duplicate of this bug. ***
Comment 23 tbrunhoff 2012-01-23 15:51:37 UTC
Ok, so there are lots of duplicates for this bug. Its been around for nearly a year and it appears that there is no solution (or at least not one posted here). For users that see such an error, is there (a) a way to characterize it to know that it falls in this bucket? And when it does, is there (b) a workaround to get the faults to stop?

For example, is there a particular set of stack frames in the stack trace that you use to qualify it as a dup? And can you make the faults stop by removing ~/.netbeans/dev/var/chache or some other action?
Comment 24 nnnnnk 2012-03-27 09:55:58 UTC
*** Bug 210022 has been marked as a duplicate of this bug. ***
Comment 25 Vladimir Voskresensky 2012-04-03 17:47:14 UTC
*** Bug 205551 has been marked as a duplicate of this bug. ***
Comment 26 nnnnnk 2012-06-04 11:35:45 UTC
*** Bug 213074 has been marked as a duplicate of this bug. ***
Comment 27 Vladimir Voskresensky 2012-09-12 06:46:38 UTC
perf tests rather stable in producing:
1 of java.lang.IllegalStateException: Failed to get container sorage by key FileDeclarationsKey (/export1/sside/oss_perf_tests/sources/mozilla-2.0N, /export1/sside/oss_perf_tests/sources/mozilla-2.0/ipc/chromium/src/base/scoped_bstr_win_unittest.cc)
1 of java.lang.IllegalStateException: no file for UID KeyBasedUID on FileKey (/export1/sside/oss_perf_tests/sources/mozilla-2.0N, /export1/sside/oss_perf_tests/sources/mozilla-2.0/layout/forms/nsButtonFrameRenderer.h)
Comment 28 Vladimir Voskresensky 2012-09-12 07:11:21 UTC
*** Bug 218168 has been marked as a duplicate of this bug. ***
Comment 29 Quality Engineering 2012-09-19 03:03:36 UTC
Integrated into 'main-golden', will be available in build *201209190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7ee77ee9d511
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: tracing for #196228 - Code model repository is unstable
Comment 30 Vladimir Voskresensky 2012-10-12 17:16:10 UTC
with the following changes in IndexedStorageFile
     public Persistent read(final Key key) throws IOException {
         Persistent object = null;

-        final ChunkInfo chunkInfo = index.get(key);
+        ChunkInfo chunkInfo = index.get(key);
         if (chunkInfo != null) {
             object = fileRWAccess.read(key.getPersistentFactory(), chunkInfo.getOffset(), chunkInfo.getSize());
             if (Stats.fileStatisticsLevel > 0) {
                 fileStatistics.incrementReadCount(key);
             }
+        } else {
+            chunkInfo = index.get(key);
+            chunkInfo = null;
         }

under debugger the second "get" returns non-null value. If not under debugger => still null
Comment 31 Vladimir Voskresensky 2012-10-12 17:16:44 UTC
helpful keys to check were:
+                String clsName = key.getClass().getName();
+                if (!clsName.contains("Project") && !clsName.contains("ndex")) {
+                    data = getDiskStorage(key).read(key);
+                    if (data != null) {
+                        System.err.println("second read returned object " + data + " for " + key);
+                    }
+                    data = null;
+                }
Comment 32 Vladimir Voskresensky 2012-10-12 17:23:45 UTC
hopefully fixed by 
http://hg.netbeans.org/cnd-main/rev/a11e4cd857d3

there remains suspicious code in IndexedStorageFile when writeLock is not always used to make "write" modifications for fileRWAccess/fileRWAccessSize (i.e. call to truncate)
Comment 33 Vladimir Voskresensky 2012-10-12 17:27:09 UTC
Let's observe perf-tests to see if 
java.lang.IllegalStateException: Failed to get...
are gone
Comment 34 Quality Engineering 2012-10-13 02:10:20 UTC
Integrated into 'main-golden', will be available in build *201210130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a11e4cd857d3
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixed #196228 - Code model repository is unstable
- get without sync does not guaranty in java that object is visible after "put" under lock from other thread => IndexedStorageFile.read had index.get(key) as null even on second try (if not under debugger)
Comment 35 nnnnnk 2012-10-15 14:01:36 UTC
*** Bug 219471 has been marked as a duplicate of this bug. ***
Comment 36 Vladimir Voskresensky 2012-10-16 15:04:10 UTC
extra fix for mentioned inconsistency:
http://hg.netbeans.org/cnd-main/rev/39e1a4ff5337

real fix is the previous commit:
http://hg.netbeans.org/main-golden/rev/a11e4cd857d3
Comment 37 Vladimir Voskresensky 2012-10-16 15:07:51 UTC
1 of java.lang.IllegalStateException: Failed to get container sorage by key ProjectDeclarationContainerKey /export1/sside/oss_perf_tests/sources/mozilla-2.0/N/ in last FU report is due to previous OOM exceptions => unable to deserialize at all.
Comment 38 nnnnnk 2012-12-04 13:44:44 UTC
*** Bug 222818 has been marked as a duplicate of this bug. ***
Comment 39 nnnnnk 2012-12-04 13:45:11 UTC
*** Bug 221827 has been marked as a duplicate of this bug. ***
Comment 40 nnnnnk 2012-12-04 13:45:37 UTC
*** Bug 221149 has been marked as a duplicate of this bug. ***
Comment 41 nnnnnk 2012-12-04 13:46:05 UTC
*** Bug 221148 has been marked as a duplicate of this bug. ***
Comment 42 nnnnnk 2012-12-04 13:46:32 UTC
*** Bug 220968 has been marked as a duplicate of this bug. ***
Comment 43 nnnnnk 2012-12-04 13:46:57 UTC
*** Bug 220878 has been marked as a duplicate of this bug. ***
Comment 44 nnnnnk 2012-12-04 13:48:17 UTC
*** Bug 220380 has been marked as a duplicate of this bug. ***
Comment 45 nnnnnk 2012-12-04 13:48:40 UTC
*** Bug 218185 has been marked as a duplicate of this bug. ***
Comment 46 Vladimir Voskresensky 2012-12-06 14:04:00 UTC
*** Bug 218185 has been marked as a duplicate of this bug. ***
Comment 47 Quality Engineering 2012-12-07 02:39:58 UTC
Integrated into 'main-golden', will be available in build *201212070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1eb934b90c2e
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixing #196228 - Code model repository is unstable
- do not work disposed project or invalid file
Comment 48 Vladimir Voskresensky 2012-12-07 11:21:47 UTC
*** Bug 223408 has been marked as a duplicate of this bug. ***
Comment 49 Vladimir Voskresensky 2012-12-07 11:26:26 UTC
extra fixes
http://hg.netbeans.org/cnd-main/rev/57de0b4a02fd
Comment 50 Vladimir Voskresensky 2012-12-07 11:39:25 UTC
*** Bug 223405 has been marked as a duplicate of this bug. ***
Comment 51 Quality Engineering 2012-12-08 02:58:15 UTC
Integrated into 'main-golden', will be available in build *201212080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/57de0b4a02fd
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixed #196228 - Code model repository is unstable
- check for invalid object before asserting
Comment 52 Vladimir Voskresensky 2012-12-17 14:07:43 UTC
*** Bug 223927 has been marked as a duplicate of this bug. ***