git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Seth Jennings <spartacus06@gmail.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-daemon: fix segfaulting in child_handler() in AIX
Date: Mon, 2 May 2011 12:51:08 -0500	[thread overview]
Message-ID: <BANLkTinOkE-w3qdASuje72a3G6bpEoxWxA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimtfXgy9UcdQ8b-8dLrO-qgXFgQnw@mail.gmail.com>

Thanks Christian,

Sorry for the dup for you Christian.  The email sent in HTML instead
of plaintext and got bounced by the mailing list.

I tried reverting just the part the sets the SIGCHLD handler to the
default as you suggested, but the problem still exists.

It is true that the AIX libc signal() function basically wraps the a
call to sigaction().

I'll investigate more and update this thread when I have something.

Seth

On Wed, Apr 20, 2011 at 7:53 AM, Christian Couder
<christian.couder@gmail.com> wrote:
>
> Hi,
>
> I have no idea what the problem could be, but maybe I will be lucky
> with my suggestions.
>
> On Fri, Apr 15, 2011 at 6:54 PM, Seth Jennings <spartacus06@gmail.com> wrote:
> > There is a git-daemon segfault issue that seems to be specific to AIX.
> >
> > Whenever a remote user pulls or clones, the operation succeeds but
> > git-daemon crashes immediately afterward.
> >
> > $ gdb git-daemon core
> > ...
> > Core was generated by `git-daemon'.
> > Program terminated with signal 11, Segmentation fault.
> > #0  0xd04f0c50 in _sigsetmask () from /usr/lib/libpthreads.a(shr_xpg5.o)
> > (gdb) where
> > #0  0xd04f0c50 in _sigsetmask () from /usr/lib/libpthreads.a(shr_xpg5.o)
> > #1  0xd04f1874 in _p_sigaction () from /usr/lib/libpthreads.a(shr_xpg5.o)
> > #2  0xd013ae34 in sigaction () from /usr/lib/libc.a(shr.o)
> > #3  0xd0217cd8 in signal () from /usr/lib/libc.a(shr.o)
>
> signal() is calling sigaction() so sigaction() must be called with
> different parameters in your patch and when it crashes.
> Could you have a look at the difference between parameters?
>
> > #4  0x10000b90 in child_handler (signo=0) at daemon.c:718
> > #5  <signal handler called>
> >
> > Through experimentation, I found that using sigaction() instead of
> > signal() resolves the issue.  I'm not entirely sure why this is.
> >
> > Any feedback about the issue or the patch is welcome.  There might be
> > a better solution.
> >
> > On Fri, Apr 15, 2011 at 11:51 AM, Seth Jennings <spartacus06@gmail.com> wrote:
> >> This issue seems to be specific to git-daemon on AIX built with xlc.
> >> After commit 695605b5080e1957bd9dab1fed35a7fee9814297 (from Aug 2008),
> >> git-daemon segfaults in child_handler() inside the signal() syscall
> >> immediately after any remote clone/pull operation.
>
> Could you try some variants that revert or change parts of this commit?
>
> For example you could revert only this hunk:
>
> @@ -1036,11 +1032,6 @@ int main(int argc, char **argv)
>        gid_t gid = 0;
>        int i;
>
> -       /* Without this we cannot rely on waitpid() to tell
> -        * what happened to our children.
> -        */
> -       signal(SIGCHLD, SIG_DFL);
> -
>        for (i = 1; i < argc; i++) {
>                char *arg = argv[i];
>
>
> >> While it is not
> >> fully understood why this happens, changing signal() to sigaction()
> >> resolves the issue.
>
> Yeah but it would be nice to understand.
>
> Thanks in advance,
> Christian.

  reply	other threads:[~2011-05-02 17:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 16:51 [PATCH] git-daemon: fix segfaulting in child_handler() in AIX Seth Jennings
2011-04-15 16:54 ` Seth Jennings
2011-04-20 12:53   ` Christian Couder
2011-05-02 17:51     ` Seth Jennings [this message]
2011-04-21 20:43 ` Erik Faye-Lund

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

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

  git send-email \
    --in-reply-to=BANLkTinOkE-w3qdASuje72a3G6bpEoxWxA@mail.gmail.com \
    --to=spartacus06@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.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 NNTP newsgroup(s).