[PHP-BUG] Bug #62847 [NEW]: PDO not released (or disconnect) if last query was error.

2012-08-17 Thread softwareelves at gmail dot com
From: softwareelves at gmail dot com
Operating system: OSX 10.8
PHP version:  5.3.16
Package:  PDO related
Bug Type: Bug
Bug description:PDO not released (or disconnect) if last query was error.

Description:

If PDO errors on it's LAST query it will refuse to disconnect from the
database 
until the end of the script.

Test script:
---
query( "SHOW PROCESSLIST;" )->fetchAll() );

$pdo2->query( "SELECT column FROM non_existent_table;" );
//$pdo2->query( "SELECT 1;" ); //uncommenting this line causes $pdo2 to be
released correctly
$pdo2 = NULL;

$after_unset = count( $pdo1->query( "SHOW PROCESSLIST;" )->fetchAll() );

var_dump( $base_line - $after_unset );

?>

Expected result:

int(1)

Actual result:
--
int(0)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62847&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62847&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62847&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62847&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62847&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62847&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62847&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62847&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62847&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62847&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62847&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62847&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62847&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62847&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62847&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62847&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62847&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62847&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=62847&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=62847&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=62847&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=62847&r=mysqlcfg



[PHP-BUG] Bug #62991 [NEW]: Segfault with generator and closure.

2012-09-01 Thread softwareelves at gmail dot com
From: softwareelves at gmail dot com
Operating system: Mac OSx 10.8.1
PHP version:  master-Git-2012-09-02 (Git)
Package:  Reproducible crash
Bug Type: Bug
Bug description:Segfault with generator and closure.

Description:

If you create a generator-closure inside of a function and call that
function 
before returning it, it'll cause memory corruption causing a segfault.

Test script:
---
 int(1) [1]=> int(2) [2]=> int(3) }

Actual result:
--
Segmentation fault: 11

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62991&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62991&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62991&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=62991&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62991&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=62991&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62991&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=62991&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=62991&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=62991&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=62991&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=62991&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=62991&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=62991&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62991&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=62991&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=62991&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=62991&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=62991&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=62991&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=62991&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=62991&r=mysqlcfg



Bug #44901 [Com]: open_basedir as prefix complains on attempts to access non-existant files

2011-05-25 Thread softwareelves at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=44901&edit=1

 ID: 44901
 Comment by: softwareelves at gmail dot com
 Reported by:jake at yahoo-inc dot com
 Summary:open_basedir as prefix complains on attempts to
 access non-existant files
 Status: Verified
 Type:   Bug
 Package:Safe Mode/open_basedir
 Operating System:   *
 PHP Version:5.*, 6CVS (2009-03-16)
 Block user comment: N
 Private report: N

 New Comment:

This bug doesn't seem to exist in 5.2.x.



I found it's not just a trailing slash but anything after an existing
file path.



I found an easy way to show this bug:



error_reporting( E_ALL | E_STRICT );



var_dump( file_exists( __FILE__ ) );

var_dump( file_exists( __FILE__."/something_that_doesnt_exists" ) );



ini_set( "open_basedir", dirname( __FILE__ ) );



var_dump( file_exists( __FILE__ ) );

var_dump( file_exists( __FILE__."/something_that_doesnt_exists" ) );


Previous Comments:

[2008-05-03 00:41:11] jake at yahoo-inc dot com

Description:

When using open_basedir as a prefix, attempting to access files or
directories which match the prefix but are not present on the filesystem
raise open_basedir restriction warnings.





Reproduce code:
---
// create files or directories on the file system "/foo1", "/foo2"

// add "/foo" (not "/foo/") to the open basedir restriction, then:



var_dump(file_exists('/foo1'));

var_dump(file_exists('/foo2'));

var_dump(file_exists('/foo3'));





Expected result:

this is the output returned:

bool(true)

bool(true)

bool(false)



which is expected, however, the "false" returned by the third call is
disingenuous... it is false because the call is being blocked by
open_basedir, and the following warning is triggered:



[Fri May  2 17:33:05 2008] [error] PHP Warning:  file_exists():
open_basedir restriction in effect. File(/foo3) is not within the
allowed path(s)









-- 
Edit this bug report at http://bugs.php.net/bug.php?id=44901&edit=1