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 158277 - BufferUnderflowException when opening project
Summary: BufferUnderflowException when opening project
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
: 120742 121305 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-10 11:30 UTC by Vladimir Kvashin
Modified: 2009-05-05 11:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
netbeans userdir (6.87 MB, application/x-gzip)
2009-02-10 11:36 UTC, Vladimir Kvashin
Details
cnd model cache (5.97 MB, application/x-gzip)
2009-02-10 11:38 UTC, Vladimir Kvashin
Details
The project that was open (52.62 KB, application/x-gzip)
2009-02-10 11:51 UTC, Vladimir Kvashin
Details
the content of /var/tmp/vk155633-cnd65-caches-0/%2Fusr%2Fsfw%2Flib%2Fgcc%2Fi386-pc-solaris2.10%2F3.4.3%2FincludeL (26.70 KB, application/x-gzip)
2009-02-10 12:49 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2009-02-10 11:30:48 UTC
When opening a project, I see lot of exceptions in console:

java.nio.BufferUnderflowException
  at java.nio.Buffer.nextGetIndex(Buffer.java:480)
  at java.nio.HeapByteBuffer.getShort(HeapByteBuffer.java:285)
  at org.netbeans.modules.cnd.repository.sfs.BufferDataInput.readShort(BufferDataInput.java:117)
  at org.netbeans.modules.cnd.repository.support.AbstractObjectFactory.readSelfPersistent(AbstractObjectFactory.java:72)
  at org.netbeans.modules.cnd.modelimpl.csm.core.CsmObjectFactory.read(CsmObjectFactory.java:470)
  at org.netbeans.modules.cnd.repository.sfs.BufferedRWAccess.read(BufferedRWAccess.java:105)
  at org.netbeans.modules.cnd.repository.sfs.IndexedStorageFile.read(IndexedStorageFile.java:127)
  at org.netbeans.modules.cnd.repository.sfs.DoubleFileStorage.read(DoubleFileStorage.java:132)
  at org.netbeans.modules.cnd.repository.disk.UnitImpl.get(UnitImpl.java:89)
  at org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager.get(DiskRepositoryManager.java:174)
  at org.netbeans.modules.cnd.repository.impl.DelegateRepository.get(DelegateRepository.java:84)
  at org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils.get(RepositoryUtils.java:110)
  at org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils.get(RepositoryUtils.java:82)
  at org.netbeans.modules.cnd.modelimpl.uid.KeyBasedUID.getObject(KeyBasedUID.java:67)
  at org.netbeans.modules.cnd.modelimpl.uid.UIDCsmConverter.UIDtoFile(UIDCsmConverter.java:80)
  at org.netbeans.modules.cnd.modelimpl.csm.IncludeImpl._getIncludeFile(IncludeImpl.java:129)
  at org.netbeans.modules.cnd.modelimpl.csm.IncludeImpl.getIncludeFile(IncludeImpl.java:77)
  at org.netbeans.modules.cnd.highlight.error.BadgeProvider.invalidateProject(BadgeProvider.java:87)
  at org.netbeans.modules.cnd.highlight.error.BadgeProviderUpdater.projectLoaded(BadgeProviderUpdater.java:115)
  at org.netbeans.modules.cnd.modelimpl.csm.core.ProgressSupport.fireProjectLoaded(ProgressSupport.java:145)
  at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase.onAddedToModelImpl(ProjectBase.java:800)
  at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase$2.run(ProjectBase.java:755)
  at org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl$2.run(ModelImpl.java:347)
  at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:573)
  at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1005)

The netbeans is build using changeset 28c70c483921
Comment 1 Vladimir Kvashin 2009-02-10 11:36:43 UTC
Created attachment 76781 [details]
netbeans userdir
Comment 2 Vladimir Kvashin 2009-02-10 11:38:55 UTC
Created attachment 76782 [details]
cnd model cache
Comment 3 Vladimir Kvashin 2009-02-10 11:49:38 UTC
The project I opened was
/home/vk155633/NetBeansProjects/DLight_Simple_Tests
with configuration GNU
Comment 4 Vladimir Kvashin 2009-02-10 11:51:24 UTC
Created attachment 76783 [details]
The project that was open
Comment 5 Vladimir Kvashin 2009-02-10 12:48:37 UTC
An error occurs (in particular) when restoring CsmFile that corresponds to stdio.h
Repository unit that fails:
"/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/includeL"

chunkInfo.getOffset() returns 151965
while file is only 58K
Comment 6 Vladimir Kvashin 2009-02-10 12:49:48 UTC
Created attachment 76787 [details]
the content of /var/tmp/vk155633-cnd65-caches-0/%2Fusr%2Fsfw%2Flib%2Fgcc%2Fi386-pc-solaris2.10%2F3.4.3%2FincludeL
Comment 7 Vladimir Kvashin 2009-02-10 12:55:32 UTC
After I removed cache for /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/include,
exceptions disappeared;
cache-0-data is now 87K instead of 58K
(but I don't know fragmentation ration neither for old nor for new one)

I guess the situation is related with incorrect shutdown of the IDE (kill -9 or so) -
my guess is that under some circumstances the cache is not invalidated when it should.
But it's just a guess.
Comment 8 Quality Engineering 2009-04-30 07:35:49 UTC
Integrated into 'main-golden', will be available in build *200904300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/cf657de5684a
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing IZ#158277:BufferUnderflowException when opening project
Comment 9 Alexander Simon 2009-04-30 12:46:02 UTC
fixed by recovering errors:
- error on lading project from repository: clean repository and reparse project
- error while working wit project: repository will be cleaned on closing project 
Comment 10 Vladimir Voskresensky 2009-04-30 22:01:55 UTC
*** Issue 121305 has been marked as a duplicate of this issue. ***
Comment 11 Quality Engineering 2009-05-01 08:16:54 UTC
Integrated into 'main-golden', will be available in build *200905010201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0777e37c4058
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed IZ#158277:BufferUnderflowException when opening project
- recover after error
Comment 12 Vladimir Voskresensky 2009-05-05 11:41:10 UTC
*** Issue 120742 has been marked as a duplicate of this issue. ***