Hello
i have c application that im compiling in visual studio 2010
im getting this error in one of my functions
generically how can i debug this kind of exception ?
the function is from dll , other functions working but not this one .
views:
68answers:
2
+1
A:
The error most likely happens when trying to dereference an uninitialized pointer. So:
- Recompile with warning level on maximum (4). Review the warnings. You'll find listed the local variables that are declared without initialization (including pointers).
- Check the parameters you pass to the function (especially the pointer/reference parameters). Check their initialization.
Cătălin Pitiș
2010-07-22 13:11:24
+3
A:
The debug memory allocator fills newly-allocated memory with 0xcdcdcdcd. It looks like you've allocated some memory, only set the low byte to 0xf1 (241), and tried to derefence a four-byte pointer at that location. Without seeing code, that's as much as I can discern.
Marcelo Cantos
2010-07-22 13:14:21
+1, agreed. Reading uninitialized heap memory.
Hans Passant
2010-07-22 13:40:25
He's not 'set the low byte to 0xf1' he's got a structure pointer that is not initialised (thus 0xcdcdcdcd), and then he is accessing the member at 0x24 in the structure.
Simeon Pilgrim
2010-07-22 14:19:03