On the singularities of convex functions