views:

68

answers:

2

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 .

+1  A: 

The error most likely happens when trying to dereference an uninitialized pointer. So:

  1. Recompile with warning level on maximum (4). Review the warnings. You'll find listed the local variables that are declared without initialization (including pointers).
  2. Check the parameters you pass to the function (especially the pointer/reference parameters). Check their initialization.
Cătălin Pitiș
+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
+1, agreed. Reading uninitialized heap memory.
Hans Passant
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