in reply to Sort by -M

The problem does not lie in sort nor -M but rather you've data (external files/directories) being modified after read (readdir?). More than one thread/process making modification to shared data.