php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32480 PHP exiting with non-zero status or seg fault
Submitted: 2005-03-29 11:01 UTC Modified: 2005-03-29 19:47 UTC
From: steve dot cersosimo at bellsouth dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 5.0.3 OS: Solaris 5.8
Private report: No CVE-ID: None
 [2005-03-29 11:01 UTC] steve dot cersosimo at bellsouth dot com
Description:
------------
I currently have my Oracle 8 environment set up properly as far as I can tell.  With the simple code below, I do not understand why PHP is exiting with a 255.  I think it should exit with a 0 status.  In other cases I get a segmentation fault, but I believe if the problem here is solved, the seg fault will go away.

Interestingly, the connection works fine, I can query and update perfectly.  This is causing me problems when it generates a segmentation fault and dumps that string to the browser.

Reproduce code:
---------------
# cat ocitest
#!/usr/local/bin/php
<?php
 error_reporting(E_ALL);

 $db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
                     (HOST = 172.16.0.153)(PORT=1521))
                     (CONNECT_DATA=(SERVICE_NAME=SPEED.WORLD)))";
 $connection = oci_connect("speed", "pass", $db);
 var_dump($connection);
?>
# ocitest
resource(6) of type (oci8 connection)
# echo $?
255


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-29 17:44 UTC] steve dot cersosimo at bellsouth dot com
That seems to have fixed the problem.  Should I wait for an official release, or is it safe to run the code you provided in a production environment.

Unless it is too much for this format, what was the problem?
 [2005-03-29 17:49 UTC] tony2001@php.net
I bet the problem is not OCI8 related and was fixed by this patch:
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.51.2.36&r2=1.51.2.37&ty=u

Could you please try to run PHP-CLI with simple <?php ?> script and check the status ?
 [2005-03-29 18:18 UTC] steve dot cersosimo at bellsouth dot com
I think the problem was somewhere in the OCI8 stuff.  Here are my results from a few tests.

# cat clitest
#!/usr/local/bin/php
<?php ?>
# clitest
# echo $?
0

# cat clitest2
#!/home/software/apps/php5-STABLE-200503291430/sapi/cli/php
<?php ?>
# clitest2    
# echo $?     
0

# cat ocitest
#!/usr/local/bin/php
<?php
 error_reporting(E_ALL);

 $db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
                     (HOST = 172.16.0.153)(PORT=1521))
                     (CONNECT_DATA=(SERVICE_NAME=SPEED.WORLD)))";
 $connection = oci_connect("speed", "pass", $db);
 var_dump($connection);
?>
# ocitest
resource(6) of type (oci8 connection)
# echo $?
255

# cat ocitest2
#!/home/software/apps/php5-STABLE-200503291430/sapi/cli/php
<?php
 error_reporting(E_ALL);

 $db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
                     (HOST = 172.16.0.153)(PORT=1521))
                     (CONNECT_DATA=(SERVICE_NAME=SPEED.WORLD)))";
 $connection = oci_connect("speed", "pass", $db);
 var_dump($connection);
?>
# ocitest2
resource(6) of type (oci8 connection)
# echo $?
0

Both of the first 2 tests exited with a 0 status, while the OCI8 test was only successful with the newly compiled PHP.
 [2005-03-29 19:47 UTC] tony2001@php.net
Hm. There were no changes in oci8 since November except for password grace period patch.
Anyway, if it works fine for you, then it's fixed.
If you find any additional info - feel free to reopen this report or post a new one.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 11 17:01:35 2024 UTC