< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

RE: [reSIProcate] Multiply defined symbols & crash in delete operator


Has anyone seen that under Windows (VS .NET 2003, Windows XP Service Pack
2) ? I removed the LEAK_CHECK symbol from the preprocessor defines in order
to avoid the multiply defined symbols.

The first time resiprocate logs messages, it crashes when attempting to
resize a string. My project has a DLL using MFC which links with
resiprocate and dum.

stack trace:

(logger.cxx)

void
GenericLogImpl::OutputToWin32DebugWindow(const Data& result)
{
#ifdef WIN32
>>   const char *text = result.c_str();
   OutputDebugStringA(text);
#endif
}

(data.cxx)

const char*
Data::c_str() const
{
   own();

   if (mSize >= mCapacity)      // !ah! we were overwritting the end
   {                            // !ah! when mSize == mCapacity !!
>>       const_cast<Data*>(this)->resize(mSize+1,true);
   }
   // mostly is zero terminated, but not by DataStream
   mBuf[mSize] = 0;
   return mBuf;
}

(afxmem.cpp)

void __cdecl operator delete[](void* p)
{
>>    ::operator delete(p);
}

(afxmem.cpp)

void __cdecl operator delete(void* p)
{
#if !defined(_AFX_NO_DEBUG_CRT) && defined(_DEBUG)
>>          _free_dbg(p, _NORMAL_BLOCK);
#else
            free(p);
#endif
}

(dbgheap.c)

_CRTIMP void __cdecl _free_dbg(
        void * pUserData,
        int nBlockUse
        )
{
        /* lock the heap
         */
        _mlock(_HEAP_LOCK);

        __try {
            /* allocate the block
             */
>>            _free_dbg_lk(pUserData, nBlockUse);
        }
        __finally {
            /* unlock the heap
             */
            _munlock(_HEAP_LOCK);
        }
}

(dbgheap.c line 1155)

...
            if (!CheckBytes(pbData(pHead) + pHead->nDataSize,
_bNoMansLandFill, nNoMansLandSize))
                _RPT3(_CRT_ERROR, "DAMAGE: after %hs block (#%d) at
0x%p.\n",
                    szBlockUseName[_BLOCK_TYPE(pHead->nBlockUse)],
                    pHead->lRequest,
                    (BYTE *) pbData(pHead));
...

CG



                                                                           
             Scott Godin                                                   
             <slgodin@icescape                                             
             .com>  .                                                   To 
                                       'Alan Hawrylyshen'                  
             07/12/2005 10:00          <alan@xxxxxxxxxx>, kaiduan xie      
             AM                        <kaiduanx@xxxxxxxx>                 
                                                                        cc 
                                       resiprocate-devel@xxxxxxxxxxxxxxxxx 
                                       rg, Christian_Gavin@xxxxxxxxxxxx    
                                                                   Subject 
                                       RE: [reSIProcate] Multiply defined  
                                       symbols                             
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




This warning worries me too.  I personally don't have a lot of experience
with MFC itself to know what a proper workaround or solution is - offhand.
However I do know that this warning is only an issue when using MFC.  There
are no errors when linking with a straight Win32 application.  Regardless,
many people will likely be looking to create User Agents GUIs using MFC and
resiprocate on windows, so it would be good to get the bottom of it.

Scott

-----Original Message-----
From: Alan Hawrylyshen [mailto:alan@xxxxxxxxxx]
Sent: Tuesday, July 12, 2005 12:45 PM
To: kaiduan xie
Cc: resiprocate-devel@xxxxxxxxxxxxxxxxxxx; Christian_Gavin@xxxxxxxxxxxx
Subject: Re: [reSIProcate] Multiply defined symbols


On Jul 12, 2005, at 09.22, kaiduan xie wrote:

> Christian,
>
> Please see the following link
>
> http://list.sipfoundry.org/archive/resiprocate-devel/msg02740.html
>
> Any problems, let me know.
>
> kaiduan


I have finally gotten around to reading that article.
Kaiduan; do you have any idea WHY we have multiple definitions of
symbols? Is this a reSIProcate problem or a problem with the MSFT
toolchain?  I feel that turning off this warning is potentially a bad
plan, but would like some WIN32 people to comment on their position too.

Thanks



Alan Hawrylyshen
reSIProcate Project Administrator
http://sipfoundry.org/reSIProcate/
a l a n a t j a s o m i d o t c o m


_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel