[pygtk] Strange crash issue on Windows w/ PyGTK, Cairo..
Steve
stevech1097 at yahoo.com.au
Fri Mar 20 12:20:08 WST 2009
On Fri, 2009-03-20 at 02:57 +0900, pygtk-request at daa.com.au wrote:
> David Ripton wrote:
> > Utterly terrifying that something as fundamental as zlib
> would be broken
> > on a platform as common as Windows.
>
> Actually, I suppose it's still *possible* that it's a Cairo
> function
> which is getting in the way, instead, and the zlib change
> merely brings
> it to light? I'm not quite sure anymore.
>
> Here's a reproducible script and data:
>
> http://apocalyptech.com/pygtk-zlib/
>
> Would someone mind taking a look quick and let me know if this
> is
> something I should submit to Python or PyGTK's tracker?
> Thanks...
Your file-like object is not completely consistent with the standard
Python file.read(size)
- 'read' uses 'size' not 'sizehint' (but its only an argument name so
should not be a problem)
- 'read' returns an empty string is returned when EOF (not None)
It looks like the bug is in:
your file-like object,
Python core or Python zlib module (the Windows implementation), or
Pycairo,
but definitely not in PyGTK - so the problem is not relevant to this
mailing list - Pycairo is not part of PyGTK.
The Pycairo code for cairo.ImageSurface.create_from_png is exactly the
same for Linux as for Windows, and on Linux it works OK. So this would
suggest that Pycairo is not the cause of the problem.
The GfxCairoHelper class is redundant - you have essentially
reimplemented the standard Python file-like object StringIO.StringIO.
Try replacing
surface = cairo.ImageSurface.create_from_png(GfxCairoHelper(filedata))
with
surface =cairo.ImageSurface.create_from_png(StringIO.StringIO(filedata))
and testing on Windows.
If it works OK then your file-like object is the bug; if it fails you
now have an even smaller test case to continue investigating.
> On an XP system of mine, removing "import os" and "import sys"
> will
> "fix" the problem. On a win2k machine I can get rid of those
> imports and
> still see the crash, though. It's definitely a
> memory-clobbering
> bug of some sort, I'm just not quite sure where.
>
> Thanks!
>
> -CJ
>
> --
> WOW: Flemmy | "Happiness isn't good enough for
> me! I
> pez at apocalyptech.com | demand euphoria!"
> 24.24.2.3171 | - Calvin
>
Steve
More information about the pygtk
mailing list