[Vm-dev] JPEGReadWriter2Plugin crash fixed

David T. Lewis lewis at mail.msen.com
Sat Apr 28 01:02:12 UTC 2012


This bug was fixed by John McIntosh and added to VMMaker trunk in
VMMaker-dtl.192 (9 October 2010). John's fix needs to be merged back
into the oscog branch for the Cog VMs. Currently this issue affects
interpreter VMs built prior to October 2010, and all current Cog VMs.

Details at http://bugs.squeak.org/view.php?id=7691

P?hi,

Thank you for tracking this problem down. If you would like to see
the Smalltalk source code that corresponds to your fix, try loading
VMMaker (from source.squeak.org). In that package you will find class
JPEGReadWriter2Plugin. This is the class that is translated into the
C code module that you fixed. There are four lines of code that you
changed in the JPEGReadWriter2Plugin2.c module, and these in the methods
#primJPEGWriteImage:onByteArray:form:quality:progressiveJPEG:errorMgr:
and #primJPEGReadImage:fromByteArray:onForm:doDithering:errorMgr:
which are the Smalltalk methods that are translated into the C function
primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgr() and
primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgr().

In this case, the source code is actually C code embedded in the
Smalltalk method, but the patch still needs to be applied here
because the C module is alway generated from the Smalltalk, and
a patch to the generated C module would be overwritten whenever the
code is regenerated.

Thanks for reporting this!

Dave


On Fri, Apr 27, 2012 at 08:32:35AM -0400, David T. Lewis wrote:
>  
> P?hi,
> 
> Excellent! Thank you very much.
> 
> I put this on Mantis also: http://bugs.squeak.org/view.php?id=7691
> 
> The fix is for the Slang in VMMaker, so we will need to apply it there.
> I'll look into it over the weekend if nobody has gotten to it sooner :)
> 
> Bravo for fixing an old and serious bug!
> 
> Dave
> 
> 
> On Fri, Apr 27, 2012 at 10:02:43AM +0200, P?hi Andr?s wrote:
> >  
> > Hi,
> > 
> > I have found the origin of various crashes in the Squeak VM, which is related to the JPEGReadWriter2Plugin.
> > The hunt begun with Juan's Cuis 4.0 release, see the emails exchanged below and the description.
> > 
> > I have attached the fixed C source, but the fix should go in the VM sources, because the code is
> > generated as I see. Please include the fix in the VM sources.
> > 
> > Regards,
> > Andras Pahi
> > 
> > ----- Original Message ----- 
> > From: Juan Vuletich (mail lists) 
> > To: P?hi Andr?s 
> > Sent: Thursday, April 26, 2012 9:26 PM
> > Subject: Re: Cuis 4.0 crash on startup
> > 
> > 
> > Wow P?hi! This is great! Please send all this to the vm-dev mail list, and ask for it to be included (or directions to do it yourself).
> > 
> > It is my bug in the end... I wrote JPEGReadWriter2Plugin about 10 years ago...
> > 
> > Cheers,
> > 
> > Juan Vuletich
> > 
> > 
> > Quoting P?hi Andr?s <pahia at t-online.hu>:
> > 
> >   Hi,
> > 
> >   Replace the winbuild/src/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c file with the attached file,
> >   recompile the Squeak VM and Cuis 4.0 rocks. In the plugin there was a 1 off access in the formBits array.
> >   Because the code is generated, it needs to be corrected in the VM sources.
> > 
> >   How can I got there ?
> > 
> >   Executing several times World buildMagnifiedBackgroundImage in Cuis 3.3 crashed the Squeak VM.
> >   I exported the background image data, converted from JPEG to other format (BMP/PNG) and set the new
> >   format image to World backgroundImageData:. Everything worked as expected.
> >   I replaced the formBits array accesses in JPEGReadWriter2Plugin2.c with my routines, checking the indices
> >   and reporting off-array access attempts. Then I fixed the places in the C source.
> > 
> >   Regards,
> >   Andras Pahi
> >   ----- Original Message ----- 
> >     From: Juan Vuletich (mail lists) 
> >     To: P?hi Andr?s 
> >     Sent: Thursday, April 26, 2012 12:47 PM
> >     Subject: Re: Cuis 4.0 crash on startup
> > 
> > 
> >     Great. Thanks. You might ask for help or directions in the vm-dev mail list. I'm sure that several people are at least aware of the bug.
> > 
> >     Cheers,
> > 
> >     Juan Vuletich
> > 
> > 
> >     Quoting P?hi Andr?s <pahia at t-online.hu>:
> > 
> >       Hi,
> >       Thank you for your reply. I will dig into the issues with the Windows VM.
> >       Regards,
> >       Andras Pahi
> >         ----- Original Message ----- 
> >         From: Juan Vuletich (mail lists) 
> >         To: P?hi Andr?s 
> >         Sent: Thursday, April 26, 2012 11:59 AM
> >         Subject: Re: Cuis 4.0 crash on startup
> > 
> > 
> >         Hi P?hi,
> > 
> >         There is some problem with that Windows VM, not limited to Cuis. If you google "Squeak VM 4.1.1 windows crash" you'll find many results, for example http://bugs.squeak.org/view.php?id=7585 http://bugs.squeak.org/bug_view_advanced_page.php?bug_id=7686 and http://bugs.squeak.org/view.php?id=7523 .
> > 
> >         I'm not involved in the development of the Windows VM, all I can do is recommend using Cog until this is fixed somehow.
> > 
> >         Regards,
> > 
> >         Juan Vuletich
> > 
> > 
> >         Quoting P?hi Andr?s <pahia at t-online.hu>:
> > 
> >           Hi,
> >           I have just gave a shoot on Cuis 4.0 using SqueakVM 4.1.1 on Windows.
> >           It even does not start, the crash dump is attached, but with the latest 
> >           Cog VM it runs fine.
> >           I checked the older Cuis 3.3 image with the same SqueakVM, it runs fine.
> >           Regards,
> >           Andras Pahi
> > 
> > Cheers,
> > Juan Vuletich
> 


More information about the Vm-dev mailing list