Menu

debbugger hangs

Developer
2004-01-13
2004-01-16
  • Mickael Faivre-Macon

    Hi,

    This simple declaration makes my debbugger hang:

       TiXmlDocument doc;

    When tracing the calls, I get to this:

    // tinyxml.cpp

    TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::DOCUMENT )
    {
        tabsize = 4;
        ClearError(); //  HERE
    }

    then ClearError() is called :

    // tinyxml.h

        void ClearError()                        {    error = false;
                                                    errorId = 0;
                                                    errorDesc = ""; // HERE
                                                    errorLocation.row = errorLocation.col = 0;
                                                    //errorLocation.last = 0;
                                                }

    then errorDesc is assigned "", but the strange thing is that the STL is called.
    Why is that ?

    // _string.h

      _Self& operator=(const _CharT* __s) { // hang on this very first line
        _STLP_FIX_LITERAL_BUG(__s)
        return assign(__s, __s + traits_type::length(__s));
      }

    I am using Borland C++ Builder.
    Mickael.

     
    • Yves Berquin

      Yves Berquin - 2004-01-14

      My guess would be that you have an inconsistency in your build. Try to rebuild everything.
      If that doesn't help, you may try to use a third-party STL library.
      You may also use the non-STL version by undefining TIXML_USE_STL.

       
      • Mickael Faivre-Macon

        Hi, I found the bug.
        It was not related to TinyXML so I have to reassure you guys. Sorry.

        I don't know why but WIN32 was not defined and when including winsock2.h the packing size was changed.

        // winsock2.h

        #if !defined(WIN32) && !defined(_WIN64)
        #include <pshpack4.h>
        // This was included but shouldn't have been
        #endif

        [...]

        #if !defined(WIN32) && !defined(_WIN64)
        #include <poppack.h>
        // But this wasn't !!! Really strange
        #endif

        I have defined WIN32 in the project options, and no bug anymore.... Still don't know why WIN32 is not defined.... But __WIN32__ is....

        Anyway, the packing size was changed and this fucked up the STL.

         

Log in to post a comment.

MongoDB Logo MongoDB