[New-bugs-announce] [issue7788] segfault when deleting from a list using slice with very big `step' value

Jan Kaliszewski report at bugs.python.org
Tue Jan 26 19:47:12 CET 2010


New submission from Jan Kaliszewski <zuo at chopin.edu.pl>:

del list_instance([start : stop : very_big_step]) causes segfaults...

The boundary values seem to be:
* start -- near length of the list
* stop -- near (-length) of the list
* very_big_step -- near sys.maxint

Let examples speak...

>>> from sys import maxint
>>> del range(10)[::maxint]
Segmentation fault

>>> from sys import maxint
>>> del range(10)[13::maxint]
>>> del range(10)[12::maxint]
>>> del range(10)[11::maxint]
>>> del range(10)[10::maxint]
>>> del range(10)[9::maxint]
Segmentation fault

>>> from sys import maxint
>>> del range(10)[:-13:maxint]
>>> del range(10)[:-12:maxint]
>>> del range(10)[:-11:maxint]
>>> del range(10)[:-10:maxint]
>>> del range(10)[:-9:maxint]
Segmentation fault

>>> from sys import maxint
>>> del range(10)[-8:8:maxint-5]
>>> del range(10)[-8:8:maxint-4]
>>> del range(10)[-8:8:maxint-3]
>>> del range(10)[-8:8:maxint-2]
Segmentation fault

System Info:
* Python 2.5.4 (r254:67916, Apr  4 2009, 17:55:16) 
* [GCC 4.3.3] on linux2
* sys.maxint == 2147483647, sys.byteorder == 'little'
* Processor: Pentium 4
* libc version: 2.9 (2.9-4ubuntu6)

----------
components: Interpreter Core
messages: 98348
nosy: zuo
severity: normal
status: open
title: segfault when deleting from a list using slice with very big `step' value
type: crash
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7788>
_______________________________________


More information about the New-bugs-announce mailing list