squeak-smalltalk / squeak-object-memory

Issues and assets related to the Squeak object memory.
https://bugs.squeak.org
MIT License
11 stars 1 forks source link

The inspector should not use unsafe storeString #115

Open nicolas-cellier-aka-nice opened 5 months ago

nicolas-cellier-aka-nice commented 5 months ago

Recipe for a disaster:

| window |
MCWorkingCopyBrowser open.
window := ToolSet inspect: DependentsFields.
window model selectionIndex: 95

What happens?

If we user-interrupted soon enough, debugging the problem is already a challenge.
Even if we use debugIt instead of doIt in the above code snippet, Morphic stepping will freeze the UI soon after setting the selectionIndex inst. var. of the Inspector.

What are the problem with storeString?

storeStringis for simple objects at best with simple graphs, its simplistic nature is otherwise a failure.

An inspector aiming at some robustness shall not invoke storeString.

timrowledge commented 5 months ago

storeString should have been either removed years ago, or replaced with sometihng SIXX-like that might actually work.

And an Inspector should not be using it either way.

On 2024-02-08, at 11:37 AM, Nicolas Cellier @.***> wrote:

storeString is for simple objects at best with simple graphs, it's simplistic nature is otherwise a failure.

An inspector aiming at some robustness shall not invoke storeString.

tim

tim Rowledge; @.***; http://www.rowledge.org/tim Spell checkers at maximum! Fire!

LinqLover commented 5 months ago

My motivation to use storeString here was that you can directly copy it into the "inspect element ..." prompt where you have to provide a key, or use it in a manual self at: ... expression. I get the disadvantages of this approach though ...

timrowledge commented 5 months ago

On 2024-02-08, at 3:12 PM, Christoph Thiede @.***> wrote:

My motivation to use storeString here was that you can directly copy it into the "inspect element ..." prompt where you have to provide a key, or use it in a manual self at: ... expression. I get the disadvantages of this approach though ...

A fair point, but I think we've seen that a better solution would be very much desired. After all, surely if you have a reference to an object so you can send it #storeString you can also just open an inspector directly on it? Or create a carrier-morph to let you drag it somewhere to torture later?

tim

tim Rowledge; @.***; http://www.rowledge.org/tim Strange OpCodes: VMB: Verify, then Make Bad