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 99834 - Assertion error for KeyBasedUID
Summary: Assertion error for KeyBasedUID
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 5.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on: 127727
Blocks:
  Show dependency tree
 
Reported: 2007-04-03 15:14 UTC by Sergey Grinev
Modified: 2008-03-27 15:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Log file showing exceptions (79.67 KB, text/plain)
2008-01-24 18:56 UTC, _ gordonp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Grinev 2007-04-03 15:14:25 UTC
Such exception rarely occurs during using cnd 
 
Exception in thread "Code Model Parser 0" java.lang.AssertionError: empty  
project for UID KeyBasedUID on ProjectKey DummyProject  
        at  
org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl._getProject(FileImpl.java:133)  
        at  
org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.getProjectImpl(FileImpl.java:620)  
        at  
org.netbeans.modules.cnd.modelimpl.csm.core.ParserQueue.onFileParsingFinished(ParserQueue.java:578)  
        at  
org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:68)  
        at  
org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:60)  
        at java.lang.Thread.run(Thread.java:595)
Comment 1 Sergey Grinev 2008-01-24 10:31:32 UTC
not reproducible for a long time already.
Comment 2 _ gordonp 2008-01-24 18:53:14 UTC
In the last 2 days I've gotten several dozen of these. Here's a partial stack trace. I can attach
a complete one if you want. I got these on Solaris yesterday and Windows today.

In both cases, I was debugging the same project (copied from Solaris to Windows and recompiled).
The source file is ~gordonp/NetBeansProjects/PThead_1/pthread_1.c, although I think I copied it
to /net/pucci.sfbay/export/pucci1/pthread_1.c.
Comment 3 _ gordonp 2008-01-24 18:56:33 UTC
Created attachment 55526 [details]
Log file showing exceptions
Comment 4 Vladimir Kvashin 2008-03-24 22:36:27 UTC
The stacks in this issue differ.
But since it seems the original stack does not repeat, let's consider it's about the attached one
http://www.netbeans.org/nonav/issues/showattachment.cgi/55526/messages.log




Comment 5 Vladimir Kvashin 2008-03-24 22:41:35 UTC
I guess I know the reason - at least one possible reason.
The HybridRepository.put() checks canWrite() for object; and if false is returned, does nothing.
The only model object, for which canWrite can return false is CsmFile;
false is returned in the case file is changed in buffer.

If file bacame changed prior than FileImpl was created (which is possible), we can experinece such exceptions: file has
itd key-based UID, it is stored in project maps, but won't be stored in persistence. As soon as it sissapears from the
in-memory cache, exceptions start to occur.
Comment 6 Vladimir Kvashin 2008-03-27 15:16:54 UTC
I believe it is fixed now.
(It's difficult to refer to the particular changesets)

I'm able to reproduce it with the NB/CND built a week ago:
close the IDE with a project and a file in editor open.
Upon IDE restart, try to modify this file as soon as possible.
You'll get a bunch of exceptions a bit later.

The reason is exactly the same I described in my previous comment.

The reason is fixed by recent commits.
Now I can not reproduce the exception.