unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* Segfault in scheme code
@ 2007-08-15 17:52 Jon Wilson
  2007-08-16 10:59 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Wilson @ 2007-08-15 17:52 UTC (permalink / raw)
  To: bug-guile

Hi,
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.
Regards,
Jon


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Segfault in scheme code
  2007-08-15 17:52 Segfault in scheme code Jon Wilson
@ 2007-08-16 10:59 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2007-08-16 10:59 UTC (permalink / raw)
  To: bug-guile

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-16 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 17:52 Segfault in scheme code Jon Wilson
2007-08-16 10:59 ` Ludovic Courtès

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).