Re: Segmentation Fault with Oracle / oci8.php

From: Date: Mon, 10 Dec 2001 09:38:36 +0000
Subject: Re: Segmentation Fault with Oracle / oci8.php
References: 1  Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-3427@lists.php.net to get a copy of this message
le 8/12/01 10:40, Thies C. Arntzen à thies@thieso.net a écrit : > On Fri, Dec 07, 2001 at 10:41:45AM +0100, Bertrand Mansion wrote: >> <Karsten.Kraus@web.de> wrote : >> >>> Hi list, >>> >>> perhaps on of you can help me to solve this: >>> >>> i'm using php 4.0.6 with apache 1.3.19 on linux (kernel 2.2.1x). >>> When I turn off autocommit, and try doing an insert statement >>> (which could have an error, but that shouldn't be the problem) >>> with simple_query, php hangs when it tries to do OCIExecute($sql, >>> OCI_DEFAULT)... > > if you send me a short testcase i'll do a proper fix. > the method shown below will cause troube with persistent > connection when a script gets terminated abnormally. your > open transactions will be committed instead of rolled back - > whcih is _NOT_ what you want!! > > tc Hi Thies, Sorry for not replying sooner, I was away this weekend. I use PHP 4.0.6 on Linux (RedHat or Suse, maybe others) and work with Oracle 8.1.7 and 9.0.1 SE installed as servers. Apache is 1.3.20 and 1.3.22 with 5 processes (I've also used it with 1 process in order to debug) as this will cause it to crash quicker. PHP is compiled with oci8 and sigchild enabled. All paths are set up correctly before apache starts. I remember the crash happening when I was using PEAR Auth class with a PEAR DB container and issued an exit(); or die(); in the drawLogin() method in order to get rid of the need to use checkAuth method. After some tests, I noticed that every time I would issue exit(); or die(); after having opened a new connection (and even if I did nothing with it), php would log 'failed to rollback outstanding transactions' and after a few warnings like these, Apache would crash. Oci8 was trying to rollback outstanding transactions but there was none. Somebody else I know does not use PEAR DB but get the same errors. According to me, just end up one of your scripts, which does not have any outstanding transactions, with an exit(); at some time and this should do the trick. If the number of Apache processes is bigger, Apache does not seem to crash though. So keep it low. Another bug I found in oci8.c was with ociInternalDebug. Use it and then issue an exit(); and it will make a crash. Haven't looked any closer at this one. If that's not enough to get rid of this evil bug, let me know, I will try to work on a pre-made script but this will take longer as I will need to set up still another dev environment. Thanks for your time and for your interest in this. Bertrand Mansion Mamasam

« previous php.pear.dev (#3427) next »