Mantis - Squeak
Viewing Issue Advanced Details
215 VM crash always 10-04-04 20:02 01-09-11 22:52
Nick Briggs  
0000215: JPEGReadWriter2Plugin seg faults on SPARC system because 'double' in structure not 8-byte aligned
Attempting to view a web page from the squeak web browser results in a segmentation fault from the Squeak VM.

Ian Piumarta diagnosed the problem (paraphrased):

The plugin code fails to respect the minimum alignment restrictions on the "cinfo" strcture (8-bytes on SPARC because of 'double' members). The glue code for the plugin allocates the space for the struct in a ByteArray, which only guarantees 4-byte alignment, and would be moveable by GC so padding is not a solution to this problem.

If the author of the JPEGReadWriter2Plugin is still around to fix it: the code needs to copy the info structure out of the ByteArray into a local buffer before passing it to the JPEG library routines, and then copy back, if it is modified, on the way out.
child of 0006671closed tim Build VMMaker for 3.9 

John Thornborrow   
07-24-08 10:58   
I'm experiencing the same symptoms on x86_64 with a 3.10.1 vm. I am unable to confirm if it is the same cause, as I don't know enough about C to even know where to start.