[New-bugs-announce] [issue11207] Pythong seg fault with PIL/numpy

David Knapp report at bugs.python.org
Sun Feb 13 22:56:03 CET 2011

New submission from David Knapp <psychicsurgeon at gmail.com>:

Python had a seg fault with the following simple code.

>>> import PIL.Image as Img
>>> import numpy as np
>>> i = Img.open('/home/falmarri/Dropbox/obey.jpg')
>>> n = np.array(bytearray(i.tostring()),dtype=np.uint16)
zsh: segmentation fault  python

Running it under gdb gave the following

(gdb) run g19_framebuffer.py
Starting program: /usr/bin/python g19_framebuffer.py
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
_unaligned_strided_byte_copy (dst=0xcb9543 "\366\377\177", outstrides=1, src=0x7ffff3503da5 <Address 0x7ffff3503da5 out of bounds>, 
    instrides=4969607, N=10000, elsize=<value optimized out>) at /usr/include/bits/string3.h:52
warning: Source file is more recent than executable.
52        return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));

It could be that I'm doing it wrong though.

messages: 128523
nosy: David.Knapp
priority: normal
severity: normal
status: open
title: Pythong seg fault with PIL/numpy
type: crash
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list