Strange accessors/instvars bug

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

Strange accessors/instvars bug

tallman@inbox.ru
I locate some strange bug when I working for Seaside on Sails.
How to look at it:
    1) load http://richart-consalt.ru/Sails.bugged.zip, unpack it (all
needed including VM inside)
    2) run it
    3) in left top corner you'll see workspace with strings
                    SailsTest test2.

                    blg:=BlogPost new.
                    blg title:'1111'.
                    blg title
                    blg comments
    4) say "do it" to strings                  
                    blg:=BlogPost new.
                    blg title:'1111'.
    5) and then say "print it" to strings
                    blg title
                    blg comments

It prints '1111' both for comments and title accessors.
But BlogPost is quite simple object: Object child with 3 instvars:
title, post, comments. comments:=OrderedCollection new in initialize.
Accessors (automatically made) for all 3 instvars. Nothing more.
So "blg comments" must return emty ordered collection, not a title string...

Some more comments:
a) Sometimes both title and comments accessors returns empty ordered
collection
b) If you inspect blg, you will see strange instvars values sometimes
and sometimes - normal values (but accessos still return buggy values)
c) Bug disappear as fast as I locate it and put breakpoints to accessor
to catch it.
d) Bug can interact not only with workspace, as far as it disappeare my
Seaside example become functional (it failed before, becouse #add: was
applied to title string returned by comments accessor).

==============
Assargadon
[hidden email]
http://headache.h1.ru

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Strange accessors/instvars bug

Damien Cassou-3
I haven't tried your image, but I guess some of your methods must be
recompiled.

2007/7/26, [hidden email] <[hidden email]>:

> I locate some strange bug when I working for Seaside on Sails.
> How to look at it:
>     1) load http://richart-consalt.ru/Sails.bugged.zip, unpack it (all
> needed including VM inside)
>     2) run it
>     3) in left top corner you'll see workspace with strings
>                     SailsTest test2.
>
>                     blg:=BlogPost new.
>                     blg title:'1111'.
>                     blg title
>                     blg comments
>     4) say "do it" to strings
>                     blg:=BlogPost new.
>                     blg title:'1111'.
>     5) and then say "print it" to strings
>                     blg title
>                     blg comments
>
> It prints '1111' both for comments and title accessors.
> But BlogPost is quite simple object: Object child with 3 instvars:
> title, post, comments. comments:=OrderedCollection new in initialize.
> Accessors (automatically made) for all 3 instvars. Nothing more.
> So "blg comments" must return emty ordered collection, not a title string...
>
> Some more comments:
> a) Sometimes both title and comments accessors returns empty ordered
> collection
> b) If you inspect blg, you will see strange instvars values sometimes
> and sometimes - normal values (but accessos still return buggy values)
> c) Bug disappear as fast as I locate it and put breakpoints to accessor
> to catch it.
> d) Bug can interact not only with workspace, as far as it disappeare my
> Seaside example become functional (it failed before, becouse #add: was
> applied to title string returned by comments accessor).
>
> ==============
> Assargadon
> [hidden email]
> http://headache.h1.ru
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>


--
Damien Cassou

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Strange accessors/instvars bug

Mathieu SUEN
In reply to this post by tallman@inbox.ru
It seems to  be a bug from the refactoring which create the accessor.

To recompile the class simply execute:

BlogPost compileAll

        Mth



On Jul 26, 2007, at 12:56 PM, [hidden email] wrote:

> I locate some strange bug when I working for Seaside on Sails.
> How to look at it:
>     1) load http://richart-consalt.ru/Sails.bugged.zip, unpack it (all
> needed including VM inside)
>     2) run it
>     3) in left top corner you'll see workspace with strings
>                     SailsTest test2.
>
>                     blg:=BlogPost new.
>                     blg title:'1111'.
>                     blg title
>                     blg comments
>     4) say "do it" to strings
>                     blg:=BlogPost new.
>                     blg title:'1111'.
>     5) and then say "print it" to strings
>                     blg title
>                     blg comments
>
> It prints '1111' both for comments and title accessors.
> But BlogPost is quite simple object: Object child with 3 instvars:
> title, post, comments. comments:=OrderedCollection new in initialize.
> Accessors (automatically made) for all 3 instvars. Nothing more.
> So "blg comments" must return emty ordered collection, not a title  
> string...
>
> Some more comments:
> a) Sometimes both title and comments accessors returns empty ordered
> collection
> b) If you inspect blg, you will see strange instvars values sometimes
> and sometimes - normal values (but accessos still return buggy values)
> c) Bug disappear as fast as I locate it and put breakpoints to  
> accessor
> to catch it.
> d) Bug can interact not only with workspace, as far as it  
> disappeare my
> Seaside example become functional (it failed before, becouse #add: was
> applied to title string returned by comments accessor).
>
> ==============
> Assargadon
> [hidden email]
> http://headache.h1.ru
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki