Re: [C++-sig] Re: problems with std::string (complete msg.)

Jinseok Seo jsseo at postech.ac.kr
Thu Dec 11 05:41:29 CET 2003


Thank you for your kind reply.
I fixed the problem.
As you advised me, the reason was a heap mismatch.
I was using static heap(MSVCRTD?) library and 
dynamic heap library, simultaneously.

Thank you.

Jinseok Seo

> 
> "RaoulGough" writes: 
> 
> "jsseo"  writes:
> 
> >> "RaoulGough" writes:
> >> 
> >> "jsseo"  writes:
> [snip]
> >> > Program:c:\python22\python.exe
> >> > File:dbgheap.c
> >> > Line: 1132
> >> > Expression: _CrtlsValidHeapPointer(pUserData)
> >> 
> >> Looks like heap corruption to me. It could be that the slightly longer
> >> string requires a new memory (re)allocation internal to the
> >> std::string object, which only then detects a corruption that occured
> >> earlier. This could be due to almost anything, of course. Can you
> >> reproduce the problem using straight C++? Might be easier to track
> >> down that way. You mind find some kind of memory leak or
> >> write-past-the-end detection code useful (e.g.
> >> http://dmalloc.com/). Slightly off-topic here I guess, since it seems
> >> likely to be a straight old C++ problem.
> >
> > Thank you for reply.
> > I tried to reproduce the problem using straight C++.
> > But, the strait C++ code works well.
> > In my thought, using "boost_python.dll" makes no problem, 
> > but using "boost_python_debug.dll" makes "python.exe(python22.dll)"
> > produce the assertion fail message.
> > I don't know why the project for "boost python debug version" 
> > did not link with "python22_d.lib" and it linked with "python22.lib."
> 
> Just a minute here - I'm sure dbgheap.c is part of the Microsoft
> runtime library (i.e. not a Python-specific library). When you link to
> the non-debug version of MSVCRT you won't detect this kind of error
> (at least, not as reliably). Maybe the real difference is whether you
> are linking with MSVCRTD or MSVCRT? I'm pretty sure the dynamic
> dependencies for boost_python_debug.dll would include MSVCRTD.DLL.
> 
> -- 
> Raoul Gough.
> export LESS='-X'
> 
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 




More information about the Cplusplus-sig mailing list