From:             
Operating system: Mac OS X
PHP version:      6SVN-2010-05-20 (SVN)
Package:          PDO related
Bug Type:         Bug
Bug description:PDO::fetchAll after a PDO::execute with bindings lead to a segv.

Description:
------------
#0  0x00007fff83c74886 in __kill ()

#1  0x00007fff83d14eae in abort ()

#2  0x00007fff83c2ca75 in free ()

#3  0x00000001001b8328 in pdo_mysql_stmt_fetch (stmt=0x100d3ef18, 

ori=PDO_FETCH_ORI_NEXT, offset=0) at 

/Users/dsp/dev/c/php/trunk/ext/pdo_mysql/mysql_statement.c:655

#4  0x00000001001ac47a in do_fetch_common (stmt=0x100d3ef18, 

ori=PDO_FETCH_ORI_NEXT, offset=0, do_bind=1) at 

/Users/dsp/dev/c/php/trunk/ext/pdo/pdo_stmt.c:694

#5  0x00000001001adaa1 in do_fetch (stmt=0x100d3ef18, do_bind=1, 

return_value=0x100d4eff8, how=PDO_FETCH_BOTH, ori=PDO_FETCH_ORI_NEXT,
offset=0, 

return_all=0x0) at /Users/dsp/dev/c/php/trunk/ext/pdo/pdo_stmt.c:861

#6  0x00000001001b0388 in zim_PDOStatement_fetchAll (ht=0, 

return_value=0x100d3f888, return_value_ptr=0x0, this_ptr=0x100d3a120, 

return_value_used=0) at 

/Users/dsp/dev/c/php/trunk/ext/pdo/pdo_stmt.c:1560

#7  0x0000000100465e48 in execute_internal (execute_data_ptr=0x101b2a080, 

return_value_used=0) at
/Users/dsp/dev/c/php/trunk/Zend/zend_execute.c:1468

#8  0x00000001004176d7 in dtrace_execute_internal
(execute_data_ptr=0x101b2a080, 

return_value_used=0) at /Users/dsp/dev/c/php/trunk/Zend/zend_dtrace.c:99

#9  0x0000000100467b04 in zend_do_fcall_common_helper_SPEC 

(execute_data=0x101b2a080) at zend_vm_execute.h:359

#10 0x0000000100468eeb in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER 

(execute_data=0x101b2a080) at zend_vm_execute.h:467

#11 0x00000001004663af in execute (op_array=0x100d3c030) at 

zend_vm_execute.h:129

#12 0x00000001004175e2 in dtrace_execute (op_array=0x100d3c030) at 

/Users/dsp/dev/c/php/trunk/Zend/zend_dtrace.c:75

#13 0x000000010042fb2d in zend_execute_scripts (type=8, retval=0x0, 

file_count=3) at /Users/dsp/dev/c/php/trunk/Zend/zend.c:1210

#14 0x00000001003a31fd in php_execute_script (primary_file=0x7fff5fbfe9f0)
at 

/Users/dsp/dev/c/php/trunk/main/main.c:2324

#15 0x000000010056caf4 in main (argc=2, argv=0x7fff5fbfeb98) at 

/Users/dsp/dev/c/php/trunk/sapi/cli/php_cli.c:1200

Test script:
---------------
<?php



$pdo = new PDO('mysql:dbname=mysql;host=127.0.0.1', 'root', '');

$stm = $pdo->prepare('SELECT * FROM user WHERE host = ?');

$stm->execute(array('localhost'));

$stm->fetchAll();

Actual result:
--------------
php(63324) malloc: *** error for object 0x101c849a8: pointer being freed
was not 

allocated

*** set a breakpoint in malloc_error_break to debug

[1]    63324 abort      php test.php

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

Reply via email to