From tsr2600 at gmail.com Wed Sep 12 23:14:05 2007 From: tsr2600 at gmail.com (Gordon Stratton) Date: Wed Sep 12 23:14:10 2007 Subject: PHP5 + oci8 consistently segfaults on script exit In-Reply-To: <679088c80707281159q2c906b4bn31ca7fcfdd2483a9@mail.gmail.com> References: <876507.10863.qm@web36614.mail.mud.yahoo.com> <679088c80707281159q2c906b4bn31ca7fcfdd2483a9@mail.gmail.com> Message-ID: <679088c80709122247o5b9ad2d2h25f22cfd7aadd13e@mail.gmail.com> 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 numisemis at yahoo.com Thu Sep 13 04:18:51 2007 From: numisemis at yahoo.com (Simun Mikecin) Date: Thu Sep 13 04:18:58 2007 Subject: bin/115631: Re: PHP5 + oci8 consistently segfaults on script exit In-Reply-To: <679088c80709130239k3959f5bbmcd0a595ca2f7b625@mail.gmail.com> Message-ID: <923227.25327.qm@web36606.mail.mud.yahoo.com> --- 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 tsr2600 at gmail.com Thu Sep 13 10:35:00 2007 From: tsr2600 at gmail.com (Gordon Stratton) Date: Thu Sep 13 10:35:03 2007 Subject: bin/115631: Re: PHP5 + oci8 consistently segfaults on script exit In-Reply-To: <679088c80709131028h53a8adbfx39199383516d2f02@mail.gmail.com> References: <679088c80709130239k3959f5bbmcd0a595ca2f7b625@mail.gmail.com> <923227.25327.qm@web36606.mail.mud.yahoo.com> <679088c80709131028h53a8adbfx39199383516d2f02@mail.gmail.com> Message-ID: <679088c80709131034s969e8c8m2589e15f653c482c@mail.gmail.com> > 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 From netslists at gmail.com Mon Sep 17 07:31:18 2007 From: netslists at gmail.com (Sten Daniel Soersdal) Date: Mon Sep 17 07:31:22 2007 Subject: Enabling norwegian sorting rules in PostgreSQL? Message-ID: <46EE897B.7000107@gmail.com> Does anyone know how to enable norwegian sorting rules for PostgreSQL (8.2.4) on FreeBSD 6.x ? I've tried just about everything i can think of, but the extra three letters just wont be sorted right. -- Sten Daniel Soersdal From ivoras at freebsd.org Tue Sep 18 06:12:47 2007 From: ivoras at freebsd.org (Ivan Voras) Date: Tue Sep 18 06:12:52 2007 Subject: Enabling norwegian sorting rules in PostgreSQL? In-Reply-To: <46EE897B.7000107@gmail.com> References: <46EE897B.7000107@gmail.com> Message-ID: Sten Daniel Soersdal wrote: > > Does anyone know how to enable norwegian sorting rules for PostgreSQL > (8.2.4) on FreeBSD 6.x ? > > I've tried just about everything i can think of, but the extra three > letters just wont be sorted right. You'll probably need the ICU patch for PostgreSQL, which is unfortunately only available for 8.1.x - maybe you can bug the developer to provide it for newer versions of PostgreSQL. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 249 bytes Desc: OpenPGP digital signature Url : http://lists.freebsd.org/pipermail/freebsd-database/attachments/20070918/d6f3f8ba/signature.pgp From netslists at gmail.com Tue Sep 18 07:26:46 2007 From: netslists at gmail.com (Sten Daniel Soersdal) Date: Tue Sep 18 07:26:52 2007 Subject: Enabling norwegian sorting rules in PostgreSQL? In-Reply-To: References: <46EE897B.7000107@gmail.com> Message-ID: <46EFE01E.8090603@gmail.com> Ivan Voras wrote: > Sten Daniel Soersdal wrote: >> >> Does anyone know how to enable norwegian sorting rules for PostgreSQL >> (8.2.4) on FreeBSD 6.x ? >> >> I've tried just about everything i can think of, but the extra three >> letters just wont be sorted right. > > You'll probably need the ICU patch for PostgreSQL, which is > unfortunately only available for 8.1.x - maybe you can bug the developer > to provide it for newer versions of PostgreSQL. > Actually, i tried that and that didn't help at all. Granted that was with UTF-8. I came across an old open PR (51920) that adds Norwegian Collate (ISO8859-1 + ISO8859-15) support to FreeBSD. Now my console and my postgresql sorts correctly. I just hope someone would commit this support to the tree. The LATIN-1 / la_LN.ISO8859-1 collate is not right for norwegian alphabet. http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/51920 -- Sten Daniel Soersdal