From owner-freebsd-database@FreeBSD.ORG Thu Sep 13 06:14:05 2007 Return-Path: Delivered-To: freebsd-database@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67E8116A417 for ; Thu, 13 Sep 2007 06:14:05 +0000 (UTC) (envelope-from tsr2600@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.231]) by mx1.freebsd.org (Postfix) with ESMTP id 3BE0C13C46A for ; Thu, 13 Sep 2007 06:14:04 +0000 (UTC) (envelope-from tsr2600@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so373331wxd for ; Wed, 12 Sep 2007 23:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=eoTuleZFpktZThNFX3Pkcekxjhog8B3W6pW6Kj2Y9dw=; b=By/CysHXJeMXp3iDhBMwmwFBI5pRA9e0v8rL/lV0EYPIJkM5lLDymz/CiFdbAKd3M45rSWhvaKv3oEgAeA//ClppcjiGaAGmyns7N1Ye5qtLd36SVyziaCQ8UMOxe3EAMXASy9gUfASOhe02pg9hLpI9us8UXCkG9MbvfuKkIxc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=S0Mzcoq+X5EFSt1BY7R2eayf3oobB/4naUqKIs2exf00GwzF2XyE+mHeqa72sDmzYIfjwRSvDk2H5I/BRvjJcbZxsFGCNT2G/fgwe1jHkFJBxFTVXIHPZDjxMf7GVv5OpE+JKRk89BI5a21HKhSD+vf2+LysDfkPs1uwQ0YkeZs= Received: by 10.90.106.11 with SMTP id e11mr824167agc.1189662434201; Wed, 12 Sep 2007 22:47:14 -0700 (PDT) Received: by 10.35.29.10 with HTTP; Wed, 12 Sep 2007 22:47:14 -0700 (PDT) Message-ID: <679088c80709122247o5b9ad2d2h25f22cfd7aadd13e@mail.gmail.com> Date: Wed, 12 Sep 2007 22:47:14 -0700 From: "Gordon Stratton" To: freebsd-database@freebsd.org In-Reply-To: <679088c80707281159q2c906b4bn31ca7fcfdd2483a9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <876507.10863.qm@web36614.mail.mud.yahoo.com> <679088c80707281159q2c906b4bn31ca7fcfdd2483a9@mail.gmail.com> Subject: Re: PHP5 + oci8 consistently segfaults on script exit X-BeenThere: freebsd-database@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Database use and development under FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2007 06:14:05 -0000 I've implemented a solution that works around the problem. I'm fairly sure that the Oracle shared library is doing something incorrect such as registering functions via atexit(3). When the module is unloaded and PHP exits, the called functions have since been unmapped so calling them results in a segfault. Does this sound plausible? In any case, my workaround is to comment out the call to the macro DL_UNLOAD in Zend/zend_API.c (the macro expands to the call to dlclose(3) on FreeBSD and other platforms). Doing it at that point works out because PHP always exits after dlclose(3)ing all of its extensions (hence the segfault), but clearly it is not an elegant or clean solution. I have prepared a patch which I am using in my local ports tree that comments out DL_UNLOAD as I mentioned earlier, and everything is working just fine (CLI and mod_php) on FreeBSD 6.2 with PHP 5.2.3 and oracle8-client-0.1.1_1. If anyone is interested in this patch, contact me off-list. Gordon