Hi,
The assert happens in dbgheap.c (I believe it is part of the MSVC, could
be from many source, boost or libtorrent, I am not sure) The first alert
is "Unhandled exception at xxxxx in test.exe: user breakpoint", if I
continue, I got "Debug Assertion Failed" (inside free.c -- again inside
MSVC).
Ignore my comment on the copy contrustor part, as this is no STL, and I do
not know much yet about boost.
On Tue, 17 Jan 2006, Arvid Norberg wrote:
> > memory problems, that is my guts' feeling at the moment.
>
> When you say they're not really balanced, you mean that WSACleanup()
> is called more than once then? so the reference counter drops below 0?
Actually, I should not say that is not balanced. Strictly speaking, the
observation is that the first time when WSACleanup is called, some memory
issue kicks in, and application got aborted. This is in debug build. In
release build, I will get hundreds lines of WSAStartup error as reported
before.
>
> Now when I think of it, maybe it's a threading problem. You could try
> adding a mutex around that reference counter. I'm currently replacing
> the socket code with asio anyway, so it might not be worth too much
> effort.
Some type of racing condition? Could be. Well, I have not studied the
codes yet, so just a wild guess.
> > Well, I have less grab on MS debugger, has anyone run this through
> > BounceChecker or Purify? In term of memory debugger, I found Sun
> > Studio's
> > dbx/SPARC is the best in the industry (just run through the bcheck
> > will
> > reveal a lot of things). (Sun Studio 11 is free nowaday.) Just
> > asking to
> > see if someone else already done it or not. (I may get into this if
> > no one
> > has done it yet.)
>
> I've run it through BoundChecker, but that won't find buffer overruns
> very easily. I've also run it through valgrind on linux without any
> problems. valgrind will find buffer over/underrunds immediately.
OK, that is good. On Solaris/SPARC (not the x86) dbx or bcheck with check
access turned on, memory access error can be reported very precisely.
Anyway, I will save it for another day (after the client work on Win32, I
will move on to server side on both Solaris and Linux anyway.)
Best regards,
Allen Zhao
|