From:             marcel at webdisplay dot nl
Operating system: Mac OS X + CentOS
PHP version:      5.4.13
Package:          PDF related
Bug Type:         Bug
Bug description:Using PDFlib causes a segfault

Description:
------------
Using PDFlib causes a segfault in certain situations.

Platforms tested:
CentOS 6.4 with PHP 5.4.11
Mac OS X 10.8.3 with PHP 5.4.13
PDFLib 8.0.5 and PDFlib 9.0.0


Test script:
---------------
class Pdf extends PDFLib {

    /** Just some public variable */
    public $someVar;
}

$pdf = new Pdf();

//print_r($pdf);


Expected result:
----------------
The script should return normally

Actual result:
--------------
A segmentation fault occurs

Backtrace:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000020
0x00000001001ebb2d in zend_hash_destroy ()
(gdb) bt
#0  0x00000001001ebb2d in zend_hash_destroy ()
#1  0x0000000101ad3677 in pdflib_object_dtor ()
#2  0x0000000100203b71 in zend_objects_store_del_ref_by_handle_ex ()
#3  0x0000000100203c2a in zend_objects_store_del_ref ()
#4  0x00000001001d2ac1 in _zval_ptr_dtor ()
#5  0x00000001001eb854 in zend_hash_apply_deleter ()
#6  0x00000001001eb910 in zend_hash_reverse_apply ()
#7  0x00000001001d5ac7 in shutdown_destructors ()
#8  0x00000001001df958 in zend_call_destructors ()
#9  0x0000000100182247 in php_request_shutdown ()
#10 0x000000010026bdd8 in main ()
(gdb)

Please note that the segfault does not occur if either:
a) the public variable is removed from the class
b) print_r($pdf) is uncommented


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

Reply via email to