From owner-freebsd-stable@FreeBSD.ORG Tue Oct 18 18:10:44 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42E221065673 for ; Tue, 18 Oct 2011 18:10:44 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.35]) by mx1.freebsd.org (Postfix) with ESMTP id C8BE78FC14 for ; Tue, 18 Oct 2011 18:10:43 +0000 (UTC) Received: from [78.34.144.36] (helo=fabiankeil.de) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1RGDwl-0000bA-UY for freebsd-stable@freebsd.org; Tue, 18 Oct 2011 19:59:28 +0200 Date: Tue, 18 Oct 2011 19:59:22 +0200 From: Fabian Keil To: freebsd-stable@freebsd.org Message-ID: <20111018195922.747d239f@fabiankeil.de> In-Reply-To: References: <20111018144312.GA17496@icarus.home.lan> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/F/Yp616B8VTeOQ=Yab5tgDx"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Subject: Re: Setting coredumpsize on a running process? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2011 18:10:44 -0000 --Sig_/F/Yp616B8VTeOQ=Yab5tgDx Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ivan Voras wrote: > On 18 October 2011 16:43, Jeremy Chadwick wrot= e: > > On Tue, Oct 18, 2011 at 04:32:11PM +0200, Ivan Voras wrote: > >> I have PHP executing as fastcgi via the mod_fcgid module in Apache. I > >> suspect there is a bug in PHP or one of its extensions which causes it > >> to crash with sigsegv, but I cannot get any coredumps. I suspect > >> something is setting coredumpsize to 0 - either Apache, mod_fcgid or P= HP. > >> > >> So the question is: is there a way to set coredumpsize on a running > >> process, with the intention of getting a core dump when it crashes? I > >> already tried setting CoreDumpDirectory in Apache and also configuring > >> apache22limits_args in /etc/rc.conf but without effect. > > > > I ended up solving this on a machine where coredumps with Apache + PHP > > were highly common by setting sysctl kern.corefile to > > /var/cores/%P.%N.core, then made sure the /var/cores directory was > > root:wheel, perms 1777. =A0Otherwise I could not get a coredump. > > apache22limits_enable did not help either, nor did CoreDumpDirectory. >=20 > > Having fun yet? >=20 > Oh, I have years and years of fun debugging PHP, in one way or the other = :) >=20 > Your suggestion for setting core dump directory explicitely helped; > now it looks like I've hit an infinite recursion / stack eating bug > somewhere in PCRE... >=20 > #1703 0x0000000805d5c72e in match () from /usr/local/lib/libpcre.so.0 > #1704 0x0000000805d5b4f0 in match () from /usr/local/lib/libpcre.so.0 > #1705 0x0000000805d5c72e in match () from /usr/local/lib/libpcre.so.0 > #1706 0x0000000805d5b4f0 in match () from /usr/local/lib/libpcre.so.0 >=20 > However, I'm drawing the line at debugging PCRE, this will go into the > "don't do that" category. There's a fair chance that this isn't a bug in pcre, but the result of a poorly written expression. You may want to have a look at pcrestack(3). Fabian --Sig_/F/Yp616B8VTeOQ=Yab5tgDx Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6dvoUACgkQBYqIVf93VJ1WCACfa5rdKM/VaqImqRb9FoCh3HkX WzgAn2whO17JqGKaHA7nup/h2jwTg4xC =0TJz -----END PGP SIGNATURE----- --Sig_/F/Yp616B8VTeOQ=Yab5tgDx--