From owner-freebsd-python@FreeBSD.ORG Sat Oct 9 13:58:09 2004 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BC1716A4CE for ; Sat, 9 Oct 2004 13:58:09 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2664E43D3F for ; Sat, 9 Oct 2004 13:58:08 +0000 (GMT) (envelope-from hyeshik@gmail.com) Received: by mproxy.gmail.com with SMTP id 73so234803rnl for ; Sat, 09 Oct 2004 06:58:04 -0700 (PDT) Received: by 10.39.1.30 with SMTP id d30mr529707rni; Sat, 09 Oct 2004 06:58:04 -0700 (PDT) Received: by 10.39.1.28 with HTTP; Sat, 9 Oct 2004 06:58:04 -0700 (PDT) Message-ID: <4f0b69dc04100906587295b2b2@mail.gmail.com> Date: Sat, 9 Oct 2004 22:58:04 +0900 From: Hye-Shik Chang To: Valentino Volonghi aka Dialtone , freebsd-ports@freebsd.org, freebsd-python@freebsd.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: Subject: Re: Python Coredump X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Hye-Shik Chang List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 13:58:09 -0000 On Sat, 09 Oct 2004 03:30:21 +0200, Valentino Volonghi aka Dialtone wrote: > Try executing this simple program in py: > > class NewList(list): > def __getslice__(self, start, stop): > if type(start) == str and type(stop) == str: > return self[self.index(start):self.index(stop)] > else: > return self[start:stop] > a = NewList([1,2,3,4,5,6]) > print a[1:4] > > In my FreeBSD 5.3-beta7 box it coredumps with bus error. > CPython is somewhat weak for recursive calls. Almost all cases can be blocked by default recursion limit (1000), but some of new-style methods and recursive calls for internal methods that consumes more than regular calls require more lower limit. You can prevent the bus error with sys.setrecursionlimit(500). Hye-Shik