Issue #13 resolved

Segmentation fault calling __delitem__

Aaron Iles
created an issue

Should the following cause a segmentation fault? The behaviour I expect is either an exception being raised. (Maybe setting the memory to zero.)

{{{ Python 2.7.2 (default, Dec 18 2011, 19:15:32) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import cffi ffi = cffi.FFI() string = ffi.new('char[]', 'segmentation fault') string[0] 's' del string[0] Segmentation fault: 11 }}}

Also works for int arrays.

{{{ Python 2.7.2 (default, Dec 18 2011, 19:15:32) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import cffi ffi = cffi.FFI() integers = ffi.new('int[2]') integers[1] 0 del integers[1] Segmentation fault: 11 }}}

While there is no clear (to me) behaviour this mirrors in C, the segmentation fault is unexpected.

Comments (1)

  1. Log in to comment