tiff image crashes python on windows, or does it?

I am stumped by this one, I'm not even sure how to debug it.

the following code crashes immediately upon hitting enter on the last
line:

        from wxPython.wx import *
        myapp = wxPySimpleApp()
        myimg = wxImage('testcase.tif')

The error I get is:

'''The instruction at "0x00b3581c" referenced memory at "0x03b01000".
The memory could not be "read".

Click on OK to terminate the application'''

now here's the really strange part, if I use gdb to run python, I can
get past the above, and can even do:

        myimg.GetHeight()
        #returns the correct height
        myimg.GetWidth()
        #correct width
        myimg.SaveFile('filename.png', wxBITMAP_TYPE_PNG)

And it works!?! How can this be? I am very confused, is gdb doing
something other than observing what is going on? Is this Heisenberg
laughing at me?

The image loads just fine under linux, and this is only one of a few
images that cause this problem (that I know of, I have thousands of
images scanned in over the past 5 years)

Any help is appreciated, I would post the image here, but it has
confidential information on it.

Thanks,

Mark

Roach, Mark R. wrote:
[...]

now here's the really strange part, if I use gdb to run python, I can
get past the above, and can even do:

        myimg.GetHeight()
        #returns the correct height
        myimg.GetWidth()
        #correct width
        myimg.SaveFile('filename.png', wxBITMAP_TYPE_PNG)

And it works!?! How can this be? I am very confused, is gdb doing
something other than observing what is going on? Is this Heisenberg
laughing at me?

It could be as simple as the debugger loading the app in a different location in memory than normal, and therefore having different garbage in a memory location that just happens to be non-fatal.

The image loads just fine under linux, and this is only one of a few
images that cause this problem (that I know of, I have thousands of
images scanned in over the past 5 years)

Any help is appreciated, I would post the image here, but it has
confidential information on it.

If you can find an image that is not confidential that has this problem, please file a bug report about it and include the image.

Thanks.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!