GNU bug report logs - #13611
SEGV during SMOB GC

Previous Next

Package: guile;

Reported by: Mike Gran <spk121 <at> yahoo.com>

Date: Sat, 2 Feb 2013 20:53:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 13611 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mike Gran <spk121 <at> yahoo.com>
Cc: 13611 <at> debbugs.gnu.org
Subject: Re: bug#13611: SEGV during SMOB GC
Date: Tue, 05 Feb 2013 11:07:51 +0100
[Message part 1 (text/plain, inline)]
Hi Mike,

Mike Gran <spk121 <at> yahoo.com> skribis:

> This gives
>
>   Program received signal SIGSEGV, Segmentation fault.
>   [Switching to Thread 0xb7d98b40 (LWP 20488)]
>   0xb7f251ab in smob_mark (addr=0x8608ff0, mark_stack_ptr=0xb7d90308, 
>       mark_stack_limit=0xb7d982f0, env=0) at smob.c:325
>   325           SCM_I_CURRENT_THREAD->current_mark_stack_ptr = mark_stack_ptr;
>
> Here's what's happening internally.  When Guile starts up, it creates 3
> threads
> * Initial thread
> * GC thread from scm_storage_prehistory GC_INIT()
> * signal delivery thread
>
> That second thread is the one from which automatic garbage collection
> occurs.  The way that thread gets created, it has an
> scm_i_current_thread == NULL, apparently.

Is there any chance that you’re using a GC 7.3 pre-release?

There was a similar report on IRC, and the fix appears to be:

[Message part 2 (text/x-patch, inline)]
--- a/libguile/smob.c
+++ b/libguile/smob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2004, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2004, 2006, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -318,7 +318,7 @@ smob_mark (GC_word *addr, struct GC_ms_entry *mark_stack_ptr,
 				     mark_stack_ptr,
 				     mark_stack_limit, NULL);
 
-  if (scm_smobs[smobnum].mark)
+  if (scm_smobs[smobnum].mark && SCM_I_CURRENT_THREAD != NULL)
     {
       SCM obj;
 
[Message part 3 (text/plain, inline)]
(Note that on 2.0 SMOB mark procedures are unnecessary.)

Ludo’.

This bug report was last modified 12 years and 76 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.