I'm tripping an assert that Derek and John are not seeing. From the debugging session below, I have no idea why, unless they really aren't building with DEBUG on.

Reproduce with: ./ex3-dbg -d 2


#ifdef DEBUG
    libmesh_assert (tot_size == di.size());
#endif

... because tot_size is 6, di.size() is 9

tot_size is set by

        tot_size += FEInterface::n_dofs(dim,
                                        fe_type,
type);


The arguments were

dim = 2
fe_type = {.order = libMeshEnums::SECOND, .family = libMeshEnums::LAGRANGE}
type = libMeshEnums::QUAD9

and the value 6 is returned from fe_xyz.C:931 by

 case TRI3:
 case TRI6:
 case QUAD4:
 case QUAD8:
 case QUAD9:
   return 6;


I don't understand this interpretation of n_dofs(), but elem->n_nodes() returns 9 which makes perfect sense to me. Internals of elem below.

(gdb) p *elem
$22 = {
  <libMesh::ReferenceCountedObject<libMesh::Elem>> = {
    <libMesh::ReferenceCounter> = {
      _vptr.ReferenceCounter = 0x7ffff7d8b3f0,
      static _counts = {
        <std::__cxx1998::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<unsigned int, unsigned int>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > >> = {
          _M_t = {
            _M_impl = {
              <std::allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > >> = {
                <__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > >> = {<No data fields>}, <No data fields>},
              members of std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > >::_Rb_tree_impl<std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, false>:
              _M_key_compare = {
                <std::binary_function<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>> = {<No data fields>}, <No data fields>},
              _M_header = {
                _M_color = std::_S_red,
                _M_parent = 0x946c50,
                _M_left = 0x946d10,
                _M_right = 0x67feb0
              },
              _M_node_count = 11
            }
          }
        },
        <__gnu_debug::_Safe_sequence<std::__debug::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<unsigned int, unsigned int>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > > >> = {
          <__gnu_debug::_Safe_sequence_base> = {
            _M_iterators = 0x0,
            _M_const_iterators = 0x0,
            _M_version = 1
          }, <No data fields>}, <No data fields>},
      static _n_objects = {
        <tbb::atomic<unsigned int>> = {
          <tbb::internal::atomic_impl_with_arithmetic<unsigned int, unsigned int, char>> = {
            <tbb::internal::atomic_impl<unsigned int>> = {
              rep = {
                value = 2384
              }
            }, <No data fields>}, <No data fields>}, <No data fields>},
      static _mutex = {
        flag = 0 '\000',
        static is_rw_mutex = false,
        static is_recursive_mutex = false,
        static is_fair_mutex = false
      },
      static _enable_print_counter = true
    }, <No data fields>},
  <libMesh::DofObject> = {
    <libMesh::ReferenceCountedObject<libMesh::DofObject>> = {
      <libMesh::ReferenceCounter> = {
        _vptr.ReferenceCounter = 0x7ffff7d8b578,
        static _counts = {
          <std::__cxx1998::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<unsigned int, unsigned int>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > >> = {
            _M_t = {
              _M_impl = {
                <std::allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > >> = {
                  <__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > >> = {<No data fields>}, <No data fields>},
                members of std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > >::_Rb_tree_impl<std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, false>:
                _M_key_compare = {
                  <std::binary_function<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>> = {<No data fields>}, <No data fields>},
                _M_header = {
                  _M_color = std::_S_red,
                  _M_parent = 0x946c50,
                  _M_left = 0x946d10,
                  _M_right = 0x67feb0
                },
                _M_node_count = 11
              }
            }
          },
          <__gnu_debug::_Safe_sequence<std::__debug::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<unsigned int, unsigned int>, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<unsigned int, unsigned int> > > > >> = {
            <__gnu_debug::_Safe_sequence_base> = {
              _M_iterators = 0x0,
              _M_const_iterators = 0x0,
              _M_version = 1
            }, <No data fields>}, <No data fields>},
        static _n_objects = {
          <tbb::atomic<unsigned int>> = {
            <tbb::internal::atomic_impl_with_arithmetic<unsigned int, unsigned int, char>> = {
              <tbb::internal::atomic_impl<unsigned int>> = {
                rep = {
                  value = 2384
                }
              }, <No data fields>}, <No data fields>}, <No data fields>},
        static _mutex = {
          flag = 0 '\000',
          static is_rw_mutex = false,
          static is_recursive_mutex = false,
          static is_fair_mutex = false
        },
        static _enable_print_counter = true
      }, <No data fields>},
    members of libMesh::DofObject:
    old_dof_object = 0x0,
    static invalid_id = 4294967295,
    static invalid_processor_id = 65535,
    _id = 0,
    _processor_id = 0,
    _idx_buf = {
      <std::__cxx1998::vector<unsigned int, std::allocator<unsigned int> >> = {
        <std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >> = {
          _M_impl = {
            <std::allocator<unsigned int>> = {
              <__gnu_cxx::new_allocator<unsigned int>> = {<No data fields>}, <No data fields>},
            members of std::__cxx1998::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_impl:
            _M_start = 0x94f430,
            _M_finish = 0x94f43c,
            _M_end_of_storage = 0x94f43c
          }
        }, <No data fields>},
      <__gnu_debug::_Safe_sequence<std::__debug::vector<unsigned int, std::allocator<unsigned int> > >> = {
        <__gnu_debug::_Safe_sequence_base> = {
          _M_iterators = 0x0,
          _M_const_iterators = 0x0,
          _M_version = 1
        }, <No data fields>},
      members of std::__debug::vector<unsigned int, std::allocator<unsigned int> >:
      _M_guaranteed_capacity = 3
    }
  },
  members of libMesh::Elem:
  static type_to_n_nodes_map = {2, 3, 4, 3, 6, 4, 8, 9, 4, 10, 8, 20, 27, 6, 15, 18, 5, 2, 4, 6, 8, 16, 18, 6, 16, 1, 0},
  _nodes = 0x937b78,
  _elemlinks = 0x937b48,
  _children = 0x0,
  _rflag = 1 '\001',
  _pflag = 1 '\001',
  _p_level = 0 '\000',
  _sbd_id = 0,
  static _bp1 = 65449,
  static _bp2 = 48661
}