php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27620 Apache Child Segfaults Using OCI8 and "PutEnv"
Submitted: 2004-03-17 02:49 UTC Modified: 2004-09-22 16:35 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: bmuller at milchstrasse dot de Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5CVS-2004-03-17 (dev) OS: RedHat ES 3
Private report: No CVE-ID: None
 [2004-03-17 02:49 UTC] bmuller at milchstrasse dot de
Description:
------------
When Using OCI8 and the required "PutEnv" from PHP 4.x in the newest CVS Build, the Apache Child Segfaults

[Tue Mar 16 17:56:28 2004] [notice] child pid 2931 exit signal Segmentation fault (11)

and the Browser (IE) reports a "No page to show" (translated from German).

Reproduce code:
---------------
<?

putenv("ORACLE_HOME=/home/oracle");
	
$database_connection=OCILogon"scott","tiger","my_database");
if(!$database_connection) die("NO Database!") else printf("Connection Established");

?>

Expected result:
----------------
The Browser should show "Connection Established"

Actual result:
--------------
and the Browser (IE) reports a "No page to show" (translated from German).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-17 03:00 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

You need to set the environment BEFORE starting your webserver, RTFM.
 [2004-03-17 03:05 UTC] bmuller at milchstrasse dot de
Thanks for the RTFM, but when something segfaults, I think it IS a problem, and yes, I _did_ set the env before starting the webserver.  This application has been running on PHP 4.x for the last 2 years, _without_ segfaulting.  Don't you guys thing a more professional solution / comment would be apropriate?

Thanks in advance.
 [2004-03-17 03:10 UTC] tony2001@php.net
Derick, it should work with putenv() too.

[bmuller at milchstrasse dot de], plz, provide a backtrace.
Read here: http://bugs.php.net/bugs-generating-backtrace.php about generating a backtrace.
 [2004-03-17 03:23 UTC] derick@php.net
Since when does putenv work? The libraries are initialized before the script runs...
 [2004-03-17 03:37 UTC] tony2001@php.net
You're right, ocilogon() doesn't connect, but it should generate 'ORA-12154: TNS:could not resolve service name' error as it does for me.
It shouldn't segfault anyway.
 [2004-03-17 04:11 UTC] derick@php.net
5$ that it crashes inside the Oracle library ;-)
 [2004-09-19 22:34 UTC] paul dot g dot smith at cantos dot com
We upgraded our PHP installation (running on RH 3.0ES) from 4.3.6 to 4.3.8 today.

Code previously working fine is now segfaulting 99% of the time inside OCILogin(). Absolutely reproducible.

PHP was built from source both times. With 4.3.6 it worked fine. With 4.3.8 the segfault is solid and reproducible.

No other changes eg to the Oracle client installation.

Viz it can't be blamed on Oracle, the only thing that changed was the PHP version, therefore suspicion is that it points at something broken in the new version of PHP.
 [2004-09-20 00:22 UTC] rasmus@php.net
Again, please provide a backtrace of that segfault.
http://bugs.php.net/bugs-generating-backtrace.php
 [2004-09-21 12:54 UTC] paul dot g dot smith at cantos dot com
This is a production system. I'm not in a position to install a debug build on it unfortunately. We have to backtrack to PHP 4.3.6 for the time being on that server, can't leave it faulty, as it's a live webserver!

We'll endeavour to find a sacrificial system and install and reproduce the problem on that - then we can do a backtrace - please bear with us while we pull the bits together to do that.

FYI, the segfault is reproducible from PHP 4.3.8 through 4.3.9RC3 up to and including 5.0.1. We're using Oracle client 9.2.0.1.0 on RH ES3.
 [2004-09-22 11:03 UTC] paul dot g dot smith at cantos dot com
Verrrrry interesting. You can close this report now. Reinstalled on other system, it worked fine. Migrating the exact same config back to the original system this morning that now works fine as well.

It looks as if the problem was that with LD_LIBRARY_PATH specified as an Apache env variable, OCIlogin would cause segfault. Which makes no sense, but there you go. Having removed that and now only specifying ORACLE_HOME as env var: it works fine.

So now we're running with 4.3.8 on all our systems and we're happy again. :-)
 [2004-09-22 16:36 UTC] derick@php.net
Marking as bogus then.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC