You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Chong Hock Leong-A15994 <Ho...@motorola.com> on 2002/01/18 11:48:17 UTC
DOMString not threadsafe
Since I always face xerces 1.6 and 1.4 crash at when parsing a file (most in DOMStringHandle::operator new) and sometime in DOMString::transcode, I have modified the ThreadTest.cpp and make threaMain just run below function
void testDOMStr(char* str)
{
DOMString domStr(str);
char* out = domStr.transcode();
//std::cout << "out " << out << std::endl;
delete [] out;
}
The program can run up to few minutes and crash.
here's my core stacks
311 freeListPtr = *(void **)freeListPtr;
(/opt/SUNWspro/WS6/bin/sparcv9/dbx) where
current thread: t@4
=>[1] DOMStringHandle::operator new(sizeToAlloc = 12U), line 311 in "DOMString.cpp"
[2] DOMStringHandle::createNewStringHandle(bufLength = 12U), line 372 in "DOMString.cpp"
[3] DOMString::DOMString(0xfea0bce8, 0xffbef916, 0x0, 0xffbef916, 0xfefb3938, 0xfef81790), at 0xff166484
[4] testDOMStr(str = 0xffbef916 "testing5678"), line 763 in "ThreadTest.domStr.cpp"
[5] threadMain(param = 0xb00f8), line 810 in "ThreadTest.domStr.cpp"
Current function is DOMString::DOMString
513 if (!uniConverter->transcode(srcString, strData, charsNeeded))
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
current thread: t@5
[1] 0x33000000(0x5b730, 0xffbef966, 0x58da8, 0x5, 0x81010100, 0xff00), at 0x32ffffff
=>[2] DOMString::DOMString(this = 0xfe909ce0, srcString = 0xffbef966 "Test1"), line 513 in "DOMString.cpp"
[3] testDOMStr(str = 0xffbef966 "Test1"), line 763 in "ThreadTest.domStr.cpp"
[4] threadMain(param = 0x61d24), line 810 in "ThreadTest.domStr.cpp"
cpp"
I tried both single processor and multi processor machine
Machine Type 1
SunOS 5.7 sun4u: Sun Microsystems sun4u Sun Ultra 80 UPA/PCI (4 X UltraSPARC-II 450MHz)
COmpiler 1
Sun WorkShop 6 update 2 C++ 5.3 2001/05/15
Machine Type 2
SunOS 5.7 sun4u: Sun Microsystems sun4u Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 440MHz)
COmpiler 2
CC: WorkShop Compilers 5.0 98/12/15 C++ 5.0
This seems that DOMString is not thread safe (not only for not const function)
Regards,
Hock Leong
POPI Classification :
* Motorola Confidential Proprietary
* Motorola Internal Use Only
* Motorola General Business Information