php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43563 Apache Crash during oci_execute with fault address 0X000baee7
Submitted: 2007-12-11 09:10 UTC Modified: 2008-02-06 01:00 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: bteissier at tennaxia dot com Assigned: sixd (profile)
Status: No Feedback Package: OCI8 related
PHP Version: 5.2.5 OS: Win 2K3
Private report: No CVE-ID: None
 [2007-12-11 09:10 UTC] bteissier at tennaxia dot com
Description:
------------
Executing a simple request on a "normal" table makes Apache / php crash.
Cannot reproduce the error with the same app server but oracle on WIN2K3.

Apache crashes with this event log in windows:
Faulting application httpd.exe version 2.2.4.0, faulting module orageneric10.dll, version 10.2.0.1, fault address 0X000baee7

Application server:
Wamp 1.7.3 with
apache 2.2.4
Php 5.2.5
Oci version 1.2.4 Revision: 1.269.2.16.2.38
Oracle client 10.2 (same with 9.2)

Oracle server:
Oracle 10.1.0.3 on AIX
No use of db_link


Reproduce code:
---------------
<?php
        error_reporting(255);
        $db = OCI_NEW_CONNECT(user,password,"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=myservice)))");
        if(!$db)
                die("oci_connect error");

        //this doesnt crash
        //$s = oci_parse($db,"select * from champs WHERE table_field='cf_resp_site.id_user' and link_order_by is not null ");
        
        //this crashes
        $s = oci_parse($db,"select * from champs WHERE table_field='cf_resp_site.id_user'");
        oci_execute($s);

        oci_fetch_all($s,$res);
        echo '<pre>';
        print_r($res);
        oci_close($db);
?>


To create the table:

CREATE TABLE CHAMPS ( 
	TABLE_FIELD      	VARCHAR2(80) NOT NULL,
	CHAMP_OBLIGATOIRE	NUMBER(3,0) DEFAULT 1 NOT NULL,
	CHAMP_TYPE       	VARCHAR2(100) DEFAULT 'text' NOT NULL,
	CHAMP_LONGUEUR   	NUMBER(5,0) DEFAULT 0 NOT NULL,
	LINK_TABLE       	VARCHAR2(1024) NULL,
	LINK_FIELD       	VARCHAR2(255) NULL,
	LINK_VIEW        	VARCHAR2(255) NULL,
	LINK_WHERE       	VARCHAR2(1000) NULL,
	LINK_ORDER_BY    	VARCHAR2(100) NULL,
	LINK_WEAK        	NUMBER(8,0) NULL,
	VALIDATION       	VARCHAR2(255) NULL 
	);

CREATE UNIQUE INDEX TABLE_FIELD
	ON CHAMPS(TABLE_FIELD);

INSERT INTO CHAMPS(TABLE_FIELD, CHAMP_OBLIGATOIRE, CHAMP_TYPE, CHAMP_LONGUEUR, LINK_TABLE, LINK_FIELD, LINK_VIEW, LINK_WHERE, LINK_ORDER_BY, LINK_WEAK, VALIDATION)
  VALUES('cf_resp_site.id_user', 0, 'multi_select', 8, 'entreprises, all_user, users_access_sites uas, access_sites', 'id_entreprise', 'prenom, nom', 'access_sites.id_cf_site=''".$this->data_more[''id_site'']."'' AND uas.id_user=entreprises.id_entreprise AND uas.id_access_site=access_sites.id_access_site AND uas.id_access_tree=".$_SESSION[''id_access_tree'']." AND all_user.id_user = entreprises.id_entreprise AND all_user.allowed = ''1''', 'prenom, nom', 0, NULL);


Expected result:
----------------
A resultset containing all the columns of the table

Actual result:
--------------
An Apache Crash, no error log but an event log in Windows

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-11 10:44 UTC] bteissier at tennaxia dot com
Oracle server on HP UX, not AIX
 [2007-12-11 14:28 UTC] bteissier at tennaxia dot com
The snaphot does not solve the problem.
My company also used Zend Core for Oracle but had the same problem.
 [2007-12-11 19:57 UTC] sixd@php.net
I couldn't reproduce this - though I was using Linux and Instant Client 11g.

Does the crash happen consistently?  Does it happen if you run the script in CLI?  Does it happen to databases on other platforms or versions? Does it happen in SQL*Plus, . . .
 [2007-12-13 10:50 UTC] bteissier at tennaxia dot com
In sqlplus => OK
With php cli => same crash
Other plateforms : app on XP/2003 server and oracle 10g on XP/2003 server => OK
 [2008-01-29 01:17 UTC] sixd@php.net
I can't reproduce with PHP 5.2.5 CLI on Windows XP using Oracle XE (10.2.0.1) libraries and database.
 [2008-02-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-04-21 13:05 UTC] tdrewes at gmx dot net
Hi,

I have a similiar problem with my setup here:
PHP 5.2.5
Windows XP SP2
OCI8
Apache 2.0.63

When calling this code:
---------------8<------------------------
  $sql = 'BEGIN rtm.getrtmsitesummary(:p_site_id, :p_site_type_code_no, :p_site_status_type_code_no, :p_last_contact_time_from, :p_last_contact_time_to, :p_zip_code, :p_city, :p_cursor, :p_error); END;';
  $stmt = OCIParse($conn, $sql);

  // Create a new cursor resource
  $datalist = oci_new_cursor($conn);

   // Bind the cursor resource to the Oracle argument
  oci_bind_by_name($stmt,":p_site_id",$filter_siteid);
  oci_bind_by_name($stmt,":p_site_type_code_no",$filter_sitetype);
 oci_bind_by_name($stmt,":p_site_status_type_code_no",$filter_sitestatus);
  oci_bind_by_name($stmt,":p_last_contact_time_from",$fromdate);
  oci_bind_by_name($stmt,":p_last_contact_time_to",$todate);
  oci_bind_by_name($stmt,":p_zip_code",$filter_zipcode);
  oci_bind_by_name($stmt,":p_city",$filter_city);
  oci_bind_by_name($stmt,":p_cursor",$datalist,-1,OCI_B_CURSOR);
  oci_bind_by_name($stmt,":p_error",$p_error,70);


  // Execute the statement
  $result = oci_execute($stmt);
---------------8<------------------------
oci_execute crashes sometimes (about 50% of the time).
The weird thing is:
The first time it works all the time.
When calling the php screen/function again, it crashes with a probability of ~50%.
When calling the php screen/function again, it crashes with a probability of ~90%.

"Crashes" means in my context:
oci_execute is not returning. Apache crashes with this error:
---------------------------
Faulting application Apache.exe, version 2.0.63.200, faulting module orageneric10.dll, version 10.2.0.1, fault address 0x000baee7.
---------------------------
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC