From:             
Operating system: Linux-2.6 / CentOS 5.8
PHP version:      5.3.11
Package:          DBM/DBA related
Bug Type:         Bug
Bug description:dba_fetch() segfaults with db-4.8

Description:
------------
When using dba_fetch with a db4 database a segfault is generated and php 
crashes.

Important Notes:
We use db48 rpm from ZeroC for IcePHP Support. At the time of testing we
did not 
have the IcePHP.so loaded to ensure that it was not a conflict with that
module.

dba.so is linked against this db4 rpm:
http://www.zeroc.com/download/Ice/3.4/rhel5/x86_64/db48-devel-4.8.30-
1ice.rhel5.x86_64.rpm
[root@web2 ~]# ldd /usr/local/php/lib/php/extensions/no-debug-non-zts-
20090626/dba.so 
        linux-vdso.so.1 =>  (0x00007fff62deb000)
        libdb-4.8.so => /usr/lib64/libdb-4.8.so (0x00002b024cad9000)
        libc.so.6 => /lib64/libc.so.6 (0x00002b024ce43000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b024d19b000)
        /lib64/ld-linux-x86-64.so.2 (0x00002b024c6a3000)



Test script:
---------------
<?php
 $dbh = dba_open("/root/test.db","c","db4");
 $str = sha1("this is a test");
 $ret = dba_exists($str,$dbh);
 # <segfault>
?>


Expected result:
----------------
PHP to return the fetched dba result

Actual result:
--------------
Segfault


Program received signal SIGSEGV, Segmentation fault.
0x000000000171f190 in ?? ()
(gdb) bt
#0  0x000000000171f190 in ?? ()
#1  0x00002aaab1a347a6 in dba_exists_db4 (info=0x16ed090, key=<value
optimized 
out>, keylen=<value optimized out>)
    at /usr/src/redhat/BUILD/lsgphp-1.0.6/php-5.3.11/ext/dba/dba_db4.c:211
#2  0x00002aaab1a33c48 in zif_dba_exists (ht=<value optimized out>, 
return_value=0x16d1318, return_value_ptr=<value optimized out>,
    this_ptr=<value optimized out>, return_value_used=<value optimized
out>)
    at /usr/src/redhat/BUILD/lsgphp-1.0.6/php-5.3.11/ext/dba/dba.c:984
#3  0x00000000006e9bf9 in zend_do_fcall_common_helper_SPEC ()
#4  0x00000000006e8d4e in execute ()
#5  0x00000000006c2459 in zend_execute_scripts ()
#6  0x000000000066f0c8 in php_execute_script ()
#7  0x000000000074b27e in main ()


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

Reply via email to