Yep, I'm running on a 64 bit machine. I've been dealing with larger
than 4GB data files in IDL, but I'd rather use python/numpy/matplotlib
Here's the gdb session. The error didn't happen in imshow, only when
I specified show(); I guess that means I must have had ioff() set
although I don't think that was my default choice last time I used
milkyway /data/glimpseii $ gdb /usr/local/python/bin/python
GNU gdb Red Hat Linux (22.214.171.124-1.159.el4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/tls/libthread_db.so.1".
Starting program: /usr/local/python/bin/python
[Thread debugging using libthread_db enabled]
[New Thread 182900715072 (LWP 18039)]
Python 2.5 (r25:51908, Dec 22 2006, 16:08:43)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib,scipy,numpy,pyfits
>>> from pylab import *
>>> f = pyfits.open('GLM_00600+0000_mosaic_I3.fits')
<matplotlib.image.AxesImage object at 0x2aa3f45890>
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182900715072 (LWP 18039)]
0x0000002aa3170ab5 in _image_module::fromarray (this=Variable "this"
is not available.
) at src/image.cpp:872
872 src/image.cpp: No such file or directory.
Current language: auto; currently c++
I've never used gdb before, so is there anything else I should be
doing at this point?
On Fri, Apr 24, 2009 at 7:52 AM, Michael Droettboom <mdroe@...> wrote:
> On my machine (32-bit Fedora 10 with 2GB RAM), it chugs along swapping for a loooong time and then fails with a Python MemoryError exception -- which is at least reasonable.
> I suspect you're running on a 64-bit machine and we're running into some sort of non-64-bit-clean issue. We try to be 64-bit clean, but it doesn't get verified on a regular basis, and not all of us (myself included) are running 64-bit OSes.
> Can you try running python inside of gdb and getting a traceback? That might provide some clues.
> We can estimate a little bit as to the memory requirements -- though it's hard to account for everything.
> Input array is (10370, 9320) x 4 = 386MB
> This array is always converted to doubles to convert to colors (this is probably a place ripe for opimtization) so you get also 786MB.
> Then this gets converted to an RGBA array for another 386MB
> Adam Ginsburg wrote:
>> Hi, I've been getting a segmentation fault when trying to display
>> large images. A transcript of a sample session is below. I'm using
>> the TkAgg backend, and I am using numpy, but otherwise I have made no
>> modifications to the matplotlib setup.
>> milkyway /data/glimpseii $ alias pylab
>> alias pylab='/usr/local/adm/config/python/bin/ipython -pylab -log'
>> milkyway /data/glimpseii $ pylab
>> Activating auto-logging. Current session state plus future input saved.
>> Filename : ipython_log.py
>> Mode : rotate
>> Output logging : False
>> Raw input log : False
>> Timestamping : False
>> State : active
>> Python 2.5 (r25:51908, Dec 22 2006, 16:08:43)
>> Type "copyright", "credits" or "license" for more information.
>> IPython 0.9.1 -- An enhanced Interactive Python.
>> ? -> Introduction and overview of IPython's features.
>> %quickref -> Quick reference.
>> help -> Python's own help system.
>> object? -> Details about 'object'. ?object also works, ?? prints more.
>> Welcome to pylab, a matplotlib-based Python environment.
>> For more information, type 'help(pylab)'.
>> In : import matplotlib,pyfits,numpy,scipy
>> In : scipy.__version__
>> Out: '0.7.0'
>> In : numpy.__version__
>> Out: '1.3.0'
>> In : matplotlib.__version__
>> Out: '0.98.5.2'
>> In : f = pyfits.open('GLM_00600+0000_mosaic_I3.fits')
>> In : f.data.shape
>> Out: (10370, 9320)
>> In : f.data.dtype
>> Out: dtype('>f4')
>> In : imshow(f.data)
>> Segmentation fault
>> Any ideas?