One possible solution is to make instance variables private to their defining class and force subclasses to use accessors to modify superclass states.
A language could also make it so that subclasses can control which inherited methods are exposed publicly.
[1][2] The following trivial example is written in the Java programming language and shows how a seemingly safe modification of a base class can cause an inheriting subclass to malfunction by entering an infinite recursion which will result in a stack overflow.
Calling the dynamically bound method inc2() on an instance of Sub will correctly increase the field counter by one.
This problem could have been avoided, by declaring the methods in the superclass as final, which would make it impossible for a sub-class to override them.