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 From owner-freebsd-database@FreeBSD.ORG Thu Sep 13 11:18:51 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 A776516A418 for ; Thu, 13 Sep 2007 11:18:51 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: from web36606.mail.mud.yahoo.com (web36606.mail.mud.yahoo.com [209.191.85.23]) by mx1.freebsd.org (Postfix) with SMTP id 7D8FC13C474 for ; Thu, 13 Sep 2007 11:18:51 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: (qmail 25667 invoked by uid 60001); 13 Sep 2007 10:52:08 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=yKwQzF1Y5ehG1V3UPx0weYSHWHYRe987FTpT7xSs4rLEGkoHVj9MPNsBN9O7xLm7uXLmZJtrqbeDH0Pqfr3kwFTQUEfsIf6sPn6EJtV14p9t5NGpu1a+0o0DcZ75Y/vy5LD+CWVGGwloBzTqPYxDMSO2MsMJhHG7bw9INV5+dDE=; X-YMail-OSG: 3YxYrDYVM1mhJKXCHYZ9OId.emlp3_ESOx.7pWrsFpPsHV6j.vLZ3Hg9kpgiNzyS_UmT1Ognu.acDVFm4vkTPQCoHIOZcOK2GcEQN0F7EwEmTgfpYzKRCH1LnTw.jctmLxCDHCVrNoPa2cDg Received: from [213.147.110.159] by web36606.mail.mud.yahoo.com via HTTP; Thu, 13 Sep 2007 03:52:08 PDT Date: Thu, 13 Sep 2007 03:52:08 -0700 (PDT) From: Simun Mikecin To: Gordon Stratton In-Reply-To: <679088c80709130239k3959f5bbmcd0a595ca2f7b625@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <923227.25327.qm@web36606.mail.mud.yahoo.com> Cc: freebsd-database@freebsd.org, mi@aldan.algebra.com, bug-followup@freebsd.org Subject: bin/115631: 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 11:18:51 -0000 --- Gordon Stratton wrote: > I did some testing, and the patch does seem to help. However, there seem > to be a couple cases where a segmentation fault still occurs. The first > is when I attempt to open a file with PHP that does not exist: > > $ php doesntexist > Could not open input file: doesntexist > Segmentation fault > > The second case involves a different PHP extension, pdo_dblib.so (the > OCI8 extensions seem to work OK now): > > (gdb) bt > #0 0x2912313c in ?? () > #1 0x285855c7 in pthread_mutex_lock () from /lib/libc.so.6 > #2 0x28f09bf3 in dbexit () from /usr/local/lib/libsybdb.so.5 > #3 0x28efb86b in zm_shutdown_pdo_dblib () from > /usr/local/lib/php/20060613-debug/pdo_dblib.so > #4 0x0816ceb0 in module_destructor (module=0x832a300) at > /usr/ports/lang/php5/work/php-5.2.3/Zend/zend_API.c:1894 > #5 0x0817171a in zend_hash_apply_deleter (ht=0x826c620, p=0x8330280) > at /usr/ports/lang/php5/work/php-5.2.3/Zend/zend_hash.c:611 > #6 0x08171873 in zend_hash_graceful_reverse_destroy (ht=0x826c620) at > /usr/ports/lang/php5/work/php-5.2.3/Zend/zend_hash.c:646 > #7 0x08166ca7 in zend_shutdown () at > /usr/ports/lang/php5/work/php-5.2.3/Zend/zend.c:733 > #8 0x081205f5 in php_module_shutdown () at > /usr/ports/lang/php5/work/php-5.2.3/main/main.c:1684 > #9 0x081ce73b in main (argc=20, argv=0xbfbfeca0) at > /usr/ports/lang/php5/work/php-5.2.3/sapi/cli/php_cli.c:1333 Have those two cases (doesntexist and pdo_dblib) segfaulted without this patch? ____________________________________________________________________________________ Yahoo! oneSearch: Finally, mobile search that gives answers, not web links. http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC From owner-freebsd-database@FreeBSD.ORG Thu Sep 13 17:35:00 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 59D5416A417 for ; Thu, 13 Sep 2007 17:35:00 +0000 (UTC) (envelope-from tsr2600@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by mx1.freebsd.org (Postfix) with ESMTP id 0494A13C461 for ; Thu, 13 Sep 2007 17:34:54 +0000 (UTC) (envelope-from tsr2600@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so113335anc for ; Thu, 13 Sep 2007 10:34:54 -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:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=3W7+vWyY/+X/yaUxe7FiW4G+NuhWkkfyToTDn/2xKCU=; b=M/Njb28lE04bdV4NvhL/n2G2BRbvXSNA7t0DpNGkVvVtpBVz/8iMoip/wNzuNWEaH9MMMNG9LSeZX8TtopGCvybKqwo/Do6SxqU2AI5ZDny56UGOKVFi0Esb5Bhi1RoUZ4A6XNh9PDJC3VPxQhjfXXFT23o/1cXGs5oMfsFtgvY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fxTLgLAcBydJNxCyCJexmV1D5nsI60MzZG65R2RX68KRM5UORsaVBQWOmQIRMxL8PJSUreJdRVaCpSNjkftwjIciu90aieaDhw0G3sUIytPhWEKu0xbBmuBWLFtSObnHvZhbhq+MSFlFow/91ScT6lit93wK7/dSqAu3YhaHghM= Received: by 10.100.106.5 with SMTP id e5mr1227305anc.1189704894411; Thu, 13 Sep 2007 10:34:54 -0700 (PDT) Received: by 10.35.29.10 with HTTP; Thu, 13 Sep 2007 10:34:54 -0700 (PDT) Message-ID: <679088c80709131034s969e8c8m2589e15f653c482c@mail.gmail.com> Date: Thu, 13 Sep 2007 10:34:54 -0700 From: "Gordon Stratton" To: numisemis@yahoo.com In-Reply-To: <679088c80709131028h53a8adbfx39199383516d2f02@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <679088c80709130239k3959f5bbmcd0a595ca2f7b625@mail.gmail.com> <923227.25327.qm@web36606.mail.mud.yahoo.com> <679088c80709131028h53a8adbfx39199383516d2f02@mail.gmail.com> Cc: freebsd-database@freebsd.org, mi@aldan.algebra.com, bug-followup@freebsd.org Subject: Re: bin/115631: 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 17:35:00 -0000 > On 9/13/07, Simun Mikecin wrote: > Have those two cases (doesntexist and pdo_dblib) segfaulted without this patch? (CC'ing lists this time, my apologies) doesntexist segfaults without the patch for sure, I can't say for sure about pdo_dblib.. I never _saw_ it but it's possible that other modules were segfaulting first so it never got a chance to segfault. There is at least one case now where PHP does not segfault with the patch where it did before. Gordon