[Python-bugs-list] [ python-Bugs-587875 ] crash on deleting extended slice

noreply@sourceforge.net noreply@sourceforge.net
Mon, 29 Jul 2002 07:37:07 -0700


Bugs item #587875, was opened at 2002-07-29 01:50
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=587875&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 8
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Michael Hudson (mwh)
Summary: crash on deleting extended slice

Initial Comment:
If you add the following line to test_types.py:400
  del a[::1000]

The interpreter crashes.

The problem is around Objects/listobject.c 1789.
In the inner for loop, the calculated index (cur + j + 1)
can get larger than the list.

I found this problem using valgrind -
http://developer.kde.org/~sewardj/


----------------------------------------------------------------------

>Comment By: Michael Hudson (mwh)
Date: 2002-07-29 14:37

Message:
Logged In: YES 
user_id=6656

OK, this is fixed:

Objects/listobject.c 2.129
Modules/arraymodule.c 2.78
Lib/test/test_types.py 1.37
Lib/test/test_array.py  1.18

I hope that's the last of these silly mistakes...

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-07-29 11:10

Message:
Logged In: YES 
user_id=6656

Balls.  The list case is fairly easy to fix, but there's a
similar bug in the array code, and I'm not thinking clearly
enough to sort out the arithmetic right now.

Will get to it soon.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=587875&group_id=5470