[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compiling with -DSCM_DEBUG=1
From: |
Ludovic Courtès |
Subject: |
Re: compiling with -DSCM_DEBUG=1 |
Date: |
Mon, 07 Sep 2009 11:22:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Hi Ken,
Ken Raeburn <address@hidden> writes:
> BTW, the bdw-gc branch with my patch and SCM_DEBUG==1 still fails
> tests on my Mac.
>
> In guardians.c, line 169, SCM_CAR is applied to a non-pair:
>
> Running popen.test
> Running ports.test
>
> scm_error_pair_access
> Non-pair accessed with SCM_C[AD]R: `ERROR: In procedure symbol->string:
> ERROR: Wrong type argument in position 1 (expecting symbol):
> #<guardian 124e300 (reachable: 15 unreachable: 1)>
Does that mean it’s this whole string that’s accessed with SCM_C[AD]R?
> I use a modified scm_error_pair_access() that prints the function's
> name (as seen above)
Hmm, I don’t see the function name, except ‘symbol->string’ above, but
I’d expect it to be part of the string that’s accessed as a pair.
> and then sleeps a while, so I can attach gdb and get this stack trace
> before letting it resume:
>
> #0 0x9487546e in __semwait_signal ()
> #1 0x948752ef in nanosleep$UNIX2003 ()
> #2 0x948cae71 in sleep$UNIX2003 ()
> #3 0x002ea943 in scm_error_pair_access (non_pair=0x11d9180) at ../../
> libguile/pairs.c:50
> #4 0x002c8e35 in finalize_guarded (ptr=0x11d91f0,
> finalizer_data=0x11d9188) at ../../libguile/guardians.c:169
I cannot reproduce it here without SCM_DEBUG but with this simple patch
instead:
diff --git a/libguile/guardians.c b/libguile/guardians.c
index 580e212..ec00df6 100644
--- a/libguile/guardians.c
+++ b/libguile/guardians.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,1999,2000,2001, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1998,1999,2000,2001, 2006, 2008, 2009 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
@@ -159,13 +159,16 @@ finalize_guarded (GC_PTR ptr, GC_PTR finalizer_data)
g->zombies = zombies;
}
- if (proxied_finalizer != SCM_BOOL_F)
+ if (scm_is_true (proxied_finalizer))
{
/* Re-register the finalizer that was in place before we installed this
one. */
GC_finalization_proc finalizer, prev_finalizer;
GC_PTR finalizer_data, prev_finalizer_data;
+ if (!scm_is_pair (proxied_finalizer))
+ abort ();
+
finalizer = (GC_finalization_proc) SCM2PTR (SCM_CAR (proxied_finalizer));
finalizer_data = SCM2PTR (SCM_CDR (proxied_finalizer));
Any hints?
Ludo’.