php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37822 Using PDO from CLI script results in seg fault
Submitted: 2006-06-15 23:13 UTC Modified: 2006-06-16 18:45 UTC
From: toolbag at gmail dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.1.4 OS: GNU/Linux kernel 2.4.21
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: toolbag at gmail dot com
New email:
PHP Version: OS:

 

 [2006-06-15 23:13 UTC] toolbag at gmail dot com
Description:
------------
Instantiating a PDO object from a PHP script that is called from the CLI results in a seg fault. Running the same script from a browser is perfectly ok. I am using PDO + PDO_OCI in a large web app with no problems, but when I coded up some PDO/OCI code to run within a cronjob, this happens.

Reproduce code:
---------------
<?php

try {
        $dbh = new PDO("oci:dbname=<host>", "<user>", "<pass>");
}catch(PDOException $e) {
        die("Error: " . $e->getMessage() );
}
$dbh = null;

echo "I am never reached";

?>

Expected result:
----------------
From the browser I see: "I am never reached".
From the CLI: immediate seg fault.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-16 15:47 UTC] toolbag at gmail dot com
After more poking around I have determined that this is only a problem when a PDO object with driver type of Oracle is used. Trying to create an empty PDO objects results in missing parameters (good!) but once the "oci:dbname=<db>" argument is thrown in, the seg fault appears. We are re-compiling with debugging enabled, so hopefully soon I can provide more info.
 [2006-06-16 18:44 UTC] toolbag at gmail dot com
Resolution!

This had to do with how the oci8 library was compiled in. Previously we were doing:

--with-oci8=shared

but removing the "shared" attribute and having just:

--with-oci8

thereby defaulting to "static" works. No more segfaults. Since the PDO modules had to be compiled in as shared we figured the same was true for OCI8. Not the case.
 [2006-06-16 18:45 UTC] toolbag at gmail dot com
Closing due to found resolution.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 03:01:28 2024 UTC