Bug #72005 [NEW]: SQL queries exceeding 8 columns and multiple rows causes segfault
| From: | clfenton at northeaststate dot edu | Date: | Mon, 11 Apr 2016 19:37:16 +0000 |
| Subject: | Bug #72005 [NEW]: SQL queries exceeding 8 columns and multiple rows causes segfault | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-200490@lists.php.net to get a copy of this message | ||
From: clfenton at northeaststate dot edu
Operating system: Ubuntu 14.04
PHP version: 7.0.5
Package: OCI8 related
Bug Type: Bug
Bug description:SQL queries exceeding 8 columns and multiple rows causes segfault
Description:
------------
Server: Ubuntu 14.04.4 LTS
PHP:PHP 7.0.3-5+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend
Technologies
Oracle instant client 12.1
Oci8: 2.1.0
Apache 2.4.7
Any SQL query that returns multiple rows and is over 8 columns will
cause a segfault.
TRACE START [2016-04-11 19:31:44]
0.0007 360832 +360832 -> {main}()
/home/robowman/public_html/view.debug.query.php:0
0.0008 360832 +0 -> session_start()
/home/robowman/public_html/view.debug.query.php:20
0.0011 361472 >=> TRUE
0.0013 361840 +1008 ->
require_once(/home/robowman/public_html/inc/config.php)
/home/robowman/public_html/view.debug.query.php:21
0.0013 361840 +0 -> define('SESSION_TIMEOUT', 30)
/home/robowman/public_html/inc/config.php:20
0.0022 361872 >=> TRUE
0.0022 361872 +32 -> define('CHECK_BROWSER', TRUE)
/home/robowman/public_html/inc/config.php:23
0.0023 361904 >=> TRUE
0.0023 361904 +32 -> define('IP_OCTETS', 2)
/home/robowman/public_html/inc/config.php:24
0.0023 361936 >=> TRUE
0.0023 361936 +32 -> define('SALT', 'NeSCC!(*')
/home/robowman/public_html/inc/config.php:25
0.0023 361968 >=> TRUE
0.0023 361968 +32 -> define('REGENERATE_ID', TRUE)
/home/robowman/public_html/inc/config.php:26
0.0025 362000 >=> TRUE
0.0025 362000 +32 -> define('ROOT_URL',
'https://172.22.1.89/robowman/')
/home/robowman/public_html/inc/config.php:28
0.0026 362032 >=> TRUE
0.0033 362712 +712 ->
require_once(/home/robowman/public_html/query/debug.query.php)
/home/robowman/public_html/view.debug.query.php:23
0.0041 364928 +2216 ->
require_once(/home/robowman/public_html/class/ROBDB_Oracle_Connect.php)
/home/robowman/public_html/query/debug.query.php:29
0.0514 366648 +1720 -> ROBDB_Query::getInstance()
/home/robowman/public_html/query/debug.query.php:102
0.0515 366760 +112 -> ROBDB_Query->__construct()
/home/robowman/public_html/class/ROBDB_Oracle_Connect.php:96
0.0515 366760 +0 -> ROBDB_Oracle->__construct()
/home/robowman/public_html/class/ROBDB_Oracle_Connect.php:84
0.0516 366760 +0 -> oci_connect('dbuser',
'secret', 'OIR_BAN8')
/home/robowman/public_html/class/ROBDB_Oracle_Connect.php:26
0.2511 367040 >=> resource(6) of type (oci8
connection)
0.2512 367040 >=> class ROBDB_Query { private
$statement = NULL; private $error_message = NULL; private $results =
NULL; protected $db_connection
=
resource(6) of type (oci8 connection) }
0.2513 367416 +656 -> ROBDB_Query->set_query('SELECT
distinct\r\n\r\n\t\t\tSPRIDEN_ID ID,\r\n\t\t\tSPRIDEN_LAST_NAME || \',
\'|| SPRIDEN_FIRST_NAME ||
\' \' ||
SPRIDEN_MI AS EMPLOYEE,\r\n\t\t\t\r\n\t\t\tPOSITION_TITLE AS
WORKING_TITLE,\r\n\t\t\tpevempl_birth_date as
Birthdate,\r\n\t\t\tpevempl_sex as Gender,\r\n\t\t\tp
evempl_ethn_code as Ethnicity,\r\n\t\t\tEMPLOYEE_CLASS as
e_class,\r\n\t\t\tCURRENT_HIRE_DATE AS HIRE_DT,\r\n\t\t\tseniority_date
as seniority,\r\n\t\t\ta.effective_date
as
effective_date,\r\n\t\t\tposition_begin_date as
position_begin_date,\r\n\t\t\ta.assignment_grade as
salary_grade,\r\n\t\t\tto_char(ANNUAL_SALARY,\'$999,999.99\') as
Salary\r\n\t\t\t\r\n\t\t\tFROM AN_EMPLOYEE_POSITION
A,\r\n\t\t\t (SELECT PERSON_UID,\r\n\t\t\t POSITION,\r\n\t\t\t
JOB_SUFFIX,\r\n\t\t\t MAX(EFFECTIVE_DATE) AS MAX_D
ATE\r\n\t\t\t FROM AN_EMPLOYEE_POSITION\r\n\t\t\t GROUP BY
PERSON_UID, POSITION, JOB_SUFFIX) E,\r\n\t\t\t\r\n\t\t\tSPRIDEN,
AP_EMPLOYEE,--nbrjlbd\r\n\t\t\tpevempl\r\n\
t\t\tWHERE A.PERSON_UID = E.PERSON_UID\r\n\t\t\tand pevempl_pidm =
A.Person_uid\r\n\t\t\tAND A.EFFECTIVE_DATE = E.MAX_DATE\r\n\t\t\tAND
A.POSITION = E.POSITION\r\n\t\t\t
AND
A.JOB_SUFFIX = E.JOB_SUFFIX\r\n\t\t\tAND A.PERSON_UID =
SPRIDEN_PIDM\t\r\n\t\t\tAND POSITION_CONTRACT_TYPE = \'P\' /*P -
primary, S- seconday, O - override*/\r\n\t\t
\tAND SPRIDEN_CHANGE_IND IS NULL \r\n\t\t\tAND A.PERSON_UID =
AP_EMPLOYEE.PERSON_UID\r\n\t\t\tAND EMPLOYEE_STATUS <>
\'T\'\r\n\t\t\tAND POSITION_STATUS <> \'T\'\r\n\t\t\
tand pevempl_ethn_code = \'60\'\r\n\t\t\tand pevempl_ecls_code =
\'AE\'\r\n\t\t\tand ( pevempl_sex = \'M\' or pevempl_sex = \'F\'
)\r\n')
/home/robowman/public_html/quer
y/debug.query.php:103
0.2513 367416 +0 ->
ROBDB_Query->prepareStatement('SELECT distinct\r\n\r\n\t\t\tSPRIDEN_ID
ID,\r\n\t\t\tSPRIDEN_LAST_NAME || \', \'|| SPRIDEN_FIRST
_NAME || \' \' || SPRIDEN_MI AS
EMPLOYEE,\r\n\t\t\t\r\n\t\t\tPOSITION_TITLE AS
WORKING_TITLE,\r\n\t\t\tpevempl_birth_date as
Birthdate,\r\n\t\t\tpevempl_sex as Gender,\r
\n\t\t\tpevempl_ethn_code as Ethnicity,\r\n\t\t\tEMPLOYEE_CLASS as
e_class,\r\n\t\t\tCURRENT_HIRE_DATE AS HIRE_DT,\r\n\t\t\tseniority_date
as seniority,\r\n\t\t\ta.effec
tive_date as
effective_date,\r\n\t\t\tposition_begin_date as
position_begin_date,\r\n\t\t\ta.assignment_grade as
salary_grade,\r\n\t\t\tto_char(ANNUAL_SALARY,\'$999,999.
99\') as Salary\r\n\t\t\t\r\n\t\t\tFROM AN_EMPLOYEE_POSITION
A,\r\n\t\t\t (SELECT PERSON_UID,\r\n\t\t\t POSITION,\r\n\t\t\t
JOB_SUFFIX,\r\n\t\t\t MAX(EFFECTIVE_DATE)
AS MAX_DATE\r\n\t\t\t FROM AN_EMPLOYEE_POSITION\r\n\t\t\t GROUP BY
PERSON_UID, POSITION, JOB_SUFFIX) E,\r\n\t\t\t\r\n\t\t\tSPRIDEN,
AP_EMPLOYEE,--nbrjlbd\r\n\t\t\tpev
empl\r\n\t\t\tWHERE A.PERSON_UID = E.PERSON_UID\r\n\t\t\tand
pevempl_pidm = A.Person_uid\r\n\t\t\tAND A.EFFECTIVE_DATE =
E.MAX_DATE\r\n\t\t\tAND A.POSITION = E.POSITION\
r\n\t\t\tAND A.JOB_SUFFIX = E.JOB_SUFFIX\r\n\t\t\tAND A.PERSON_UID =
SPRIDEN_PIDM\t\r\n\t\t\tAND POSITION_CONTRACT_TYPE = \'P\' /*P -
primary, S- seconday, O - override*
/\r\n\t\t\tAND SPRIDEN_CHANGE_IND IS NULL \r\n\t\t\tAND A.PERSON_UID =
AP_EMPLOYEE.PERSON_UID\r\n\t\t\tAND EMPLOYEE_STATUS <>
\'T\'\r\n\t\t\tAND POSITION_STATUS <> \'T\'
\r\n\t\t\tand pevempl_ethn_code = \'60\'\r\n\t\t\tand pevempl_ecls_code
= \'AE\'\r\n\t\t\tand ( pevempl_sex = \'M\' or pevempl_sex = \'F\'
)\r\n') /home/robowman/public_
html/class/ROBDB_Oracle_Connect.php:110
0.2514 367416 +0 -> oci_parse(resource(6) of
type (oci8 connection), 'SELECT distinct\r\n\r\n\t\t\tSPRIDEN_ID
ID,\r\n\t\t\tSPRIDEN_LAST_NAME || \
', \'||
SPRIDEN_FIRST_NAME || \' \' || SPRIDEN_MI AS
EMPLOYEE,\r\n\t\t\t\r\n\t\t\tPOSITION_TITLE AS
WORKING_TITLE,\r\n\t\t\tpevempl_birth_date as Birthdate,\r\n\t\t\tpev
empl_sex as Gender,\r\n\t\t\tpevempl_ethn_code
as Ethnicity,\r\n\t\t\tEMPLOYEE_CLASS as
e_class,\r\n\t\t\tCURRENT_HIRE_DATE AS HIRE_DT,\r\n\t\t\tseniority_date
as senior
ity,\r\n\t\t\ta.effective_date as
effective_date,\r\n\t\t\tposition_begin_date as
position_begin_date,\r\n\t\t\ta.assignment_grade as
salary_grade,\r\n\t\t\tto_char(ANNU
AL_SALARY,\'$999,999.99\') as Salary\r\n\t\t\t\r\n\t\t\tFROM
AN_EMPLOYEE_POSITION A,\r\n\t\t\t (SELECT PERSON_UID,\r\n\t\t\t
POSITION,\r\n\t\t\t JOB_SUFFIX,\r\n\t\t\t
MAX(EFFECTIVE_DATE) AS MAX_DATE\r\n\t\t\t FROM
AN_EMPLOYEE_POSITION\r\n\t\t\t GROUP BY PERSON_UID, POSITION,
JOB_SUFFIX) E,\r\n\t\t\t\r\n\t\t\tSPRIDEN, AP_EMPLOYEE,-
-nbrjlbd\r\n\t\t\tpevempl\r\n\t\t\tWHERE A.PERSON_UID =
E.PERSON_UID\r\n\t\t\tand pevempl_pidm = A.Person_uid\r\n\t\t\tAND
A.EFFECTIVE_DATE = E.MAX_DATE\r\n\t\t\tAND A.P
OSITION = E.POSITION\r\n\t\t\tAND A.JOB_SUFFIX =
E.JOB_SUFFIX\r\n\t\t\tAND A.PERSON_UID = SPRIDEN_PIDM\t\r\n\t\t\tAND
POSITION_CONTRACT_TYPE = \'P\' /*P - primary, S- se
conday, O - override*/\r\n\t\t\tAND SPRIDEN_CHANGE_IND IS NULL
\r\n\t\t\tAND A.PERSON_UID = AP_EMPLOYEE.PERSON_UID\r\n\t\t\tAND
EMPLOYEE_STATUS <> \'T\'\r\n\t\t\tAND POS
ITION_STATUS <> \'T\'\r\n\t\t\tand pevempl_ethn_code =
\'60\'\r\n\t\t\tand pevempl_ecls_code = \'AE\'\r\n\t\t\tand (
pevempl_sex = \'M\' or pevempl_sex = \'F\' )\r\n') /
home/robowman/public_html/class/ROBDB_Oracle_Connect.php:133
0.2515 369104 >=> resource(7) of type (oci8
statement)
0.2518 369104 +1688 -> ROBDB_Query->execute_statement()
/home/robowman/public_html/query/debug.query.php:109
0.2518 369104 +0 -> oci_execute(resource(7) of
type (oci8 statement))
/home/robowman/public_html/class/ROBDB_Oracle_Connect.php:144
0.2690 382560 >=> TRUE
0.2691 382560 +13456 -> ROBDB_Query->fetch_all()
/home/robowman/public_html/query/debug.query.php:111
0.2691 382584 +24 -> oci_fetch_all(resource(7) of
type (oci8 statement), '')
/home/robowman/public_html/class/ROBDB_Oracle_Connect.php:184
part: 1
positions: line
events: Time
fl=(1) php:internal
fn=(1) php::session_start
20 226
fl=(1)
fn=(2) php::define
20 12
fl=(1)
fn=(2)
23 1
fl=(1)
fn=(2)
24 0
fl=(1)
fn=(2)
25 0
fl=(1)
fn=(2)
26 134
fl=(1)
fn=(2)
28 1
fl=(2) /home/robowman/public_html/inc/config.php
fn=(3) require_once::/home/robowman/public_html/inc/config.php
1 1081
cfl=(1)
cfn=(2)
calls=1 0 0
20 12
cfl=(1)
cfn=(2)
calls=1 0 0
23 1
cfl=(1)
cfn=(2)
calls=1 0 0
24 0
cfl=(1)
cfn=(2)
calls=1 0 0
25 0
cfl=(1)
cfn=(2)
calls=1 0 0
26 134
cfl=(1)
cfn=(2)
calls=1 0 0
28 1
fl=(3) /home/robowman/public_html/class/ROBDB_Oracle_Connect.php
fn=(4)
require_once::/home/robowman/public_html/class/ROBDB_Oracle_Connect.php
1 2
fl=(1)
fn=(5) php::oci_connect
26 199386
fl=(3)
fn=(6) ROBDB_Oracle->__construct
23 177
cfl=(1)
cfn=(5)
calls=1 0 0
26 199386
fl=(3)
fn=(7) ROBDB_Query->__construct
82 120
cfl=(3)
cfn=(6)
calls=1 0 0
84 199563
fl=(3)
fn=(8) ROBDB_Query::getInstance
93 56
cfl=(3)
cfn=(7)
calls=1 0 0
96 199684
fl=(1)
fn=(9) php::oci_parse
133 120
fl=(3)
fn=(10) ROBDB_Query->prepareStatement
131 292
cfl=(1)
cfn=(9)
calls=1 0 0
133 120
fl=(3)
fn=(11) ROBDB_Query->set_query
108 58
cfl=(3)
cfn=(10)
calls=1 0 0
110 412
fl=(1)
fn=(12) php::oci_execute
144 17128
fl=(3)
fn=(13) ROBDB_Query->execute_statement
142 76
cfl=(1)
cfn=(12)
calls=1 0 0
144 17128
--
Edit bug report at https://bugs.php.net/bug.php?id=72005&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72005&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72005&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72005&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72005&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72005&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72005&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72005&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72005&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72005&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72005&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72005&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72005&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72005&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72005&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72005&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72005&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72005&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72005&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72005&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72005&r=mysqlcfg