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 139632

Summary: java.io.UTFDataFormatException: encoded string too long: 400012 bytes
Product: cnd Reporter: nnnnnk <nnnnnk>
Component: -- Other --Assignee: Vladimir Kvashin <vkvashin>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description nnnnnk 2008-07-10 18:04:53 UTC
java.io.UTFDataFormatException: encoded string too long: 400012 bytes
        at java.io.DataOutputStream.writeUTF(DataOutputStream.java:347)
        at java.io.DataOutputStream.writeUTF(DataOutputStream.java:306)
        at org.netbeans.modules.cnd.modelimpl.uid.UIDObjectFactory.writeStringToUIDMap(UIDObjectFactory.java:147)
        at org.netbeans.modules.cnd.modelimpl.csm.NamespaceImpl.write(NamespaceImpl.java:572)
        at
org.netbeans.modules.cnd.repository.support.AbstractObjectFactory.writeSelfPersistent(AbstractObjectFactory.java:66)
        at org.netbeans.modules.cnd.modelimpl.csm.core.CsmObjectFactory.write(CsmObjectFactory.java:427)
        at org.netbeans.modules.cnd.repository.sfs.BufferedRWAccess.write(BufferedRWAccess.java:121)
        at org.netbeans.modules.cnd.repository.disk.FilesAccessStrategyImpl.write(FilesAccessStrategyImpl.java:137)
        at org.netbeans.modules.cnd.repository.disk.MultyFileStorage.write(MultyFileStorage.java:74)
        at org.netbeans.modules.cnd.repository.disk.UnitImpl.putPhysically(UnitImpl.java:143)
        at org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager.write(DiskRepositoryManager.java:163)
        at org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager.closeUnit2(DiskRepositoryManager.java:276)
        at org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager.closeUnit(DiskRepositoryManager.java:264)
        at org.netbeans.modules.cnd.repository.impl.DelegateRepository.closeUnit(DelegateRepository.java:120)
        at org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils.closeUnit(RepositoryUtils.java:268)
        at org.netbeans.modules.cnd.modelimpl.repository.RepositoryUtils.closeUnit(RepositoryUtils.java:250)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase.dispose(ProjectBase.java:1328)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl.disposeProject(ModelImpl.java:315)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl.disposeProject(ModelImpl.java:305)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ModelImpl.shutdown(ModelImpl.java:450)
        at org.netbeans.modules.cnd.modelimpl.trace.TraceModel.test(TraceModel.java:389)
        at org.netbeans.modules.cnd.modelimpl.trace.TraceModel.main(TraceModel.java:153)
encoded string too long: 400012 bytes
Comment 1 nnnnnk 2008-07-10 18:07:08 UTC
It appears on:
#define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9,
#define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \
                LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9)
#define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \
                LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9)
#define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \
                LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9)
#define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \
                LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9)
#define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \
                LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9)
#define LIM7(x) LIM6(x##0) LIM6(x##1) LIM6(x##2) LIM6(x##3) LIM6(x##4) \
                LIM6(x##5) LIM6(x##6) LIM6(x##7) LIM6(x##8) LIM6(x##9)

void func1 (LIM5(int p) int t)
{
}
Comment 2 Vladimir Kvashin 2008-07-14 06:02:01 UTC
The reason is as follows:
macros produce a function with 100,000 parameters.
the signature for such function is too long 
(400,012 bytes, while DataOutputStream can't write UTF strings longer than 65535)


Comment 3 Vladimir Kvashin 2008-07-14 08:24:38 UTC
Fixed
http://hg.netbeans.org/main/rev/6d07994bc971
Comment 4 Vladimir Kvashin 2008-07-14 09:04:00 UTC
Additional fix
http://hg.netbeans.org/main/rev/5fcd1ae32c87
Comment 5 Quality Engineering 2008-07-17 04:52:36 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #324 build
Changeset: http://hg.netbeans.org/main/rev/6d07994bc971
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: Fixed #139632 java.io.UTFDataFormatException: