Jump to content
  • Advertisement
Sign in to follow this  
Nairou

STLPort + Boost + debug = Infinite loop?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, I've got a very strange problem that has me stumped. My code compiles fine (I'm using VC7.1), and the Release version runs fine, as it should. But when I run the Debug version, it just freezes. No errors, no output, and 0% CPU usage, like its waiting for something. After hunting around to find what I changed that caused this freeze, I narrowed it down to defining _STLP_DEBUG in my compile options. If I take that out, the Debug version again runs fine. However, boost::filesystem refuses to compile in the Debug version without _STLP_DEBUG being defined. I tried pausing the program while it was frozen, and it always shows it to be waiting in _debug.h (stlport code), in the following function: void _Invalidate_all() { __stl_debugger::_Invalidate_all(this); } Anyone have the slightest idea whats going on here, or what I need to do to get my code to cooperate with both STLPort and Boost? Known bugs? Something I'm missing? Any input would be great! [depressed]

Share this post


Link to post
Share on other sites
Advertisement
*bump*

Any ideas? Anyone? I've tried removing the boost #error thats triggered by _STLP_DEBUG, but that only results in link errors rather than compiler errors. I even tried editing the STLPort makefiles to not use _STLP_DEBUG in the debug versions, but that had no effect on the boost error messages.

It basically looks like I'm supposed to use _STLP_DEBUG in the debug version. That certainly makes everyone happy, and it compiles fine. I just don't know why it causes the debug version to freeze. It freezes very early on in the program, within the STLPort code. If I comment out the code where it freezes, it just freezes from somewhere else, the next STL use. Doesn't make any sense...

Share this post


Link to post
Share on other sites
Thanks for the link, I hadn't seen that one. But the link errors listed there are exactly the sort I got when I took out the boost error message, forcing it to compile without _STLP_DEBUG being set.

I looked into the STLPort makefile, and the debug versions are hard-coded to include _STLP_DEBUG, so the support is definitely there. I tried taking that out and recompiling them, but no effect.

Essentially, the only way I've been able to get the code to compile successfully is if I leave both boost and STLPort unedited (leaving the boost error checks and allowing STLPort debug libraries to be compiled with _STLP_DEBUG), and define _STLP_DEBUG in my commandline. But the resulting program doesn't run, it freezes at the first opportunity.

Like I said, the Release compile runs perfectly, so it has something to do with this _STLP_DEBUG thing. I didn't have to define _STLP_DEBUG in my project until I started using boost::filesystem, and before that the Debug version worked fine.

Share this post


Link to post
Share on other sites
This problem is driving me NUTS, and keeps getting weirder.

Okay, my project currently uses 3 libraries. STLPort, Boost (lexical_cast and filesystem), and TinyXML.

The WHOLE problem stems from the fact that I have to include _STLP_DEBUG in the project as a compiler define. Without it, boost::filesystem refuses to compile. filesystem was the most recent addition. Without boost::filesystem, I don't have to include _STLP_DEBUG, and everything runs fine.

Its starting to look more like a conflict between _STLP_DEBUG and TinyXML. I tried taking out all the boost::filesystem code I added. Still freezes. I put that back in, and instead took out all the TinyXML code. Program suddenly starts running fine again.

It makes no sense though. Even this code:

const char * const ix_CfgFile = "engine.xml";

TiXmlDocument doc;
doc.SetTabSize( 0 );
doc.LoadFile( ix_CfgFile );


will trigger the freeze if _STLP_DEBUG is included. I run the program under a debugger, and pause it while its frozen, and it always shows as waiting within this function (STLPort code in _threads.c):

void _STLP_CALL _STLP_mutex_spin<__inst>::_S_nsec_sleep(int __log_nsec)


I even tried keeping my TinyXML functions in the project, and just not call them, but it still freezes. I have to actually remove them or comment them out for the freeze to go away. Makes no sense...

I'm at a loss. Are there known conflicts between TinyXML and STLPort? Does anyone have the SLIGHTEST idea what could be going on here? I have no idea where to go from here...

[Edited by - Nairou on September 25, 2004 4:02:06 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!