From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Couder Subject: Re: [PATCH] git-daemon: fix segfaulting in child_handler() in AIX Date: Wed, 20 Apr 2011 14:53:03 +0200 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: Seth Jennings X-From: git-owner@vger.kernel.org Wed Apr 20 14:53:13 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 1QCWu9-0003s6-9t for gcvg-git-2@lo.gmane.org; Wed, 20 Apr 2011 14:53:13 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753567Ab1DTMxH convert rfc822-to-quoted-printable (ORCPT ); Wed, 20 Apr 2011 08:53:07 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:55776 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292Ab1DTMxG convert rfc822-to-8bit (ORCPT ); Wed, 20 Apr 2011 08:53:06 -0400 Received: by wwa36 with SMTP id 36so837791wwa.1 for ; Wed, 20 Apr 2011 05:53:04 -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=UCcwSR2KdCGxlXdp9etg2uJkOEDFhWEtdtXVUaHi5B0=; b=ayrRTUi/ZxhjQJOa/7FaFT0rcGu8r17QR9b7qq5Y6RC6gBmcpYc8Q9XY28is7t8Qgu 574eniVCA5YAKRX5kFdqE0TJ5JK5AvtX/l+6mWTRgAI6tbE+uKsaAWBxQX+GsRd6D02x bFQlpiF/4mLLJVSofQoyOR1QPfU3lXlt93lSk= 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=XfQvGhCqP8Pm5VjpcRMy1/iureExU2Kop0WAeQM35OVkBXjC5YOix+giN/JVpnJSIy trjmTmEBt2h6dOMC3cfdF+5WcSpZO+ttEPlCjFi9su0wPGDTSATS5Ybrae6FH1PCODJk SXEmwp2h4K3x82sat349rcOZaHEdHrZp0+ioI= Received: by 10.216.123.74 with SMTP id u52mr7101347weh.24.1303303984143; Wed, 20 Apr 2011 05:53:04 -0700 (PDT) Received: by 10.216.89.76 with HTTP; Wed, 20 Apr 2011 05:53:03 -0700 (PDT) In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 AIX= =2E > > 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_xp= g5.o) > (gdb) where > #0 =A00xd04f0c50 in _sigsetmask () from /usr/lib/libpthreads.a(shr_xp= g5.o) > #1 =A00xd04f1874 in _p_sigaction () from /usr/lib/libpthreads.a(shr_x= pg5.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 might = 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 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? =46or example you could revert only this hunk: @@ -1036,11 +1032,6 @@ int main(int argc, char **argv) gid_t gid =3D 0; int i; - /* Without this we cannot rely on waitpid() to tell - * what happened to our children. - */ - signal(SIGCHLD, SIG_DFL); - for (i =3D 1; i < argc; i++) { char *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.