title: crashing for __cxxabiv1::__cxa_pure_virtual () - vtable ptr to abstract base class?
body: <p>I have a crash in application:<BR></p>
  
  <pre><code>__cxxabiv1::__cxa_pure_virtual ()
  </code></pre>
  
  <p>I can understand<BR>
  <a href="https://stackoverflow.com/questions/22884715">What is the meaning of a &quot;pure virtual&quot; call in a stack trace?</a> <BR></p>
  
  <p>And according "1 Answer" below i can exercise a little test program:</p>
  
  <pre><code>  1 #include &lt;iostream&gt;
    2 
    3 class Base
    4 {
    5 public:
    6     Base()
    7     {
    8         std::cout &lt;&lt; "Base c'tor" &lt;&lt; std::endl;
    9     }
   10 
   11     virtual ~Base()
   12     {
   13         std::cout &lt;&lt; "Base d'tor" &lt;&lt; std::endl;
   14     }
   15 
   16 };
   17 
   18 class Derived : public Base
   19 {
   20 public:
   21     Derived()
   22     : Base()
   23     {
   24         std::cout &lt;&lt; "Derived c'tor" &lt;&lt; std::endl;
   25     }
   26 
   27     ~Derived()
   28     {
   29         std::cout &lt;&lt; "Derived d'tor" &lt;&lt; std::endl;
   30     }
   31 };
   32 
   33 int
   34 main(
   35     int,
   36     char**)
   37 {
   38     {
   39         Derived d;
   40     }
   41     return 0;
   42 }
  </code></pre>
  
  <p>compile with:</p>
  
  <pre><code>g++ -g3 -O0 -o test test.cc
  </code></pre>
  
  <p>create gdb batch script:</p>
  
  <pre><code>break 8
  command
  p this
  x/10xg this
  x/10xg (long)*this
  cont
  end
  break 13
  command
  p this
  x/10xg this
  x/10xg (long)*this
  cont
  end
  break 24
  command
  p this
  x/10xg this
  x/10xg (long)*this
  cont
  end
  break 29
  command
  p this
  x/10xg this
  x/10xg (long)*this
  cont
  end
  run
  </code></pre>
  
  <p>and run:</p>
  
  <pre><code>frank@frank-PC:~$ gdb ./test &lt; gdb.bat |c++filt 
  
  GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
  Copyright (C) 2016 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-linux-gnu".
  Type "show configuration" for configuration details.
  For bug reporting instructions, please see:
  &lt;http://www.gnu.org/software/gdb/bugs/&gt;.
  Find the GDB manual and other documentation resources online at:
  &lt;http://www.gnu.org/software/gdb/documentation/&gt;.
  For help, type "help".
  Type "apropos word" to search for commands related to "word"...
  Reading symbols from ./test...done.
  (gdb) Breakpoint 1 at 0x400b72: file test.cc, line 8.
  (gdb) &gt;&gt;&gt;&gt;&gt;(gdb) Breakpoint 2 at 0x400baa: file test.cc, line 13.
  (gdb) &gt;&gt;&gt;&gt;&gt;(gdb) Breakpoint 3 at 0x400c29: file test.cc, line 24.
  (gdb) &gt;&gt;&gt;&gt;&gt;(gdb) Breakpoint 4 at 0x400c81: file test.cc, line 29.
  (gdb) &gt;&gt;&gt;&gt;&gt;(gdb) Starting program: /home/frank/test 
  
  Breakpoint 1, Base::Base (this=0x7fffffffdab0) at test.cc:8
  8           std::cout &lt;&lt; "Base c'tor" &lt;&lt; std::endl;
  $1 = (Base * const) 0x7fffffffdab0
  0x7fffffffdab0: 0x0000000000400df8  0x597870ad9bc42900
  0x7fffffffdac0: 0x0000000000400d10  0x00007ffff7495830
  0x7fffffffdad0: 0x0000000000000000  0x00007fffffffdba8
  0x7fffffffdae0: 0x00000001ffffdbb8  0x0000000000400ab6
  0x7fffffffdaf0: 0x0000000000000000  0x9e98039144430dd4
  0x400df8 &lt;vtable for Base+16&gt;:  0x0000000000400b92  0x0000000000400bde
  0x400e08 &lt;typeinfo for Derived&gt;:    0x0000000000602200  0x0000000000400e20
  0x400e18 &lt;typeinfo for Derived+16&gt;: 0x0000000000400e30  0x6465766972654437
  0x400e28 &lt;typeinfo name for Derived+8&gt;: 0x0000000000000000  0x0000000000602090
  0x400e38 &lt;typeinfo for Base+8&gt;: 0x0000000000400e40  0x0000006573614234
  Base c'tor
  
  Breakpoint 3, Derived::Derived (this=0x7fffffffdab0) at test.cc:24
  24          std::cout &lt;&lt; "Derived c'tor" &lt;&lt; std::endl;
  $2 = (Derived * const) 0x7fffffffdab0
  0x7fffffffdab0: 0x0000000000400dd8  0x597870ad9bc42900
  0x7fffffffdac0: 0x0000000000400d10  0x00007ffff7495830
  0x7fffffffdad0: 0x0000000000000000  0x00007fffffffdba8
  0x7fffffffdae0: 0x00000001ffffdbb8  0x0000000000400ab6
  0x7fffffffdaf0: 0x0000000000000000  0x9e98039144430dd4
  0x400dd8 &lt;vtable for Derived+16&gt;:   0x0000000000400c68  0x0000000000400ce2
  0x400de8 &lt;vtable for Base&gt;: 0x0000000000000000  0x0000000000400e30
  0x400df8 &lt;vtable for Base+16&gt;:  0x0000000000400b92  0x0000000000400bde
  0x400e08 &lt;typeinfo for Derived&gt;:    0x0000000000602200  0x0000000000400e20
  0x400e18 &lt;typeinfo for Derived+16&gt;: 0x0000000000400e30  0x6465766972654437
  Derived c'tor
  
  Breakpoint 4, Derived::~Derived (this=0x7fffffffdab0, __in_chrg=&lt;optimized out&gt;) at test.cc:29
  29          std::cout &lt;&lt; "Derived d'tor" &lt;&lt; std::endl;
  $3 = (Derived * const) 0x7fffffffdab0
  0x7fffffffdab0: 0x0000000000400dd8  0x597870ad9bc42900
  0x7fffffffdac0: 0x0000000000400d10  0x00007ffff7495830
  0x7fffffffdad0: 0x0000000000000000  0x00007fffffffdba8
  0x7fffffffdae0: 0x00000001ffffdbb8  0x0000000000400ab6
  0x7fffffffdaf0: 0x0000000000000000  0x9e98039144430dd4
  0x400dd8 &lt;vtable for Derived+16&gt;:   0x0000000000400c68  0x0000000000400ce2
  0x400de8 &lt;vtable for Base&gt;: 0x0000000000000000  0x0000000000400e30
  0x400df8 &lt;vtable for Base+16&gt;:  0x0000000000400b92  0x0000000000400bde
  0x400e08 &lt;typeinfo for Derived&gt;:    0x0000000000602200  0x0000000000400e20
  0x400e18 &lt;typeinfo for Derived+16&gt;: 0x0000000000400e30  0x6465766972654437
  Derived d'tor
  
  Breakpoint 2, Base::~Base (this=0x7fffffffdab0, __in_chrg=&lt;optimized out&gt;) at test.cc:13
  13          std::cout &lt;&lt; "Base d'tor" &lt;&lt; std::endl;
  $4 = (Base * const) 0x7fffffffdab0
  0x7fffffffdab0: 0x0000000000400df8  0x597870ad9bc42900
  0x7fffffffdac0: 0x0000000000400d10  0x00007ffff7495830
  0x7fffffffdad0: 0x0000000000000000  0x00007fffffffdba8
  0x7fffffffdae0: 0x00000001ffffdbb8  0x0000000000400ab6
  0x7fffffffdaf0: 0x0000000000000000  0x9e98039144430dd4
  0x400df8 &lt;vtable for Base+16&gt;:  0x0000000000400b92  0x0000000000400bde
  0x400e08 &lt;typeinfo for Derived&gt;:    0x0000000000602200  0x0000000000400e20
  0x400e18 &lt;typeinfo for Derived+16&gt;: 0x0000000000400e30  0x6465766972654437
  0x400e28 &lt;typeinfo name for Derived+8&gt;: 0x0000000000000000  0x0000000000602090
  0x400e38 &lt;typeinfo for Base+8&gt;: 0x0000000000400e40  0x0000006573614234
  Base d'tor
  [Inferior 1 (process 4962) exited normally]
  (gdb) (gdb) quit
  </code></pre>
  
  <p>But the stacktrace for my real application (not the little demo above) hits:</p>
  
  <pre><code>__cxxabiv1::__cxa_pure_virtual ()
  </code></pre>
  
  <p>while the last d'tor i see on the call stack is the <strong>derived</strong> class.<BR>
  So is this an indicator, that memory object was already free'd and re-used again for some other object instance?</p>