From mboxrd@z Thu Jan 1 00:00:00 1970 From: Seth Jennings Subject: Re: [PATCH] git-daemon: fix segfaulting in child_handler() in AIX Date: Mon, 2 May 2011 12:51:08 -0500 Message-ID: References: <1302886260-25860-1-git-send-email-spartacus06@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: git@vger.kernel.org To: Christian Couder X-From: git-owner@vger.kernel.org Mon May 02 19:51:20 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QGxHA-0007Cj-OA for gcvg-git-2@lo.gmane.org; Mon, 02 May 2011 19:51:17 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754250Ab1EBRvM convert rfc822-to-quoted-printable (ORCPT ); Mon, 2 May 2011 13:51:12 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:37985 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753344Ab1EBRvK convert rfc822-to-8bit (ORCPT ); Mon, 2 May 2011 13:51:10 -0400 Received: by wya21 with SMTP id 21so4380066wya.19 for ; Mon, 02 May 2011 10:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ntvFntx3DVa9ifpj6jyvB8pzVxMRrPK3igs20aCxBj8=; b=c0q6j515sze6qk7KmckzF9t/4ZW3BpnBHTJXpsiLHEpcKW+blJfAbhbdlpG5HbZv8A o/qjko+BBkqM19KneZNS1j5vlvNPGMQAkMdk1+m9zt7pQzhigmaDKPN9lomQAaOf6ZrW 4o4o4DwL0ZmD11oowdPAXqK4TTwnM7+HRUWyo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=wnvGPXQz382qKDpSke7tGgwU+NEUibK4iMcY6drbWJdUOt8YS4zruPpdnCtlHklnG6 c/hSftwoxqvADnLp/ZtxyYw7Xf+KCXe692Y6Pmn1u4UyV//aFoMCZR1gmpWE4lU/nvG2 7ovuqjLg/DBJSFWGpmFU+H15qGbMwGa5h8OaM= Received: by 10.216.235.95 with SMTP id t73mr5571644weq.10.1304358668803; Mon, 02 May 2011 10:51:08 -0700 (PDT) Received: by 10.216.187.6 with HTTP; Mon, 2 May 2011 10:51:08 -0700 (PDT) In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 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 wrote: > > There is a git-daemon segfault issue that seems to be specific to A= IX. > > > > 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 =A00xd04f0c50 in _sigsetmask () from /usr/lib/libpthreads.a(shr_= xpg5.o) > > (gdb) where > > #0 =A00xd04f0c50 in _sigsetmask () from /usr/lib/libpthreads.a(shr_= xpg5.o) > > #1 =A00xd04f1874 in _p_sigaction () from /usr/lib/libpthreads.a(shr= _xpg5.o) > > #2 =A00xd013ae34 in sigaction () from /usr/lib/libc.a(shr.o) > > #3 =A00xd0217cd8 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 =A00x10000b90 in child_handler (signo=3D0) at daemon.c:718 > > #5 =A0 > > > > Through experimentation, I found that using sigaction() instead of > > signal() resolves the issue. =A0I'm not entirely sure why this is. > > > > Any feedback about the issue or the patch is welcome. =A0There migh= t be > > a better solution. > > > > On Fri, Apr 15, 2011 at 11:51 AM, Seth Jennings wrote: > >> This issue seems to be specific to git-daemon on AIX built with xl= c. > >> After commit 695605b5080e1957bd9dab1fed35a7fee9814297 (from Aug 20= 08), > >> git-daemon segfaults in child_handler() inside the signal() syscal= l > >> immediately after any remote clone/pull operation. > > Could you try some variants that revert or change parts of this commi= t? > > For example you could revert only this hunk: > > @@ -1036,11 +1032,6 @@ int main(int argc, char **argv) > =A0 =A0 =A0 =A0gid_t gid =3D 0; > =A0 =A0 =A0 =A0int i; > > - =A0 =A0 =A0 /* Without this we cannot rely on waitpid() to tell > - =A0 =A0 =A0 =A0* what happened to our children. > - =A0 =A0 =A0 =A0*/ > - =A0 =A0 =A0 signal(SIGCHLD, SIG_DFL); > - > =A0 =A0 =A0 =A0for (i =3D 1; i < argc; i++) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char *arg =3D argv[i]; > > > >>=A0While 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.