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 49408

Summary: Parts of *.xml files read from unbuffered streams
Product: platform Reporter: _ rkubacki <rkubacki>
Component: -- Other --Assignee: _ rkubacki <rkubacki>
Status: RESOLVED FIXED    
Severity: blocker CC: issues, jchalupa
Priority: P3 Keywords: PERFORMANCE, SIMPLEFIX
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description _ rkubacki 2004-09-22 13:09:02 UTC
dev build from Sep 21, JDK1.5.0b64

while verifying issue #42387 I saw reads from
ModulesAutoDeps/*.xml that are unbuffered. It
seems that the first line is read byte by byte and
the rest is read in single call (if it is shorter
than 2048b)

[pid  8959]
open("./nbbuild/netbeans/bin/../ide4/config/ModuleAutoDeps/org-netbeans-modules-java.xml",
O_RDONLY|O_LARGEFILE <unfinished ...>
[pid  8963] ioctl(13, FIONREAD <unfinished ...>
[pid  8959] <... open resumed> )        = 16
[pid  8963] <... ioctl resumed> , [0])  = 0
[pid  8959] fstat64(16,  <unfinished ...>
[pid  8963] ioctl(13, FIONREAD <unfinished ...>
[pid  8959] <... fstat64 resumed>
{st_mode=S_IFREG|0664, st_size=1327, ...}) = 0
[pid  8963] <... ioctl resumed> , [0])  = 0
[pid  8959] read(16,  <unfinished ...>
[pid  8963] poll( <unfinished ...>
[pid  8959] <... read resumed> "<", 1)  = 1
[pid  8959] read(16, "?", 1)            = 1
[pid  8959] read(16, "x", 1)            = 1
[pid  8959] read(16, "m", 1)            = 1
[pid  8959] read(16, "l", 1)            = 1
[pid  8959] read(16, " ", 1)            = 1
[pid  8959] read(16, "v", 1)            = 1
[pid  8959] read(16, "e", 1)            = 1
[pid  8959] read(16, "r", 1)            = 1
[pid  8959] read(16,  <unfinished ...>
Comment 1 _ rkubacki 2004-09-22 13:50:35 UTC
It seems to be more common pattern not only visible during reading of
ModulesAutoDeps/*.xml but also for our .settings files and config
files in our window system. Maybe it is behaviour of XML parser
contained in JDK 1.5.
Comment 2 _ rkubacki 2004-09-22 15:07:40 UTC
Can be fixed by wrapping to buffered stream at various places like

core/settings/src/org/netbeans/modules/settings/convertors/XMLSettingsSupport.java:737
core/src/org/netbeans/core/xml/FileEntityResolver.java:375

+ winsys + moduleautodeps
Comment 3 Antonin Nebuzelsky 2005-09-30 12:46:07 UTC
Radime, this is easy to fix, aint'it?
Comment 4 Jan Chalupa 2005-12-11 21:12:49 UTC
Looks like nothing happens until this gets a real owner. Radime, can you take
it? Feel free to re-assign if appropriate.
Comment 5 _ rkubacki 2006-01-13 16:56:00 UTC
ModuleAutoDeps/*.xml reading changed

/shared/data/ccvs/repository/core/startup/src/org/netbeans/core/startup/AutomaticDependencies.java,v
 <--  AutomaticDependencies.java
new revision: 1.2; previous revision: 1.1
Comment 6 _ rkubacki 2006-01-20 16:58:27 UTC
/shared/data/ccvs/repository/core/src/org/netbeans/core/xml/FileEntityResolver.java,v
 <--  FileEntityResolver.java
new revision: 1.30; previous revision: 1.29

should be enough at least for startup