Changeset: fix-generic-inspectOne-with-truncation.cs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Changeset: fix-generic-inspectOne-with-truncation.cs

Christoph Thiede

Hi all!


Jan Ehmueller and Fabio (fn) have discovered an Inspector bug with #inspectOne/"inspect element..." in the field list menu that hindered users from entering the index of a truncated element in the inspect element dialog. Possible ways to reproduce the issue include:


  • Inspector openOn: (Array new: 1024) -> … -> Click -> 90 -> Enter
  • (SmalltalkImage>>#snapshot:andQuit:withExitCode:embedded:) inspect -> right click self -> inspect element... -> 450 -> Enter (might depend on Sista)
  • TruffleSqueak was also affected: https://github.com/hpi-swa/trufflesqueak/issues/143

The attached changeset attempts to fix the bug.

Changelog:

Problem: The variant of Inspector >> #inspectOne, as it is now in the trunk, fails if the key is the value for a field that has been truncated. Because in this place, explicitly only the keys of self fields are passed to #inspectOneOf: which are already truncated. The bug does not affect CollectionInspectors which passes the elementIndices directly to #inspectOneOf: without the need of having fields.
Solution: I have now essentially pushed this logic from CollectionInspector with #elementIndices up to Inspector. This should make it run again.

Please review and merge if you don't have any further objections. :-)

Best,
Christoph




fix-generic-inspectOne-with-truncation.1.cs (5K) Download Attachment
Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Changeset: fix-generic-inspectOne-with-truncation.cs

fniephaus
Thanks, Christoph! The changeset looks good to me and fixes our issue.
Nonetheless, it's probably better if Marcel reviews and merges it.
Marcel, could you have a look please?

Many thanks,
Fabio

On Fri, May 14, 2021 at 4:29 PM Thiede, Christoph
<[hidden email]> wrote:

>
> Hi all!
>
>
> Jan Ehmueller and Fabio (fn) have discovered an Inspector bug with #inspectOne/"inspect element..." in the field list menu that hindered users from entering the index of a truncated element in the inspect element dialog. Possible ways to reproduce the issue include:
>
>
> Inspector openOn: (Array new: 1024) -> … -> Click -> 90 -> Enter
> (SmalltalkImage>>#snapshot:andQuit:withExitCode:embedded:) inspect -> right click self -> inspect element... -> 450 -> Enter (might depend on Sista)
> TruffleSqueak was also affected: https://github.com/hpi-swa/trufflesqueak/issues/143
>
>
> The attached changeset attempts to fix the bug.
>
> Changelog:
>
> Problem: The variant of Inspector >> #inspectOne, as it is now in the trunk, fails if the key is the value for a field that has been truncated. Because in this place, explicitly only the keys of self fields are passed to #inspectOneOf: which are already truncated. The bug does not affect CollectionInspectors which passes the elementIndices directly to #inspectOneOf: without the need of having fields.
> Solution: I have now essentially pushed this logic from CollectionInspector with #elementIndices up to Inspector. This should make it run again.
>
> Please review and merge if you don't have any further objections. :-)
>
> Best,
> Christoph
>
>