unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: Re: Need to block SIGCHLD in libgc and guile internal threads
Date: Tue, 26 Aug 2014 09:41:10 -0700	[thread overview]
Message-ID: <CAP9bCMT4sei=fKjfUu7Kgq0FZK7HFfgczw=xkWrvE86_h2V77Q@mail.gmail.com> (raw)
In-Reply-To: <CAP9bCMTCpRbQ2=frarOPHSghMUr4fbz=vFCuGjgN=JO9_3eG1g@mail.gmail.com>

On Tue, Aug 26, 2014 at 1:14 AM, Doug Evans <xdje42@gmail.com> wrote:
> Hi.
>
> I think(!) I understand why gdb is hanging when used with libgc 7.4.x.
> This is gdb bug 17247.
> https://sourceware.org/bugzilla/show_bug.cgi?id=17247#c30
>
> First, libgc 7.4.x was the first release to default PARALLEL_MARK to
> on, so I'm guessing the same "bug" exists in 7.2, it's just not
> visible unless one builds libgc with --enable-parallel-mark.
>
> gdb/linux-nat.c calls sigsuspend when the inferior is running and gdb
> needs to wait for it to stop.
> gdb is waiting on a SIGCHLD at this point.
>
> However, if the SIGCHLD goes to a different thread, say the guile
> finalizer thread or a libgc marker thread then the sigsuspend that gdb
> calls doesn't wake up and gdb is hung.
>
> So question: Any suggestions for how to approach this?

Since threads inherit the sigmask of their creator one thing I could
do, I think, is block SIGCHLD before initializing Guile and then
unblock it afterwards.  The four threads I see being created during
Guile initialization (3 marker threads plus Guile's finalizer thread)
are created during that time.

Question: Does Guile create any threads lazily?

[I'm referring to internal Guile-created threads.
Users who create their own threads are on their own,
at least for now. IWBN though if there were a mechanism
to have all threads that Guile created have SIGCHLD
initially blocked.  I wouildn't make it SIGCHLD-specific
of course - just have a way to augment the initial
sigmask of newly created threads.]



  reply	other threads:[~2014-08-26 16:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26  8:14 Need to block SIGCHLD in libgc and guile internal threads Doug Evans
2014-08-26 16:41 ` Doug Evans [this message]
2014-08-29 17:36 ` mhw
2014-08-30 17:40   ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP9bCMT4sei=fKjfUu7Kgq0FZK7HFfgczw=xkWrvE86_h2V77Q@mail.gmail.com' \
    --to=xdje42@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).