All right, I'm not checking that code. There are just 2 comments and one
of them is wrong (just copied from the first).
I'd suspect you're on the right track though; the algorithm is
obviously falling into an infinite recursion. Sorts usually work by
mapping an array to itself over and again a set number of times, and I'd
suspect that the mapping is somehow either generating duplicate variable
names (in the abstract representation of the variable name list) or a
pair of variable names is being swapped back and forward over and over
until infinity.
These algorithms really need good comments, even if just a reference to
a paper or website or something. Please, whoever makes the next release,
don't forget to do that.