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.
Today I had the following code: bool TlFader::finalize() { uint nFound = 0; ... and the ide showed a persistent error that nFound could not be resolved. I tried: - changing the name to nFoundx - moving after other declarations - adding other assignments to nFound Yet nothing got rid of the error until I stopped the ide, removed ~/.netbeans/dev/var/cache/cnd/model, and then it went away. I should note that, prior to this, netbeans/java were crashing and hanging, and I was installing, removing and reinstalling everything related to java. So perhaps it became corrupt in the process.
There are no chance to investigate issue without IDE log and/or steps to reproduce.
I hope that change set: http://hg.netbeans.org/cnd-main/rev/9413ea8fedc4 fixes bug. You interested which additional information you can provide for such bugs: - the best is steps to reproduce - log of current IDE session - context project menu->Code Assistance->Dump C/C++ Code Model Diagnostic. Select "Cache of xRef for file", "File Code Model", "Preprocessor States", "General File Information".
Integrated into 'main-golden', will be available in build *201102030000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/9413ea8fedc4 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing Bug #194826 - The code model can become corrupt, causing false errors
Sorry... not fixed. Attached is a snapshot from an editing session just after starting up the ide (build 201102070000). There are a number of errors showing in the ide that should not be there. The events leading up to this probably include the following, in order: - long running editing session with build 201101271430 - many changes in the code tree made externally by 'svn up' - exit ide - install and run 201102070000 - another external change made to the file shown in the snapshot - errors appear as shown in the snapshot
Created attachment 105712 [details] desktop snapshot
Created attachment 105713 [details] log of ide session
Created attachment 105714 [details] dump of c++ code model
Alexander, I get this condition all the time, so I can certainly attach more instances or get other info. I should note that sometimes these syntax errors that appear in the ide are caused by a (very long) lag time between a change in the code and the re-parsing catching up. I wonder if this could be caused by a race condition, where the parser thinks he is all caught up with the changes, but it isn't. Is there a way to force the ide to reparse?
(In reply to comment #8) > Is there a way to force the ide to reparse? Yes: - select all open projects (for NB6.9 only) - context project menu->Code Assistance->reparse
reproducible on samples (for example Fractal), steps to reproduce: - edit Mandelbrot function (for example type "uint i;" before while loop) - sometimes unresolved is appeased and do not go away see attachment.
Created attachment 105750 [details] unresolving of obvious id
Created attachment 105803 [details] unresolving of obvious id (with visible main in navigator)
insert IdentifierErrorProvider:142 the following System.err.println("Unresolved REF " + ref); try { Thread.sleep(1000); } catch (InterruptedException ex) { Exceptions.printStackTrace(ex); } and you will see stable instability
Integrated into 'main-golden', will be available in build *201102100500* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/97702c253b4d User: Vladimir Voskresensky <vv159170@netbeans.org> Log: add fix for #194826 - The code model can become corrupt, causing false errors
Additional fix: http://hg.netbeans.org/cnd-main/rev/775736b418f1
I must say that my impression with 201102100500 is that I see far fewer errors in the editor. Much improved!
(In reply to comment #16) > I must say that my impression with 201102100500 is that I see far fewer errors > in the editor. Much improved! Thanks. It would be nice understand following: - in which condition error appeared - is errors disappeared after document saved/typing space - check what shows references cache in Code Assistance->Dump...->Cache...
Here's another I ran into using build 201102100500. This one popped up when I created a new c++ project from existing sources. Attachments to follow.
Created attachment 105899 [details] event #2: snapshot
Created attachment 105900 [details] event #2: ide log
Created attachment 105901 [details] event #2: dump of c++ code model
event #2 notes: - forcing a reparse did not change the state - I then closed all projects and reopened the one project that (I thought) had the problem, and the errors in the editor were gone. Note that some of the other projects that were open shared the include file that had the error (mediainfo.h).
Integrated into 'main-golden', will be available in build *201102160501* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c0cf94d06ec8 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing Bug #194826 - The code model can become corrupt, causing false errors - cancel reference visitor on cancel request - clear file references context on file parsing finished
Integrated into 'main-golden', will be available in build *201102170501* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2aca78f5502c User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing Bug #194826 The code model can become corrupt, causing false errors - reparse: do not clean libraries that are used in other projects - fix broken library manager (broken after introducing file system in library key)
I have another instance. I can't tell if this is the same bug or a different one, but I'm pretty sure this has to do with the influence of other open projects. The problem: members of a structure appear undefined in the ide editor. The structure: The declarations are arranged as follows: -------- header.h ------------ class Foo { private: struct FooImpl& m; // note that its not defined here public: Foo(); ~Foo(); void operate(); }; -------- main.cpp ------------- #include "header.h" struct FooImpl { FooImpl() : member1(1), member2(false) {} int member1; bool member2; }; Foo::Foo() : m(new FooImpl()) {} void Foo::operate() { m.member1++; m.member2 = true; } ------------------------------ If I put this into a new project, everything is fine... no errors in the editor. In my environment, declarations similar to these appear in a single project, but m.member1 and m.member2 are marked as undefined in the editor. This is complicated by the fact that the errors will appear if I open other projects in a certain order, and if I close all the other projects and tell the ide to reparse, the errors go away. My projects are as follows: - audio.nb - include.nb - media.nb - mediaapi.nb (this is the one with the problem) - mediareader - mxf.nb - obuf.nb - ommedia_python.nb - utils.nb - utils2.nb Here is one scenario: 1. close all projects 2. open mediaapi.nb (no errors) 3. open all other projects above (no errors) 4. close mediaapi.nb 5. reopen mediaapi.nb (**errors appear in the editor**) 6. close all projects except for mediaapi.nb and reparse (errors disappear) Snapshot, ide log and code model attached below.
Created attachment 106125 [details] event #3: snapshot
Created attachment 106126 [details] event #3: ide log
Created attachment 106127 [details] event #3: dump of c++ code model
The classes in mediaapi.nb and the code snippet above are isomorphic. Here are the equivalences: - Foo == OmMovie - FooImpl& Foo::m == MovieImpl& OmMovie::m - Foo::m.member1 == OmMovie::m.obj ...and so forth.
Todd, I see some problem in your projects. 1. Some projects have a broken includes. If you want to rely on code model you should fix all broken include directives. 2. Project "include.nb" exists in two ways: - as NB project - as library project (created automatically for mediaapi.nb) To right model you should: - remove "include.nb" from projects - or set "include.nb" as required project for mediaapi.nb and open mediaapi.nb with required projects About reparsing. Your scenario is: 1. close all projects 2. open mediaapi.nb (no errors) Automatically created library for path "home/toddb/src/src1/omneon/shared/include". 3. open all other projects above (no errors) It's a problem. Changing "mediaapi.nb" can result in conflict between library "home/toddb/src/src1/omneon/shared/include" and project " and project "include.nb". 4. close mediaapi.nb 5. reopen mediaapi.nb (**errors appear in the editor**) Conflict between library "home/toddb/src/src1/omneon/shared/include" and project " and project "include.nb". 6. close all projects except for mediaapi.nb and reparse (errors disappear) Library "home/toddb/src/src1/omneon/shared/include" is up to date.
Created attachment 106144 [details] project/libraries from last model dump
Created attachment 106145 [details] simplified example of wrong resolving m.member1 and m.member2 do not resolved
Created attachment 106540 [details] more complex sample I've attached archive with the following structure: - media_header project - media project (impl 1) with dependency on media_header - media2 project (impl 2) with dependency on media_header
Todd, I've made a change to track situations with separated impl && declaration parts. http://hg.netbeans.org/cnd-main/rev/d0e5c465b0c2 Can you check dev build with the fix?
Integrated into 'main-golden', will be available in build *201103011142* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/d0e5c465b0c2 User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixing #194826 - The code model can become corrupt, causing false errors - unresolved types resolve again
Several issues were fixed in the context of this one. Todd, let's consider this issue fixed and for other known issues, please, open new one to not mix with this.