Ring formation and fracture of a carbon nanotube