From:             laruence
Operating system: Linux 64bit
PHP version:      5.4SVN-2011-09-10 (SVN)
Package:          MySQLi related
Bug Type:         Bug
Bug description:test script cause seg fault

Description:
------------
ext/mysqli/tests/mysqli_explain_metadata.phpt cause a segment fault(linked

against libmysql)



backtrace:
#0  0x000000302af6ff20 in strlen () from /lib64/tls/libc.so.6
#1  0x00000000007dbeb5 in add_property_string_ex (arg=0x2a99479160,
key=0xb68dec 
"catalog", key_len=8, 
    str=0x20200a3e6e6f6974 <Address 0x20200a3e6e6f6974 out of bounds>, 
duplicate=1)
    at /home/huixc/opensource/php-src/trunk/Zend/zend_API.c:1561
#2  0x00000000005f9a35 in php_add_field_properties (value=0x2a99479160, 
field=0x1000410)
    at /home/huixc/opensource/php-src/trunk/ext/mysqli/mysqli_api.c:1060
#3  0x00000000005f9d80 in zif_mysqli_fetch_fields (ht=1, 
return_value=0x2a994bcf68, return_value_ptr=0x0, this_ptr=0x0, 
return_value_used=1)
    at /home/huixc/opensource/php-src/trunk/ext/mysqli/mysqli_api.c:1118
#4  0x000000000080e1b6 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x2a95fbc0e8)
    at /home/huixc/opensource/php-src/trunk/Zend/zend_vm_execute.h:642
#5  0x000000000081491a in ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(execute_data=0x2a95fbc0e8)
    at /home/huixc/opensource/php-src/trunk/Zend/zend_vm_execute.h:2215
#6  0x000000000080ceba in execute (op_array=0xff40d0) at 
/home/huixc/opensource/php-src/trunk/Zend/zend_vm_execute.h:410
#7  0x00000000007d559c in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /home/huixc/opensource/php-src/trunk/Zend/zend.c:1262
#8  0x000000000075698b in php_execute_script (primary_file=0x7fbffff230) at

/home/huixc/opensource/php-src/trunk/main/main.c:2388
#9  0x00000000008f53f9 in do_cli (argc=2, argv=0x7fbffff518) at 
/home/huixc/opensource/php-src/trunk/sapi/cli/php_cli.c:983
#10 0x00000000008f629a in main (argc=2, argv=0x7fbffff518) at 
/home/huixc/opensource/php-src/trunk/sapi/cli/php_cli.c:1356


f2, 
(gdb) p *field
$2 = {name = 0x10007d0 "possible_keys", org_name = 0x10007e0 "", table = 
0x10007c0 "", org_table = 0x10007c8 "", db = 0x10007b8 "", 
  catalog = 0x20200a3e6e6f6974 <Address 0x20200a3e6e6f6974 out of bounds>,
def = 
0x0, length = 4096, max_length = 0, 
  name_length = 537542259, org_name_length = 1818311712, table_length = 
1047748969, org_table_length = 762278761, db_length = 959789112, 
  catalog_length = 792474157, def_length = 1634298977, flags = 0, decimals
= 31, 
charsetnr = 8, type = MYSQL_TYPE_VAR_STRING, 
  extension = 0x61696c612f3c3130}

Test script:
---------------
ext/mysqli/tests/mysqli_explain_metadata.phpt  

Expected result:
----------------
passed

Actual result:
--------------
seg fault

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

Reply via email to