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

Andres Valloud ten at smallinteger.com
Mon Oct 30 20:51:25 PDT 2023


Generally, no tools should cause too much demands on the running system, 
because you never know if the user will need the tools to diagnose a low 
resource situation.  Object>>printStringLimitedTo:?

On 10/30/23 2:40 PM, Juan Vuletich via Cuis-dev wrote:
> 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.
> 
> Thanks,
> 
> -- 
> Juan Vuletich
> cuis.st
> github.com/jvuletich
> researchgate.net/profile/Juan-Vuletich
> independent.academia.edu/JuanVuletich
> patents.justia.com/inventor/juan-manuel-vuletich
> linkedin.com/in/juan-vuletich-75611b3
> twitter.com/JuanVuletich
> 
> 


More information about the Cuis-dev mailing list