* [PATCH] Apply workaround for PR 17185
@ 2014-07-20 15:07 Doug Evans
2014-07-20 19:52 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2014-07-20 15:07 UTC (permalink / raw)
To: ludo, gdb-patches
Hi.
PR 17185 describes a problem with using gdb+guile with libgc 7.4.0.
The symptom is a hang in sigsuspend.
[The thread referenced in the PR has the details.]
It's not clear what the right fix is, or even where the bug is yet.
I'd like to have gdb+guile 7.8.0 work with libgc 7.4.0,
and this patch applies the same workaround that Guile applied.
There is no functionality or real performance loss with this,
and Guile has been using it for awhile.
2014-07-19 Doug Evans <xdje42@gmail.com>
PR 17185
* configure.ac: Add check for header gc/gc.h.
Add check for function setenv.
* configure: Regenerate.
* config.h: Regenerate.
* guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index a2ac15f..e348144 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1218,6 +1218,11 @@ fi
AC_SUBST(GUILE_CPPFLAGS)
AC_SUBST(GUILE_LIBS)
+# PR 17185, see if we can get the libgc version to see if we need
+# to apply the workaround.
+AC_CHECK_HEADERS(gc/gc.h)
+AC_CHECK_FUNCS([setenv])
+
# --------------------- #
# Check for libmcheck. #
# --------------------- #
diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c
index 05dba69..6bc078f 100644
--- a/gdb/guile/guile.c
+++ b/gdb/guile/guile.c
@@ -35,6 +35,9 @@
#ifdef HAVE_GUILE
#include "guile.h"
#include "guile-internal.h"
+#ifdef HAVE_GC_GC_H
+#include <gc/gc.h> /* PR 17185 */
+#endif
#endif
/* The Guile version we're using.
@@ -750,6 +753,18 @@ _initialize_guile (void)
side to define module "gdb" which imports "_gdb". There is evidently no
similar convention in Guile so we skip this. */
+ /* PR 17185 There are problems with using libgc 7.4.0.
+ Copy over the workaround Guile uses (Guile is working around a different
+ problem, but the workaround is the same). */
+#if (GC_VERSION_MAJOR == 7 && GC_VERSION_MINOR == 4 && GC_VERSION_MICRO == 0)
+ /* The bug is only known to appear with pthreads. We assume any system
+ using pthreads also uses setenv (and not putenv). That is why we don't
+ have a similar call to putenv here. */
+#if defined (HAVE_SETENV)
+ setenv ("GC_MARKERS", "1", 1);
+#endif
+#endif
+
/* scm_with_guile is the most portable way to initialize Guile.
Plus we need to initialize the Guile support while in Guile mode
(e.g., called from within a call to scm_with_guile). */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Apply workaround for PR 17185
2014-07-20 15:07 [PATCH] Apply workaround for PR 17185 Doug Evans
@ 2014-07-20 19:52 ` Ludovic Courtès
2014-07-27 4:23 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2014-07-20 19:52 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
Doug Evans <dje@google.com> skribis:
> 2014-07-19 Doug Evans <xdje42@gmail.com>
>
> PR 17185
> * configure.ac: Add check for header gc/gc.h.
> Add check for function setenv.
> * configure: Regenerate.
> * config.h: Regenerate.
> * guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.
LGTM.
Ludo'.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Apply workaround for PR 17185
2014-07-20 19:52 ` Ludovic Courtès
@ 2014-07-27 4:23 ` Doug Evans
0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2014-07-27 4:23 UTC (permalink / raw)
To: Ludovic Courtès, gdb-patches
ludo@gnu.org (Ludovic Courtès) writes:
> Doug Evans <dje@google.com> skribis:
>
>> 2014-07-19 Doug Evans <xdje42@gmail.com>
>>
>> PR 17185
>> * configure.ac: Add check for header gc/gc.h.
>> Add check for function setenv.
>> * configure: Regenerate.
>> * config.h: Regenerate.
>> * guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.
>
> LGTM.
>
> Ludo'.
Committed to trunk and 7.8 branch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-27 4:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-20 15:07 [PATCH] Apply workaround for PR 17185 Doug Evans
2014-07-20 19:52 ` Ludovic Courtès
2014-07-27 4:23 ` Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox