[Cuis-dev] Bug fix: Image freezes when inspecting objects with huge #printOn: results

Juan Vuletich juan at cuis.st
Mon Oct 30 14:40:50 PDT 2023

On 10/29/2023 6:28 PM, Nicolás Papagna Maldonado via Cuis-dev wrote:
> Hi folks,
> The attached changeset fixes a bug that caused the image to freeze 
> when inspecting objects with huge #printOn: results.
> To reproduce the error:
>    1. Open a workspace
>    2. Evaluate CompiledMethod allInstances inject: Dictionary new
>       into: [ :dict :method |  dict at: method put: method sourceCode.
>       dict ]
>    3. An inspector will be opened on the dictionary created above
>       Click on self
>    4. Notice the image hangs while waiting for the #printOn: message send.
> To fix this bug, I limited the time to print the selected item to 300 
> milliseconds and showed an appropriate error message when that happened.
> LMK your thoughts.
> Cheers,
> Nico PM

Hi Nico,

I think that using #valueWithin:onTimeout: is like shooting a mosquito 
with a gun. I preferred a solution with two parts:
- printing a Dictionary doesn't need to sort the keys. Dictionaries are 
not sorted.
- Any stepping morph that takes longer than its #stepTime will be 
limited in its stepping time so GUI stays (barely) responsive.

Updates now at GitHub.


Juan Vuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20231030/9433ba7a/attachment.htm>

More information about the Cuis-dev mailing list