From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: Re: Segfault in scheme code Date: Thu, 16 Aug 2007 12:59:44 +0200 Message-ID: <87643f219b.fsf@chbouib.org> References: <46C33D72.8050403@wilsonjc.us> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187262044 26109 80.91.229.12 (16 Aug 2007 11:00:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2007 11:00:44 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Aug 16 13:00:42 2007 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ILd5l-00061D-F7 for guile-bugs@m.gmane.org; Thu, 16 Aug 2007 13:00:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILd5l-00012m-0Z for guile-bugs@m.gmane.org; Thu, 16 Aug 2007 07:00:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ILd5h-000129-9q for bug-guile@gnu.org; Thu, 16 Aug 2007 07:00:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ILd5e-00011x-Te for bug-guile@gnu.org; Thu, 16 Aug 2007 07:00:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILd5e-00011u-N4 for bug-guile@gnu.org; Thu, 16 Aug 2007 07:00:34 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ILd5e-0005s0-8i for bug-guile@gnu.org; Thu, 16 Aug 2007 07:00:34 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ILd5V-0006sl-JE for bug-guile@gnu.org; Thu, 16 Aug 2007 13:00:25 +0200 Original-Received: from 82.213.174.58.dyn.user.ono.com ([82.213.174.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Aug 2007 13:00:25 +0200 Original-Received: from ludo by 82.213.174.58.dyn.user.ono.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Aug 2007 13:00:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 82.213.174.58.dyn.user.ono.com X-URL: http://www.laas.fr/~lcourtes/ X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: i486-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:3PCK1bdVEHe4MJUAt2sPvRA4qNA= X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:3559 Archived-At: Hi, Jon Wilson writes: > I'm running guile-1.8.2 on ubuntu feisty. The following function > causes guile to segfault: > > guile> (define (consing lst) (consing (cons lst lst))) > guile> (consing '()) > Segmentation fault (core dumped) > > I understand that guile should never ever segfault from plain scheme code. Right, but you're nastily provoking it. ;-) We don't hit an out-of-memory situation here, but rather a stack overflow while marking: #0 0xb7ed15d8 in scm_gc_mark_dependencies (p=0xb7b0f5e8) at ../../libguile/gc-mark.c:218 #1 0xb7ed16cc in scm_gc_mark (ptr=0xb7b0f5e8) at ../../libguile/gc-mark.c:169 #2 0xb7ed15dd in scm_gc_mark_dependencies (p=0xb7b0f5a0) at ../../libguile/gc-mark.c:218 #3 0xb7ed16cc in scm_gc_mark (ptr=0xb7b0f5a0) at ../../libguile/gc-mark.c:169 The thing here is that the GC is essentially traversing a tree in a non-tail-recursive fashion. FWIW, the `libgc'-based Guile doesn't have this problem, it just keeps consing. Thanks, Ludovic. _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://lists.gnu.org/mailman/listinfo/bug-guile