PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/oci8/tests/bug38173.phpt ('Bug #38173 (Freeing nested cursors causes OCI8 to segfault)')

Script

1: <?php
2:
3:
require dirname(__FILE__)."/connect.inc";
4:
5:
$create_1 "CREATE TABLE t1 (id INTEGER)";
6:
$create_2 "CREATE TABLE t2 (id INTEGER)";
7:
$drop_1 "DROP TABLE t1";
8:
$drop_2 "DROP TABLE t2";
9:
10:
$s1 oci_parse($c$drop_1);
11:
$s2 oci_parse($c$drop_2);
12: @
oci_execute($s1);
13: @
oci_execute($s2);
14:
15:
$s1 oci_parse($c$create_1);
16:
$s2 oci_parse($c$create_2);
17:
oci_execute($s1);
18:
oci_execute($s2);
19:
20: for(
$i=0$i 5$i++) {
21:     
$insert "INSERT INTO t1 VALUES(".$i.")";
22:     
$s oci_parse($c$insert);
23:     
oci_execute($s);
24: }
25:
26: for(
$i=0$i 5$i++) {
27:     
$insert "INSERT INTO t2 VALUES(".$i.")";
28:     
$s oci_parse($c$insert);
29:     
oci_execute($s);
30: }
31:
32:
$query ="
33: SELECT
34:   t1.*,
35:   CURSOR( SELECT * FROM t2 ) as cursor
36: FROM
37:   t1
38: "
;
39:
40:
$sth oci_parse($c$query);
41:
oci_execute($sth);
42:
43:
// dies on oci_free_statement on 2nd pass through loop
44:
while ( $row oci_fetch_assoc($sth) ) {
45:   print 
"Got row!\n";
46:   
var_dump(oci_execute($row['CURSOR']));
47:   
var_dump(oci_free_statement($row['CURSOR']));
48: }
49:
50:
$s1 oci_parse($c$drop_1);
51:
$s2 oci_parse($c$drop_2);
52: @
oci_execute($s1);
53: @
oci_execute($s2);
54:
55: echo 
"Done\n";
56:
57:
?>
58:

Expected

Got row!
bool(true)
bool(true)
Got row!
bool(true)
bool(true)
Got row!
bool(true)
bool(true)
Got row!
bool(true)
bool(true)
Got row!
bool(true)
bool(true)
Done

Output

***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

  VERSION INFORMATION:
	TNS for Linux: Version 11.2.0.2.0 - Beta
	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
  Time: 17-JUN-2018 05:01:37
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: TNS:no listener
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: No listener

Fatal error: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
    nt secondary err code: 111
    nt OS err code: 0

Diff

001+ ***********************************************************************
002+ Fatal NI connect error 12541, connecting to:
003+  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
004+ 
005+   VERSION INFORMATION:
006+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
007+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
008+   Time: 17-JUN-2018 05:01:37
009+   Tracing not turned on.
010+   Tns error struct:
011+     ns main err code: 12541
012+     TNS-12541: TNS:no listener
013+     ns secondary err code: 12560
014+     nt main err code: 511
015+     TNS-00511: No listener
016+ 
001- Got row!
002- bool(true)
003- bool(true)
004- Got row!
005- bool(true)
006- bool(true)
007- Got row!
008- bool(true)
009- bool(true)
010- Got row!
011- bool(true)
012- bool(true)
013- Got row!
014- bool(true)
015- bool(true)
016- Done
017+ Fatal error: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
018+     nt secondary err code: 111
019+     nt OS err code: 0

 

Generated at Mon, 18 Jun 2018 17:33:50 +0000 (2 days ago)

Copyright © 2005-2018 The PHP Group
All rights reserved.