Hi,

Jon Wilson <[EMAIL PROTECTED]> 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 via email to