From owner-freebsd-stable@FreeBSD.ORG Sun May 18 20:05:14 2008 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 6C7D01065678 for ; Sun, 18 May 2008 20:05:14 +0000 (UTC) (envelope-from fbsd-ml@scrapper.ca) Received: from pd3mo2so.prod.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id 413478FC1B for ; Sun, 18 May 2008 20:05:14 +0000 (UTC) (envelope-from fbsd-ml@scrapper.ca) Received: from pd2mr2so.prod.shaw.ca (pd2mr2so-qfe3.prod.shaw.ca [10.0.141.109]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0K120078LYGNDF80@l-daemon> for freebsd-stable@freebsd.org; Sun, 18 May 2008 14:05:11 -0600 (MDT) Received: from pn2ml4so.prod.shaw.ca ([10.0.121.148]) by pd2mr2so.prod.shaw.ca (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K1200I5XYGNKW80@pd2mr2so.prod.shaw.ca> for freebsd-stable@freebsd.org; Sun, 18 May 2008 14:05:12 -0600 (MDT) Received: from proven.lan ([24.85.241.34]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0K1200HMSYGME630@l-daemon> for freebsd-stable@freebsd.org; Sun, 18 May 2008 14:05:11 -0600 (MDT) Received: from proven.lan (localhost [127.0.0.1]) by proven.lan (8.14.2/8.14.2) with ESMTP id m4IK5AnY085697 for ; Sun, 18 May 2008 13:05:10 -0700 (PDT envelope-from fbsd-ml@scrapper.ca) Received: from localhost (localhost [[UNIX: localhost]]) by proven.lan (8.14.2/8.14.2/Submit) id m4IK5ABf085696 for freebsd-stable@freebsd.org; Sun, 18 May 2008 13:05:10 -0700 (PDT envelope-from fbsd-ml@scrapper.ca) Date: Sun, 18 May 2008 13:05:10 -0700 From: Norbert Papke In-reply-to: <200805171118.16482.fbsd-ml@scrapper.ca> To: freebsd-stable@freebsd.org Message-id: <200805181305.10243.fbsd-ml@scrapper.ca> Organization: Archaeological Filing MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit Content-disposition: inline References: <200805171118.16482.fbsd-ml@scrapper.ca> X-Authentication-warning: proven.lan: npapke set sender to fbsd-ml@scrapper.ca using -f User-Agent: KMail/1.9.7 Subject: Re: Apache seg faults -- Possible problem with libc? [solved] 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: Sun, 18 May 2008 20:05:14 -0000 On May 17, 2008, Norbert Papke wrote: > Environment: FreeBSD 7.0 Stable (as of Apr 30), apache-2.0.63 > > I am experiencing Apache crashes on a fairly consistent and frequent basis. > The crash occurs in strncmp(). To help with the diagnosis, I have rebuilt > libc with debug symbols. Here is a typical stack dump: > > #0 strncmp () at /usr/src/lib/libc/i386/string/strncmp.S:69 > #1 0x2832558c in getenv (name=0x28338648 "TZ") > at /usr/src/lib/libc/stdlib/getenv.c:144 > #2 0x2830ce3a in tzset_basic (rdlocked=0) > at /usr/src/lib/libc/stdtime/localtime.c:1013 > #3 0x2830d42f in localtime (timep=0xbfbfc1d4) > at /usr/src/lib/libc/stdtime/localtime.c:1158 The problem is not in libc. Instead it is caused by Apache's PHP5 module. Under certain circumstances, the module will allocate memory for an environment variable, pass this variable to putenv(), and then immediately free the memory. putenv(), of course, requires the environment variable to remain valid. The seg fault occurs at a subsequent getenv() invocation. I have contacted the PHP5 maintainer with this information. Best, -- Norbert.