From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20117 invoked by alias); 20 Jul 2014 15:01:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 20105 invoked by uid 89); 20 Jul 2014 15:01:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS,URIBL_BLACK autolearn=no version=3.3.2 X-HELO: mail-pa0-f73.google.com Received: from mail-pa0-f73.google.com (HELO mail-pa0-f73.google.com) (209.85.220.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 20 Jul 2014 15:01:18 +0000 Received: by mail-pa0-f73.google.com with SMTP id kx10so1560058pab.0 for ; Sun, 20 Jul 2014 08:01:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=h9SSwoIjvBUGET0rLn2tF2Wbyb4lckNlJpldAwKPRIY=; b=RDzwbUUcASIJblNMt3TkyM46WlMPWjU9R6TtfDSMfTM1b3LnvK8X5G5TiucRjZdFGA w7xig5dnqQ9DqfiwpL8Q1LXI2tBNmqf8ZySc3Rc+cAEMCa9WddqRXd1u/+e00OWQ78Lj /Bj8tTPH8LNy+LBo9wziq0JKGpo4OvuY02H1moOAK1qyFTM8FUpArj3g04ipByOd8Sac UX5qoM6JHGG9yJiyimxEjQp3EtYxD0kz73P+5Z33X+ZNRCG0xr6RXDSjn01TlP6uhcKi lCqLcvjqignmi0GOuTsu+6lhjCJ7f5ZiweIzOnLS3UoMVOo4JStSqL3eXxOfbffsqWDK aAmg== X-Gm-Message-State: ALoCoQnmVfTRBlrvMu4/cVjyu7EXvXRsD+JQlHge4F8pyVAtgq/TvHaREvxWglTbW1JJBQdebDAt X-Received: by 10.66.246.229 with SMTP id xz5mr9402226pac.34.1405868474959; Sun, 20 Jul 2014 08:01:14 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id y50si854139yhk.4.2014.07.20.08.01.14 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 20 Jul 2014 08:01:14 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 6675731C1BB; Sun, 20 Jul 2014 08:01:14 -0700 (PDT) From: Doug Evans To: ludo@gnu.org, gdb-patches@sourceware.org Subject: [PATCH] Apply workaround for PR 17185 Date: Sun, 20 Jul 2014 15:07:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00530.txt.bz2 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 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 /* 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). */