title: best approach to debug "corrupted double-linked list" crash
body: <p>I am in the process of debugging a "corrupted double-linked list" crash. I have seen the source and understand the chunk struct and the fd/bk pointers, etc, so I think I know why this crash has occurred. I am now trying to fix it and I have a couple of questions.</p>
  
  <p>Question #1: where (with respect to the pointer returned from malloc) is the malloc_chunks struct maintained?  Are they before the memory block or after it?</p>
  
  <p>Question #2: the malloc_chunks for allocated memory are different from the malloc_chunks for unallocated memory. It appears (??) that the allocated buffer case does not have the fd/bk pointers.  Is this correct?  </p>
  
  <p>Question #3: what is the recommended approach to debug this type of error?  I am assuming that I should put a break point for the malloc_chunks so I can break on when the struct is overwritten. But I am not sure how to access those malloc structs so I can set a break point in gdb.</p>
  
  <p>Any suggestions on how to proceed would be very appreciated.</p>
  
  <p>Thanks,
  -Andres</p>