How is Sayano Shushenka accident a software bug? IIRC the cause was faulty turbine and metal fatigue.
The final failure of the turbine was caused by the software failing to regulate the turbine pressure in controlled regions, a small bug in the operating software did not close the inlet valve, the turbine was literally overspeeding into a region, that was not recommended for operation, even for a intact turbine.
On the day of accident the turbines worked at working level 212 metres (696 ft). At this pressure the recommended power band for the turbines is 570–640 MW (band III) and the allowed band is 0-265 MW also (band I). Band 265–570 MW (band II) at this pressure is not recommended and output over 640 MW (band IV) is forbidden. On the day of accident turbine 2 worked as the plants power output regulator and due to this, its output power changed constantly. The turbine often operated in band II regime which is accompanied with pulsation and strokes of water flow.
It was initially in band III, was dropped into band II (again), in which the control of the turbine failed, because of the pulsations. Quickly reducing the power output of the turbine results in the rotor being pushed upwards (on all such turbines), which is why you have the software to prevent entering such regions during normal operations.
If the turbine would have been intact, the damage would have been contained inside the reinforced turbine structure, but in this case, it was no longer contained, causing the catastrophe. Such events are always a chain of failures on multiple points, there is no single event that causes high damage.