You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by "Koundinya B. Srinivasarao" <ks...@opnet.com> on 2008/03/07 16:25:42 UTC

Problem writing DOM node to file on Win x64

Hello,

I am using xerces-c version 2.7.0 on Win XP Pro x64 Edition, Version 
2003, SP1 running on an Intel Pentium D process with 8GB of RAM.

I am running into a problem while writing a DOM node onto a file to a 
Windows shared network drive running Samba. The same works fine on 
the Windows XP 32-bit machine and the actual file size turns out to 
be around 80+ MB. Also, the same works fine on Win x64 when writing 
to the disk on the local hard drive.

On Win x64, though DOMWriter::writeNode () fails and throws an 
exception. Also, Windows Process Monitor reports the following error:

Sequence: 4113
Date & Time: 2/22/2008 2:13:48 PM
Event Class: File System
Operation: WriteFile
Result: INSUFFICIENT RESOURCES
Path: \\<shared-drive>\1203706523-project1-scenario1.11.rpt.xml
TID: 2996
Duration: 0.0002280
Offset: 33,857,680
Length: 33,859,063

Its as though the Win x64 filesystem driver cannot write a buffer of 
size greater than 32MB onto a network filesystem. I have gone through 
the xerces-c mailing lists and the bug reporting system (jira) but 
could not find any reports similar to this problem in the context of 
xerces-c. I have found some articles by googling which seem to be 
related to this but do not clearly indicate what exactly the problem 
is and how to workaround it. Here are the links I came across:

- This one says it may have something to do with MDLfield size on x64 
(dont know what it means and how to get around it): 
http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.kernel/2005-11/msg00097.html 

- This one suggests changing a registry setting. I tried it but it 
didnt help: 
http://www.itnewsgroups.net/group/microsoft.public.windows.server.general/topic34240.aspx

At this point I am pretty much stuck. Have any of you guys seen 
problems of this kind on Win x64? Is this indeed a bug/problem with 
the Win x64 driver? If so, can xerces-c work around it or can I use 
xerces-c differently to work around it? [Note: I am using 
LocalFileFormatTarget to write the DOM node]

I had really appreciate any help or suggestions on this. Thanks so much.
-Koundinya 

Re: Problem writing DOM node to file on Win x64

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi Koundinya,

Koundinya B. Srinivasarao <ks...@opnet.com> writes:

> Its as though the Win x64 filesystem driver cannot write a buffer of
> size greater than 32MB onto a network filesystem.

I think you meant to say write a file of 32MB, not a buffer (I don't
think LocalFileFormatTarget uses a buffer of that size, though I
may be wrong, for example if you have a text node that is 32MB
long).

In any case, I suggest that you try the following: create a
LocalFileFormatTarget object and instead of calling writeNode,
call writeChars on LocalFileFormatTarget in a loop, with some
text for 80Mb of output (you can pass 0 as a third argument
to writeChars).

If you get the same error, then it is most likely OS bug and
you will have to find a work-around for it. Once you do, you
can provide your own implementation of XMLFormatTarget instead
of LocalFileFormatTarget that includes this workaround.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde