Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Sep 2007 22:47:14 -0700
From:      "Gordon Stratton" <tsr2600@gmail.com>
To:        freebsd-database@freebsd.org
Subject:   Re: PHP5 + oci8 consistently segfaults on script exit
Message-ID:  <679088c80709122247o5b9ad2d2h25f22cfd7aadd13e@mail.gmail.com>
In-Reply-To: <679088c80707281159q2c906b4bn31ca7fcfdd2483a9@mail.gmail.com>
References:  <876507.10863.qm@web36614.mail.mud.yahoo.com> <679088c80707281159q2c906b4bn31ca7fcfdd2483a9@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?679088c80709122247o5b9ad2d2h25f22cfd7aadd13e>