You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/11/05 06:59:41 UTC
DO NOT REPLY [Bug 14176] -
StreamTransform fails on 1.4/1.5 - works on 1.3
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14176>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14176
StreamTransform fails on 1.4/1.5 - works on 1.3
David_N_Bertoni@lotus.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
------- Additional Comments From David_N_Bertoni@lotus.com 2002-11-05 05:59 -------
This is a pretty nasty bug in the Sun istrstream class. To confirm, try this
simple program:
#include <cstdlib>
#include <iostream>
#include <strstream>
int
main(int argc, const char* argv[])
{
const char* const theData = "0123456789";
std::cout << "The data to read is \"" << theData << "\"\n";
std::cout << "strlen(theData) == " << std::strlen(theData) << "\n";
std::istrstream theStream(theData, std::strlen(theData));
char theBuffer[200];
std::memset(theBuffer, 0, sizeof(theBuffer));
theStream.read(theBuffer, sizeof(theBuffer));
std::cout << "std::istrstream.read() returned \"" << theBuffer << "\"\n";
std::cout << "std::istrstream.gcount() returned " << theStream.gcount() <<
std::endl;
return 0;
}
I got the following output:
bash-2.02$ CC Test.C
bash-2.02$ ./a.out
The data to read is "0123456789"
strlen(theData) == 10
std::istrstream.read() returned "00123456789"
std::istrstream.gcount() returned 11
bash-2.02$
I'll have to figure out a work-around, perhaps by reverting Solaris back to the
old code. That will work, but it has the disadvantage of having much lower
performance.