The problem was that the code for sorting polygons around a vertex assumed that it was a manifold or boundary vertex. However in some cases the vertex could still be nonmanifold causing the crash. The cases where the sorting fails are now detected and these vertices are then marked as nonmanifold. Differential Revision: https://developer.blender.org/D14065