|
HI
Yup.
If you look at the
'Output Window' you will see first chance exceptions being thrown. A lot
of the time this is handled by the OS and the OS may have cause the First chance
exception, however I know that the thing being thrown is my fault and not
something the OS is doing, however it doesn't crash - as I would expect... (more
later)
Yeah, I understand
this and it helped as I've had more than one exception problem (more later)....
Yup,
Yup - but this isn't one of them (more later)
Thats what I'm
seeing now....
True - however let
me explaine some more....
I've found a few
minor problems with what I'm doing. The first was a "crash" (exception) -
however it only showed up while running the program under the debugger. If
you ran the program normally - either the debug or release version it worked
fine. I found the problem by breaking on the first chance
exception and then I found I was using a pointer that had not been zeroed so I
was using a bad pointer - however the program didn't crash but the ("crash")
problem showed up the next time I tried to allocate memory in a different
thread.
The second problem
- where I know the first chance exception that happening is my fault
however it still works...
Heres a bit of
background
I'm using IOCP so
I have a callback and I have wrapped up my Connection to other machines etc in a
Connection class
Callback (DWORD
dwError, dwNumberOfBytes, LPOVERLAPPED lpOverLapped)
{
Use the lpOverlapped
OVERLAPPEDPLUS * pOverlapped = (OVERLAPPEDPLUS*) lpOverlapped;
CConnection * pConnection =
0;
if (pOverlapped)
{
if (pConnection)
{
// Do something.
}
}
}
CConnection
{
OVERLAPPEDPLUS :
public Overalpped
{
pConnection = this;
bool bOperation;
}
}
Now when someone
disconnects the CConnection its freed from memory, this disconnection seems
to cause the IOCP to complete immediately. So the callback gets
called again. The problem I'm having is that the pOverlapped pointer seems
to be valid however the pConnection pointer contains junk - ( I freed the memory
it points to) , so when I try to 'Do Something' with the pointer it cause the
first chance exception. Now since the app doesn't crash and I only get a
first chance exception I'm assuming that the OS catches
it...
However I don't
like this assumption so I just wanted to find a way to make sure I didn't use a
duff pointer..
Regards
Max
|
- [msvc] IOCP Max
- Re: [msvc] IOCP /dev/null
- Re: [msvc] IOCP Max
- RE: [msvc] IOCP Ehsan Akhgari
- Re: [msvc] IOCP Max
- Re: [msvc] IOCP Max
- Re: [msvc] IOCP Max
- Re: [msvc] IOCP Max
- Re: [msvc] IOCP /dev/null
- RE: [msvc] IOCP Ehsan Akhgari
- RE: [msvc] IOCP Max
- RE: [msvc] IOCP Ehsan Akhgari
- Re: [msvc] IOCP Max
- Re: [msvc] IOCP /dev/null
