unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: bug-guile@gnu.org
Subject: Re: Segfault in scheme code
Date: Thu, 16 Aug 2007 12:59:44 +0200	[thread overview]
Message-ID: <87643f219b.fsf@chbouib.org> (raw)
In-Reply-To: 46C33D72.8050403@wilsonjc.us

Hi,

Jon Wilson <jsw@wilsonjc.us> 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


      reply	other threads:[~2007-08-16 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-15 17:52 Segfault in scheme code Jon Wilson
2007-08-16 10:59 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87643f219b.fsf@chbouib.org \
    --to=ludo@gnu.org \
    --cc=bug-guile@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).