Re: Segmentation Fault with Oracle / oci8.php
| From: | Bertrand Mansion | Date: | Fri, 07 Dec 2001 09:41:45 +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-3422@lists.php.net to get a copy of this message | ||
<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)...
>
> Now I'm not sure what EXACTLY i am doing wrong, 'cause without it seems to
> work (more) properly.
> I still get seg faults quite often, but at least the script runs and shows
> output and segfaults
> only on exit, it seems.
>
> Anyone any idea?
> (I did google about that segfault thingie and found some posts to this list
> from betrand on nov, 6.
> but couldn't find any answers to them yet)
Here was my solution :
I changed the code of oci8.c '_oci_conn_list_dtor' function in the php
extensions directory.
if (connection->pServiceContext) {
/* connection->error =
OCITransRollback(connection->pServiceContext,
connection->pError,
(ub4)0);
if (connection->error) {
oci_error(connection->pError, "failed to rollback outstanding
transactions!", connection->error);
}
*/
OCIHandleFree((dvoid *) connection->pServiceContext, (ub4)
OCI_HTYPE_SVCCTX);
I commented the code which was trying to rollback transactions when there
was none. Pretty strange logic... Maybe there is something I did not get as
I did not study all the code, but it seems to work better now. Does not make
apache process crash anymore.
As I said before, that was what was happening when I used exit function in
my scripts. No matter which version of Oracle, on Suse 7.2 and RedHat 6.
If it works for you, give us some feedback. Thanks.
Bertrand Mansion
Mamasam