Integer overflow with BitBlt rule 20 and depth 32

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

Re: Integer overflow with BitBlt rule 20 and depth 32

Juan Vuletich-4
 
David T. Lewis wrote:

>  
> On Sat, Oct 24, 2009 at 10:40:17AM -0300, Juan Vuletich wrote:
>  
>> What worries me a bit is the other changes I needed to do to be able to
>> run the Smalltalk BitBlt simulation and to do the translation. These are:
>> BitBltSimulator >> #oopForPointer:   "May be harmless"
>> CArrayAccessor >> #long32At:         "Why is this needed?"
>> CArrayAccessor >> #long32At:put:      "Why is this needed?"
>> CCodeGenerator >> #emitCConstantsOn:  "Consequence of recent changes to
>> Dictionary >> #keys. Most likely harmless. May be other senders aroud!
>> (yes, in the very same method there is another sender that would be
>> optimized by #asSet!"
>>
>> I've not been following the development of VMMaker closely enough to
>> advise on them, so please everybody, check and comment on them.
>>    
>
> Juan,
>
> I think I finally figured out why the #oopForPointer: and #long32At: and
> #long32At:put: are needed.
>
> I went back to look at Squeak 3.7 and Squeak 3.8 images with VMMaker as
> distributed in those images. The #testAlphaCompositingSimulated and
> #testAlphaCompositing2Simulated tests both pass in those older images.
>
> I then looked at a Squeak 3.8 with the latest VMMaker installed, and
> these two tests fail. The difference is that when the original 64-bit
> VM work was done in 2004, the #oopForPointer and #long32At: and
> #long32At:put: calls were added, but not implemented in BitBltSimulator
> and CArrayAccessor.  This was probably just an oversight, and the problem
> has not been noticed until you spotted it now.
>
> Therefore I think that your added #oopForPointer and #long32At: and
> #long32At:put: methods are correct, and that they do need to be added
> to VMMaker.
>
> Dave

Hi Dave,

Great! Thank you!

Cheers,
Juan Vuletich
Reply | Threaded
Open this post in threaded view
|

Re: Integer overflow with BitBlt rule 20 and depth 32

Juan Vuletich-4
In reply to this post by David T. Lewis
 
David T. Lewis wrote:

>  
> On Mon, Oct 26, 2009 at 11:57:16AM -0700, Eliot Miranda wrote:
>  
>> On Mon, Oct 26, 2009 at 11:07 AM, Juan Vuletich <[hidden email]> wrote:
>>
>>    
>>> Anyway, I'm asking for help on making #copyBitsSimulated work again, like
>>> it should do when called from BitBltTest. If nobody can help with that, I
>>> guess I'll open a Mantis issue for this problem, in the hope that some day
>>> it gets fixed.
>>>      
>> Well with my current VM I see no problems; all 10 tests are green.  What is
>> the bug that you see?  How can I reproduce it?
>>    
>
> Juan provided six new tests (see Mantis 7047) that document the problems.
> I added these six tests to the trunk today, and also updated VMMaker on
> SqueakSource with Juan's fixes for bitblt simulation (mainly some memory
> access methods that had apparently been overlooked during the original
> Squeak 64 bit work).
>
> Juan's patches (VMMaker-BitBlt-AlphaFixes-jmv-M7407.cs on Mantis 7047)
> do resolve the problems in the VM, and the changes all look correct to me
> (but I have no experience with bitblt, so I'm just commenting on the fixes
> for type declarations and arithmetic overflow).
>
> Has anyone else had a chance to review this? If there are no issues or
> concerns, I will add Juan's alpha fixes to VMMaker.
>
> Dave


Good. Thanks!

Cheers,
Juan Vuletich
Reply | Threaded
Open this post in threaded view
|

Re: Integer overflow with BitBlt rule 20 and depth 32

Juan Vuletich-4
In reply to this post by Henrik Sperre Johansen
 
Henrik Johansen wrote:
>
> Not that it matters on 32bit architecture, but don't you in theory
> have to use unsigned long to ensure an integer of at least 32 bits is
> used?

Squeak was never meant to run in 16 bit hardware. I believe that
attempts to generalize the assumption of 32bit in BitBlt (and many other
places) should focus on 64 bit. Not a current concern of mine, though.

> Other than that I see no problems, until someone decides to add depths
> > 32. (And then you'd have to modify the methods anyways).

Supporting depths of more than 32 bit would require a lot more than
modifying this few methods!

> Cheers,
> Henry

Thanks for reviewing!

Cheers,
Juan Vuletich
Reply | Threaded
Open this post in threaded view
|

Re: Integer overflow with BitBlt rule 20 and depth 32

David T. Lewis
In reply to this post by Juan Vuletich-4
 
On Fri, Oct 30, 2009 at 10:14:52AM -0300, Juan Vuletich wrote:

>
> David T. Lewis wrote:
> >
> >Juan's patches (VMMaker-BitBlt-AlphaFixes-jmv-M7407.cs on Mantis 7047)
> >do resolve the problems in the VM, and the changes all look correct to me
> >(but I have no experience with bitblt, so I'm just commenting on the fixes
> >for type declarations and arithmetic overflow).
> >
> >Has anyone else had a chance to review this? If there are no issues or
> >concerns, I will add Juan's alpha fixes to VMMaker.
> >
> >Dave
>
>
> Good. Thanks!
Hi Juan,

There are a couple of spelling error in comments in your alpha
patches for bitblt. I corrected them by editing the change set
as follows:

  #!/bin/sh
  sed 's/aritm/arithm/g' VMMaker-BitBlt-AlphaFixes-jmv-M7407.cs \
    | sed 's/operarions/operations/g' \
    > VMMaker-BitBlt-AlphaFixes-jmv-M7407-patched.cs

May I have your permission to use the edited version in VMMaker?
This preserves your author initials and time stamps but corrects
the minor spelling errors.

This may sound like a silly request, but I did not want to modify
any methods with your initials without asking you first.

Thanks,
Dave


VMMaker-BitBlt-AlphaFixes-jmv-M7407-patched.cs (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Integer overflow with BitBlt rule 20 and depth 32

Juan Vuletich-4
 
David T. Lewis wrote:

> On Fri, Oct 30, 2009 at 10:14:52AM -0300, Juan Vuletich wrote:
>  
>> David T. Lewis wrote:
>>    
>>> Juan's patches (VMMaker-BitBlt-AlphaFixes-jmv-M7407.cs on Mantis 7047)
>>> do resolve the problems in the VM, and the changes all look correct to me
>>> (but I have no experience with bitblt, so I'm just commenting on the fixes
>>> for type declarations and arithmetic overflow).
>>>
>>> Has anyone else had a chance to review this? If there are no issues or
>>> concerns, I will add Juan's alpha fixes to VMMaker.
>>>
>>> Dave
>>>      
>> Good. Thanks!
>>    
>
> Hi Juan,
>
> There are a couple of spelling error in comments in your alpha
> patches for bitblt. I corrected them by editing the change set
> as follows:
>
>   #!/bin/sh
>   sed 's/aritm/arithm/g' VMMaker-BitBlt-AlphaFixes-jmv-M7407.cs \
>     | sed 's/operarions/operations/g' \
>     > VMMaker-BitBlt-AlphaFixes-jmv-M7407-patched.cs
>
> May I have your permission to use the edited version in VMMaker?
> This preserves your author initials and time stamps but corrects
> the minor spelling errors.
>
> This may sound like a silly request, but I did not want to modify
> any methods with your initials without asking you first.
>
> Thanks,
> Dave

Hi Dave,

Sure, thanks!

I guess you can tell I'm not a native English speaker... I do my best,
but I do those mistakes from time to time. That's something that would
be very useful to me, an English spelling checker for comments. I always
use one for my email!

Cheers,
Juan Vuletich
Reply | Threaded
Open this post in threaded view
|

Re: Integer overflow with BitBlt rule 20 and depth 32

David T. Lewis
In reply to this post by David T. Lewis
 
On Thu, Oct 29, 2009 at 10:10:42PM -0400, David T. Lewis wrote:

>
> Juan provided six new tests (see Mantis 7047) that document the problems.
> I added these six tests to the trunk today, and also updated VMMaker on
> SqueakSource with Juan's fixes for bitblt simulation (mainly some memory
> access methods that had apparently been overlooked during the original
> Squeak 64 bit work).
>
> Juan's patches (VMMaker-BitBlt-AlphaFixes-jmv-M7407.cs on Mantis 7047)
> do resolve the problems in the VM, and the changes all look correct to me
> (but I have no experience with bitblt, so I'm just commenting on the fixes
> for type declarations and arithmetic overflow).
>
> Has anyone else had a chance to review this? If there are no issues or
> concerns, I will add Juan's alpha fixes to VMMaker.

Added to VMMaker-dtl.147 on SqueakSource. The new tests are now in Squeak
trunk, and corresponding fixes are in VMMaker. The issue is set to "testing"
in Mantis 7407.

Dave

Reply | Threaded
Open this post in threaded view
|

Re: Integer overflow with BitBlt rule 20 and depth 32

Juan Vuletich-4
 
David T. Lewis wrote:

>  
> On Thu, Oct 29, 2009 at 10:10:42PM -0400, David T. Lewis wrote:
>  
>> Juan provided six new tests (see Mantis 7047) that document the problems.
>> I added these six tests to the trunk today, and also updated VMMaker on
>> SqueakSource with Juan's fixes for bitblt simulation (mainly some memory
>> access methods that had apparently been overlooked during the original
>> Squeak 64 bit work).
>>
>> Juan's patches (VMMaker-BitBlt-AlphaFixes-jmv-M7407.cs on Mantis 7047)
>> do resolve the problems in the VM, and the changes all look correct to me
>> (but I have no experience with bitblt, so I'm just commenting on the fixes
>> for type declarations and arithmetic overflow).
>>
>> Has anyone else had a chance to review this? If there are no issues or
>> concerns, I will add Juan's alpha fixes to VMMaker.
>>    
>
> Added to VMMaker-dtl.147 on SqueakSource. The new tests are now in Squeak
> trunk, and corresponding fixes are in VMMaker. The issue is set to "testing"
> in Mantis 7407.
>
> Dave

Thank you Dave!

Cheers,
Juan Vuletich
Reply | Threaded
Open this post in threaded view
|

Re: Integer overflow with BitBlt rule 20 and depth 32

David T. Lewis
 
On Tue, Nov 03, 2009 at 10:37:40AM -0300, Juan Vuletich wrote:
>
> David T. Lewis wrote:
> >
> >Added to VMMaker-dtl.147 on SqueakSource. The new tests are now in Squeak
> >trunk, and corresponding fixes are in VMMaker. The issue is set to
> >"testing"
> >in Mantis 7407.
>
> Thank you Dave!

Juan,

Um, well ... thank you for identifying the issue, opening the Mantis report,
writing the tests, diagnosing the problem, and implementing the fixes :)

Cheers,
Dave

Reply | Threaded
Open this post in threaded view
|

Re: Integer overflow with BitBlt rule 20 and depth 32

Juan Vuletich-4
 
David T. Lewis wrote:

>  
> On Tue, Nov 03, 2009 at 10:37:40AM -0300, Juan Vuletich wrote:
>  
>> David T. Lewis wrote:
>>    
>>> Added to VMMaker-dtl.147 on SqueakSource. The new tests are now in Squeak
>>> trunk, and corresponding fixes are in VMMaker. The issue is set to
>>> "testing"
>>> in Mantis 7407.
>>>      
>> Thank you Dave!
>>    
>
> Juan,
>
> Um, well ... thank you for identifying the issue, opening the Mantis report,
> writing the tests, diagnosing the problem, and implementing the fixes :)
>
> Cheers,
> Dave
>  

:)

Cheers,
Juan Vuletich

12