pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Solving Printing infinite loop and crashing image in Printing of Array with self Array in it

Open DanielCamSan opened this issue 3 years ago • 2 comments

The problem was that when we are trying to print an Array the image crash and it was that it entering in an infinite loop so now is refering to the printing as the same way than OrderedCollection

DanielCamSan avatar Jul 29 '22 14:07 DanielCamSan

Thanks for opening this pull request! Now continious integration (CI) will build Pharo with your change and run all tests. This might fail due to many reasons! Please check if your PR breaks the build or makes tests fail. Feel free to add comments to the PR. After this, before your PR can be merged it needs one or more reviews. Do not hesitate to ask people (on the Mailinglist or Discord) to help! When the CI shows no problems and there are positive reviews, your PR will be merged.

welcome[bot] avatar Jul 29 '22 14:07 welcome[bot]

But this only checks a very simple case (one level deep). You can create self-referring structures that are much deeper before they cycle. No ?

svenvc avatar Jul 29 '22 14:07 svenvc

I agree with @svenvc. This is not a correct solution. We need to be able to detect loops no matter how deep they are.

Actually, we need to fix the printOn: method in Collection to handle loops and that should fix Array printOn: too.

jordanmontt avatar Oct 27 '22 14:10 jordanmontt

fixed by merging https://github.com/pharo-project/pharo/pull/11916

MarcusDenker avatar Nov 30 '22 17:11 MarcusDenker