Weird problem while debugging a CAsyncSocket object 
Author Message
 Weird problem while debugging a CAsyncSocket object

I have a very strange problem related to debugging of a CAsyncSocket
object. I have created several CAsyncSocket objects in my program and
they are all receiving data at the same time. At some random point in
time in a random CAsyncSocket object, one of my own ASSERTs fire
because the received data look garbled. This happens in a function I
call from OnReceive();

Here comes the weird thing: If I use the Call Stack to go one step
down, to OnReceive(), I find that the parameters the function was
called with are not the same as what the function received! In other
words:

OnReceive()
{
char* pBuf = 1234;
MyFunc(pBuf);

Quote:
}

MyFunc(char* pBuf)
{
        ASSERT(pBuf == 1234)

Quote:
}

The ASSERT fires, not because the data is garbled, but because pBuf
points to a slightly different place than it's supposed to. (It's like
20-30 bytes of). I am positive that MyFunc() doesn't alter pBuf.

Does anyone know what's going on?

Roger Dahl



Wed, 04 Aug 2004 17:17:08 GMT  
 Weird problem while debugging a CAsyncSocket object
i don't know whether this may be helpful: check *pBuf
instead of pBuf.

OnReceive(.)
{
char* pBuf = 1234;
MyFunc(pBuf);

Quote:
}

MyFunc(char* pBuf)
{
        ASSERT(*pBuf == 1234)
Quote:
}



Sun, 08 Aug 2004 00:05:56 GMT  
 Weird problem while debugging a CAsyncSocket object
Whops! You're right, but that's just a typo in the message. I did find
the solution to my problem. It's related to the problem described in
this thread: "Apparent corruption caused by the de{*filter*} / ASSERT".

Thanks!

Roger Dahl

Quote:

> i don't know whether this may be helpful: check *pBuf
> instead of pBuf.

> OnReceive(.)
> {
> char* pBuf = 1234;
> MyFunc(pBuf);
> }

> MyFunc(char* pBuf)
> {
>    ASSERT(*pBuf == 1234)
> }



Sun, 08 Aug 2004 10:58:16 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Weird debug problem

2. Weird, very weird status bar "problem".

3. Weird, very weird status bar "problem".

4. weird, weird and really weird?

5. Problem debugging VB COM object from a ATL-Service

6. COM+ object debugging problem

7. VC++5: Creating library .\Debug/Test.lib and object .\Debug/Test.exp

8. CAsyncSocket: debug assertion failure, line 512 in sockcore.cpp

9. weird debug error VC++ 6.0

10. weird access violation ATL-ADO object

11. Urgent: Weird behavior with VC++ DLL when called from a VB Custom Object

12. Can not delete CAsyncSocket derived object

 

 
Powered by phpBB® Forum Software