php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1277 OCIDefineByName() causes Apache crash
Submitted: 1999-03-28 18:21 UTC Modified: 2006-07-17 08:43 UTC
From: pumuckel at metropolis dot de Assigned: thies (profile)
Status: Closed Package: OCI8 related
PHP Version: 3.0.7 OS: Linux 2.0.36
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pumuckel at metropolis dot de
New email:
PHP Version: OS:

 

 [1999-03-28 18:21 UTC] pumuckel at metropolis dot de
[MODIFIED]

Apparently not OCIDefineByName causes the crash, but the OCIFetchRow() later on.

My table looks like:

CREATE TABLE TESTTABLE
(
        test1 VARCHAR(150) PRIMARY KEY,
        test2 VARCHAR(50),
        test3 VARCHAR(50),
        title VARCHAR(255),
        test4 VARCHAR(255),
        .....
)
TABLESPACE SPACE;

The statement is:
OCIParse($conn, "SELECT test1,test2,test3,TITLE FROM TESTTABLE WHERE TEST1 LIKE 'A%'");

Then I call following OCI methods:
OCIDefineByName($stmt, "TEST1", &$test1);
OCIDefineByName($stmt, "TEST2", &$test2);
OCIDefineByName($stmt, "TEST3", &$test3);
OCIDefineByName($stmt, "TITLE", &$title);
while(OCIFetchRow($stmt)) do_something();

If I leave LAST OciDefineByName in my source, php crashes. If I comment out last OCI command, the rest of php3 commands are executed successfully.

(I'm running Apache_1.3.4)


TRACKED DOWN LATER:
I've tracked down the problem with the php binary (without apache) and calling the same query again. This is what gdb tells me:

Program received signal SIGSEGV, Segmentation fault.
0x80814dc in oci8_fetch (statement=0x812ca20, nrows=1, 
    func=0x80ba589 "OCIFetch") at functions/oci8.c:1112
1112                                    pval->value.str.val[ pval->value.str.len ] = 0;
(gdb) where
#0  0x80814dc in oci8_fetch (statement=0x812ca20, nrows=1, 
    func=0x80ba589 "OCIFetch") at functions/oci8.c:1112
#1  0x8082b42 in php3_oci8_fetch (ht=0x8127fe8, return_value=0x80d07e8, 
    list=0x80f92e0, plist=0x80f92a0) at functions/oci8.c:2108
#2  0x8051d3c in phpparse () at control_structures_inline.h:930
#3  0x805ba18 in php3_parse (yyin=0x81091c0) at main.c:1534
#4  0x805c117 in main (argc=2, argv=0xbffff86c) at main.c:1842
(gdb) print pval
$2 = (pval *) 0x812fad8
(gdb) print pval->value.str
$3 = {val = 0x80b3920 "", len = 0}
(gdb) print column->retcode
$4 = 1405
(gdb) print pval->value.str
$12 = {val = 0x80b3920 "", len = 0}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-04-06 08:42 UTC] thies
fixed in CVS
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Mar 10 21:01:30 2025 UTC