Search code examples
smalltalkpharo

If my Pharo image goes into an infinite loop, how do I break out of the loop?


Yesterday I was about 2 hours in to working on my Pharo image when I accidentally wrote some code and executed it that caused an infinite loop -- actually, I was calling one method from another method, which in turn called the original method, back and forth forever. The pharo image was unresponsive. I restarted the image and lost all my work for that two hours!

I looked online and I can hit alt-. to get into some sort of process viewer? How can I kill the infinite loop from there?


Solution

  • Apart from interrupting an infinite loop as @Uko explained, you probably do not have lost all your work for that two hours, as you feared.

    If you have killed Pharo externally without saving you could always use the

    • „Recover lost changes“ tool in the restarted image via World Menu>Tools>Recover lost changes… or
    • open the .changes file corresponding to your image in a text editor and have a look at all your past changes to the system and copy and paste some or all of them back to the running image.