From owner-freebsd-stable@FreeBSD.ORG Tue Oct 18 15:24:45 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 C10BD1065670 for ; Tue, 18 Oct 2011 15:24:45 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 824948FC12 for ; Tue, 18 Oct 2011 15:24:45 +0000 (UTC) Received: by gyd8 with SMTP id 8so888014gyd.13 for ; Tue, 18 Oct 2011 08:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=hzbe3InVZvyjlfpNhxWP2Zv8W1+ybGi3dr3IaZdGfsA=; b=UmsIxHpV0RQUN78xN6nh/q87fL2yVdNPEf3i7MhhQ+/IJaDFoSkc6mJ2Os7ByqmEEH CSpZr0XagvvePWhd19KWwnQQk/CHVwlogmocN6Qn49m9Z4zFpA/fKBvjYtRrhHM5dCwz pMSjkO4cg8QhttyAC80xThUMv0TnxN7W7blV8= Received: by 10.100.233.21 with SMTP id f21mr585493anh.44.1318949648279; Tue, 18 Oct 2011 07:54:08 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.100.58.6 with HTTP; Tue, 18 Oct 2011 07:53:28 -0700 (PDT) In-Reply-To: <20111018144312.GA17496@icarus.home.lan> References: <20111018144312.GA17496@icarus.home.lan> From: Ivan Voras Date: Tue, 18 Oct 2011 16:53:28 +0200 X-Google-Sender-Auth: Y4zRFz54IIi1aFEZGvKk0ywakrs Message-ID: To: Jeremy Chadwick Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable@freebsd.org 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 15:24:45 -0000 On 18 October 2011 16:43, Jeremy Chadwick wrote: > 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 PHP= . >> >> 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. =C2=A0Otherwise I could not get a coredump. > apache22limits_enable did not help either, nor did CoreDumpDirectory. > Having fun yet? Oh, I have years and years of fun debugging PHP, in one way or the other :) 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... #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 However, I'm drawing the line at debugging PCRE, this will go into the "don't do that" category.