Bug 17185 - hang with libgc 7.4.0
Summary: hang with libgc 7.4.0
Status: RESOLVED DUPLICATE of bug 17247
Alias: None
Product: gdb
Classification: Unclassified
Component: guile (show other bugs)
Version: HEAD
: P3 minor
Target Milestone: ---
Assignee: Doug Evans
URL:
Keywords:
: 17305 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-20 10:51 UTC by dje
Modified: 2014-09-10 04:47 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dje 2014-07-20 10:51:52 UTC
gdb+guile hangs with libgc 7.4.0.
The reasons are unclear, but there is a workaround which is to set GC_MARKERS=1.
We should enable this workaround until it's fixed.

ref: https://sourceware.org/ml/gdb-patches/2014-05/msg00132.html
Comment 1 cvs-commit@gcc.gnu.org 2014-07-26 21:51:57 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  74edf51613b507d1f27d66360cd8fdd8a253e88a (commit)
      from  e57e6ddc2e768323732a7eed6a5d25d3ee350638 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=74edf51613b507d1f27d66360cd8fdd8a253e88a

commit 74edf51613b507d1f27d66360cd8fdd8a253e88a
Author: Doug Evans <xdje42@gmail.com>
Date:   Sat Jul 26 14:49:04 2014 -0700

    PR 17185
    
    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.
    This patch applies the same workaround Guile has applied.
    There is no functionality or real performance loss with this,
    and Guile has been using it for awhile.
    
    	* configure.ac: Add check for header gc/gc.h.
    	Add check for function setenv.
    	* configure: Regenerate.
    	* config.in: Regenerate.
    	* guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog     |    9 +++++++++
 gdb/config.in     |    6 ++++++
 gdb/configure     |   26 ++++++++++++++++++++++++++
 gdb/configure.ac  |    5 +++++
 gdb/guile/guile.c |   15 +++++++++++++++
 5 files changed, 61 insertions(+), 0 deletions(-)
Comment 2 cvs-commit@gcc.gnu.org 2014-07-27 03:36:23 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, gdb-7.8-branch has been updated
       via  b13f24b87c227ef532cac27fc81f85b60fba2832 (commit)
      from  05e19170fe1cc288974e556aa552499fde30e5ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b13f24b87c227ef532cac27fc81f85b60fba2832

commit b13f24b87c227ef532cac27fc81f85b60fba2832
Author: Doug Evans <xdje42@gmail.com>
Date:   Sat Jul 26 20:29:32 2014 -0700

    PR 17185
    
    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.
    This patch applies the same workaround Guile has applied.
    There is no functionality or real performance loss with this,
    and Guile has been using it for awhile.
    
        	* configure.ac: Add check for header gc/gc.h.
        	Add check for function setenv.
        	* configure: Regenerate.
        	* config.in: Regenerate.
        	* guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog     |    9 +++++++++
 gdb/config.in     |    6 ++++++
 gdb/configure     |   26 ++++++++++++++++++++++++++
 gdb/configure.ac  |    5 +++++
 gdb/guile/guile.c |   15 +++++++++++++++
 5 files changed, 61 insertions(+), 0 deletions(-)
Comment 3 Doug Evans 2014-07-28 01:06:30 UTC
Downgrading priority.
Still need to understand bug better, but it's not important enough to do ahead of others.
Comment 4 Ross Lagerwall 2014-08-25 09:04:08 UTC
*** Bug 17305 has been marked as a duplicate of this bug. ***
Comment 5 Ross Lagerwall 2014-08-25 09:07:01 UTC
The workaround is set for libgc 7.4.0 only.  However, I have libgc 7.4.2 and I can't debug multi-threaded programs. Using GC_MARKERS=1 works, however, so it seems this is still needed for libgc 7.4.2.
Comment 6 Doug Evans 2014-08-31 17:26:24 UTC
The problem is not limited to 7.4.0.
Bug 17247 has more details, so just closing this one in favor of that.
Comment 7 Doug Evans 2014-08-31 17:26:58 UTC

*** This bug has been marked as a duplicate of bug 17247 ***
Comment 8 cvs-commit@gcc.gnu.org 2014-09-09 05:50:29 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  92d8d229d9a310ebfcfc13bf4a75a286c1add1ac (commit)
      from  837405970476d31d6b4d7774e2c914fdfa7a9930 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=92d8d229d9a310ebfcfc13bf4a75a286c1add1ac

commit 92d8d229d9a310ebfcfc13bf4a75a286c1add1ac
Author: Doug Evans <xdje42@gmail.com>
Date:   Mon Sep 8 22:45:34 2014 -0700

    Fix for PR 17247: Block SIGCHLD while initializing Guile.
    
    The problem here is that if a thread other than gdb's main thread
    gets a SIGCHLD (it's an asynchronous signal so the kernel will
    essentially pick a random thread) then gdb will hang if it is
    in sigsuspend when the SIGCHLD is delivered.  The other thread
    will see the signal and the sigsuspend won't "wake up".
    
    Guile and libgc should be blocking SIGCHLD in their threads,
    but we need to work with Guile 2.0 and libgc 7.4.
    The problem first shows up in libgc 7.4 because it is the first
    release that enables multiple marker threads by default.
    
    gdb/ChangeLog:
    
    	PR 17247
    	* guile.c: #include <signal.h>.
    	(_initialize_guile): Block SIGCHLD while initializing Guile.
    
    	Replaces the following, which is reverted.
    
    	2014-07-26  Doug Evans  <xdje42@gmail.com>
    
    	PR 17185
    	* configure.ac: Add check for header gc/gc.h.
    	Add check for function setenv.
    	* configure: Regenerate.
    	* config.in: Regenerate.
    	* guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog     |   17 +++++++++++++
 gdb/config.in     |    6 ----
 gdb/configure     |   26 --------------------
 gdb/configure.ac  |    5 ----
 gdb/guile/guile.c |   67 ++++++++++++++++++++++++++++------------------------
 5 files changed, 53 insertions(+), 68 deletions(-)
Comment 9 cvs-commit@gcc.gnu.org 2014-09-10 04:47:31 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, gdb-7.8-branch has been updated
       via  0df33300929f9b54ddcf040f9b1fe69c1a88304b (commit)
      from  0fefcb3282480d15a66fbf5daf65ef25adee9e76 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0df33300929f9b54ddcf040f9b1fe69c1a88304b

commit 0df33300929f9b54ddcf040f9b1fe69c1a88304b
Author: Doug Evans <xdje42@gmail.com>
Date:   Tue Sep 9 21:42:20 2014 -0700

    Fix for PR 17247: Block SIGCHLD while initializing Guile.
    
    The problem here is that if a thread other than gdb's main thread
    gets a SIGCHLD (it's an asynchronous signal so the kernel will
    essentially pick a random thread) then gdb will hang if it is
    in sigsuspend when the SIGCHLD is delivered.  The other thread
    will see the signal and the sigsuspend won't "wake up".
    
    Guile and libgc should be blocking SIGCHLD in their threads,
    but we need to work with Guile 2.0 and libgc 7.4.
    The problem first shows up in libgc 7.4 because it is the first
    release that enables multiple marker threads by default.
    
    gdb/ChangeLog:
    
        	PR 17247
        	* guile.c: #include <signal.h>.
        	(_initialize_guile): Block SIGCHLD while initializing Guile.
    
        	Replaces the following, which is reverted.
    
        	2014-07-26  Doug Evans  <xdje42@gmail.com>
    
        	PR 17185
        	* configure.ac: Add check for header gc/gc.h.
        	Add check for function setenv.
        	* configure: Regenerate.
        	* config.in: Regenerate.
        	* guile/guile.c (_initialize_guile): Add workaround for libgc 7.4.0.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog     |   17 +++++++++++++
 gdb/config.in     |    6 ----
 gdb/configure     |   26 --------------------
 gdb/configure.ac  |    5 ----
 gdb/guile/guile.c |   67 ++++++++++++++++++++++++++++------------------------
 5 files changed, 53 insertions(+), 68 deletions(-)