title: segmentation fault invalid memory 0x0
body: <p>I have an issue with my pointer to a structure variable. I just started using GDB to debug the issue. The application stops when it hits on the line of code below due to segmentation fault. ptr_var is a pointer to a structure</p>
  
  <pre><code>ptr_var-&gt;page = 0;
  </code></pre>
  
  <p>I discovered that ptr_var is set to an invalid memory 0x0 after a series of function calls which caused the segmentation fault when assigning the value "0" to struct member "page". The series of function calls does not have a reference to ptr_var. The old address that used to be assigned to ptr_var is still in memory. I can still still print the values of members from the struct ptr_var using the old address. GDB session below shows that I am printing a string member of the struct ptr_var using its address</p>
  
  <pre><code>(gdb) x /s *0x7e11c0
  0x7e0810:   "Sample String"
  </code></pre>
  
  <p>I couldn't tell when the variable ptr_var gets assigned an invalid address 0x0. I'm a newbie to GDB and an average C programmer. Your assistance in this matter is greatly appreciated. Thank you.</p>