title: Signal 6 (SIGABRT) when assigning variable to null (C++)
body: <p>When analyzing a core dumped after a SIGABRT, gdb says that my last line of code executed (before entering library code) is a <code>NULL</code> assignment to a <code>char</code> pointer, as shown below:</p>
  
  <p>gdb:</p>
  
  <pre><code>(gdb) bt full
  #0  0x006337a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
  No symbol table info available.
  #1  0x00674815 in raise () from /lib/tls/libc.so.6
  No symbol table info available.
  #2  0x00676279 in abort () from /lib/tls/libc.so.6
  No symbol table info available.
  #3  0x006a8cca in __libc_message () from /lib/tls/libc.so.6
  No symbol table info available.
  #4  0x006af55f in _int_free () from /lib/tls/libc.so.6
  No symbol table info available.
  #5  0x006af93a in free () from /lib/tls/libc.so.6
  No symbol table info available.
  #6  0x00d0b14e in __builtin_delete () from /usr/lib/libstdc++-libc6.1-1.so.2
  No symbol table info available.
  #7  0x0808181c in MyObject::~MyObject (this=0x84f4db0, __in_chrg=3) at ./MyObject.cpp:16
      this = (MyObject *) 0x84f4db0
  </code></pre>
  
  <p>MyObject.cpp:16 listing:</p>
  
  <pre><code>12: ...
  13: MyObject::~MyObject() {
  14:   if (this-&gt;string != NULL) {
  15:     delete this-&gt;string;
  16:     this-&gt;string = NULL;
  17:   }
  18: }
  19: ...
  </code></pre>
  
  <p>First of all, I do not understand why the line 16 would result in that call stack. It would make more sense if it was a result of the execution of line 15, the one with the <code>delete</code> operator (unless "line 16" represents code executed <em>after</em> the destructor's code to free the memory allocated for that object; just guessing here).</p>
  
  <p>Other than that, can anyone point the way to correctly debug that core?</p>