Weird problem: TinyXML and _STLP_DEBUG (stlport)

Started by
2 comments, last by Nairou 19 years, 6 months ago
[An updated question on the recent troubles I've been having. I hope this is the right place for this.] Are there any known problems with TinyXML and STLPort's debug mode (defining _STLP_DEBUG)? I've been using TinyXML in my project, and recently added _STLP_DEBUG to the debug version to allow Boost::filesystem to compile, but the program now freezes. Compiles fine, but doesn't run. However the Release (non-debug) version works as it should. I finally narrowed it down to a conflict between TinyXML and the _STLP_DEBUG define. Even the following code on its own, with _STLP_DEBUG defined, will freeze on execution:
#define TIXML_USE_STL
#include <tinyxml.h>

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
TiXmlDocument doc;
doc.LoadFile( "test.xml" );
}
Nothing to it, and yet it freezes every time. If I run the program under the debugger and pause it while its frozen, it always turns up in the following STLPort function (within _threads.c):
template <int __inst>
void _STLP_CALL
_STLP_mutex_spin<__inst>::_M_do_lock(volatile __stl_atomic_t* __lock)
Any possible ideas what could be causing the conflict? Given the simplicity of the test code causing the freeze, I don't know what else to try. Any ideas? [Edited by - Nairou on September 25, 2004 10:09:50 PM]
Advertisement
It's to do with multithreading. What versions of all the libraries are you building with? Are they all multithreaded?
Thanks for the suggestion, I didn't consider the multithreading issue. I am using the following libraries:

Boost 1.31
STLPort 4.6.2
TinyXML 2.3.2

I just tried recompiling TinyXML with the multi-threaded runtime libraries (the library project was setup for single-threaded runtimes), but that made no difference on the freezing debug problem. Whether TinyXML is truly thread-safe or not, I'm not sure, I've posted that question to the TinyXML forum but have yet to receive a reply. My project only ever accesses TinyXML from a single thread, so I would think it would be fine there.

The other two I can only assume are thread safe (I'd be surprised if they weren't). I know STLPort was compiled with the multi-threaded runtimes, I saw it in the makefile. I can't find it in Boost, I can only assume.
*bump*

Surely I'm not the only person using both TinyXML and STLPort? Has no one come across this before? Is my computer just playing games with me or what?

This topic is closed to new replies.

Advertisement