ID:               27978
 User updated by:  megan dot boardman at rweinnogy dot com
 Reported By:      megan dot boardman at rweinnogy dot com
 Status:           Bogus
 Bug Type:         Reproducible crash
 Operating System: UNIX 5.1 ALPHA
 PHP Version:      4.3.5
 New Comment:

I've managed to trace this to a problem with the Oracle functions. 
i.e. I get no aborts in the Apache log until I try using OCILogon() to
actually try to connect to the database.

Could this be related to needing pthread linked in Apache
(www.php.net/manual/en/ref.oc18.php)?

I recognise that supporting legacy systems is difficult, but the
reality is that these systems do still exist and upgrading is not
always an option.  Would be helpful if you could at least list what you
are prepared to test against, and what systems you claim compatibility
with.

For what it's worth example code is given below (need to fill in
relevant database, email, and db query).  Behaviour I see is:
- With all database related calls commented out, I get one email, the
cookie gets set and I always get the data printed to the web browser).
- With database calls in, I sometimes get multiple emails, muliple
database submissions and may or may not get the cookie / HTML data back
at the browerser end.  When this poor behaviour occurs it coincides
with an Abort(6) error in the Apache log.



<?php

function callFunction(&$doc, &$a) {

  $Database = "xxxx";

  // Connect to database and get unique key - simulate here by
assigning key
  $conn = OCILogon("xxxx", "xxxx", $Database);
  $returnArray = array();
  $cursor = OCIParse($conn, "select user_reports_seq.NEXTVAL from
dual");
  $ret = OCIExecute($cursor, OCI_DEFAULT);
  if ($ret) {
      OCIFetchStatement($cursor, &$returnArray);
      OCICommit($conn);
  } else {
      OCIRollback($conn);
  }
  OCIFreeStatement($cursor); 
  OCILogOff($conn);

  $row = $returnArray["NEXTVAL"];
  $keys = array_keys($row);
  $Key = $row[array_pop($keys)];

  if ($ret) {
      // Send notification message
      $message = "Fault report " . $Key . " requires your attention.";
      mail("[EMAIL PROTECTED]", " Fault Report - " . $Key, $message,
"From: [EMAIL PROTECTED]");
             
      // Present message to user
      $doc[$a++] = "<p>Submission Successful!</p>";
      $doc[$a++] = "<p>The system reference number for your report is
<b>$Key</b>.</p>"; 
      SetCookie("Submitted", $Key);
             
   } else {
       $doc[$a++] = "<p>Submission failed</p>";
   }
}


$doc = array();
$a = 0;
$doc[$a++] = "<html><head><title>Test PHP Page</title></head><body>";

callFunction($doc, $a);

$doc[$a++]="</body></html>";
foreach($doc as $data) {
    print $data;
}

?>


Previous Comments:
------------------------------------------------------------------------

[2004-04-13 12:30:07] [EMAIL PROTECTED]

This report is as useful as not reporting anything. Please come up with
SOLID reproducing script and how to reproduce.
(and note: We don't have any access to any alpha machines..aren't those
some relic anyway? Get new machine? :)


------------------------------------------------------------------------

[2004-04-13 10:01:35] megan dot boardman at rweinnogy dot com

Description:
------------
Since upgrading to PHP 4 have been experiencing problems with Apache
1.3.26 periodically appearing to crash.  This has gradually gotten
worse as we have worked our way up through the 4.x generation of PHP. 

Timeline goes as follows (based on messages in Apache error_log):

- PHP 4.0.4pl1 gave occasional child XXXX exit signal Segmentation
Fault (11).

- PHP 4.1.2 gave no errors.

- PHP 4.3.3, 4.3.4 and 4.3.5 gave frequent child XXXXX exit signal
Abort (6) errors

This PHP script is being used to submit requests to a database.  This
"aborting" behaviour appears to be causing the sending web browser to
lose contact with Apache, and hence send the form post multiple times. 
The PHP script always appears to get as far as sending the submission
to the database, but then falls over before sending the response back
to the web server.  Result -> multiple duplicate database submissions,
occasional "Page Not Found" 505 errors in the web browser.

Working with an Oracle 8 database and mod_fastcgi 2.2.12

Reproduce code:
---------------
Cannot easily reproduce code, however general form is as follows:

1) Create object that contains contents of HTML page being constructed

2) Pass object by reference to function

3) Function builds database submission (based on variables that have
been POSTed by a previous web form submision) and then sends an email,
sets a cookie and builds HTML based on result from database.

4) Function ends and web page printed to screen

- DB Submission always happens
- Email always happens
- Apache appears to fall over before the cookie gets set and before the
HTML gets displayed

NOTE:
- Seems order invarient.
- Methodology applied for earlier webforms posts, and works without
multiple submissions.


Expected result:
----------------
- DB Submission 
- Email to be sent
- Cookie set in browser
- Resultant HTML posted to screen

Actual result:
--------------
- DB submission
- Email sent
- Cookie & HTML display do NOT necessarily occur


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27978&edit=1

Reply via email to