Stability analysis of the carbuncle phenomenon and the sonic point glitch