[Python-bugs-list] [Bug #132008] PyList_Reverse fails with C Extensions

noreply@sourceforge.net noreply@sourceforge.net
Mon, 12 Feb 2001 08:45:02 -0800


Bug #132008, was updated on 2001-Feb-12 08:45
Here is a current snapshot of the bug.

Project: Python
Category: Python Interpreter Core
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: whack
Assigned to : nobody
Summary: PyList_Reverse fails with C Extensions

Details: The C API function 'PyList_Reverse()' causes a 'Segmentation
Fault(core dump)' when used under:
Python 2.0 (#1, Oct 27 2000, 09:38:44) [C] on sunos5

A simple C function was written to accept a Python list as
input and return it in reverse using 'PyList_Reverse()'.
When compiled under Python1.5.2, this code works flawlessly.
I use the function under Python in this manner:
Python 1.5.2 (#2, Apr 17 1999, 11:16:17) [C] on sunos5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import casette
>>> shape = casette.casette([1,2,3,4])
>>> shape
[4, 3, 2, 1]

However, when compiled under Python2.0, it returns the
following error:
Python 2.0 (#1, Oct 27 2000, 09:38:44) [C] on sunos5
Type "copyright", "credits" or "license" for more information.
>>> import casette
>>> shape = casette.casette([1,2,3,4])
Segmentation fault (core dumped)

and exits from Python altogether. 

I can provide the test program (with Makefile) if it 
would help track down the bug. Any indication of the
cause of this bug or a work around would be appreciated.


For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=132008&group_id=5470