# Weird problem: TinyXML and _STLP_DEBUG (stlport)

This topic is 5467 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

[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;
}
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]

##### Share on other sites
It's to do with multithreading. What versions of all the libraries are you building with? Are they all multithreaded?

##### Share on other sites
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.

##### Share on other sites
*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?

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 18
• 13
• 14
• 44
• 63