c - Why am I getting a memory access violation here? -


this file part of goahead webserver, implements fast block allocation scheme.

at line 284 web server process crashes, @ random times.

 } else if ((bp = bqhead[q]) != null) { /*  *  take first block off relevant q if non-empty  */   bqhead[q] = bp->u.next; //memory access violation here 

what possible reasons this?

edit
bp pointer structure , union in this header file

typedef struct {     union {         void    *next;                          /* pointer next in q */         int     size;                           /* actual requested size */     } u;     int         flags;                          /* per block allocation flags */ } btype; 

thanks.

here's possible reasons.

  • you've screwd , corrupted of data structures or stack.

  • bqhead null or invalid pointer

  • q outside bounds of bqhead

  • bp null or invalid pointer

step through code debugger, or use printf debugging, , see if values if bqhead,q,bp should be.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -