PHP 4.0 Bug #8454 Updated: SegFault occurs using pdf_open_image_file

From: Date: Wed, 03 Jan 2001 18:17:09 +0000
Subject: PHP 4.0 Bug #8454 Updated: SegFault occurs using pdf_open_image_file
Groups: php.dev 
Request: Send a blank email to php-dev+get-42862@lists.php.net to get a copy of this message
ID: 8454 Updated by: sniper Reported By: wirtz@web-active.com Old-Status: Duplicate Status: Closed Bug Type: PDF related Assigned To: Comments: This is fixed in CVS now. --Jani Previous Comments: --------------------------------------------------------------------------- [2000-12-28 11:14:48] derick@php.net Dup of 8394 --------------------------------------------------------------------------- [2000-12-28 11:08:57] wirtz@web-active.com Okay, the following script is generating the SegFault: <?php $fp = tmpfile(); $pdfp = pdf_open( $fp ); pdf_begin_page( $pdfp, 595, 842 ); $pim = pdf_open_image_file( $pdfp, "jpeg", "test.jpg" ); pdf_place_image( $pdfp, $pim, 0, 0, 1.0 ); pdf_close_image( $pdfp, $pim ); pdf_end_page( $pdfp ); pdf_close( $pdfp ); rewind( $fp ); header( "Content-type: application/pdf" ); fpassthru( $fp ); fclose( $fp ); ?> Switches: --with-pdflib --with-zlib-dir --with-jpeg-dir --with-png-dir --with-tiff-dir Libs used: pdf 3.02 zlib 1.1.3 jpeg 6b png 1.0.8 tiff 3.5.5 and the backtrace looks like this: Starting program: php pdftest.php Program received signal SIGSEGV, Segmentation fault. 0x401beb24 in memcpy (dstpp=0x8186ba0, srcpp=0x0, len=1) at ../sysdeps/generic/memcpy.c:61 61 ../sysdeps/generic/memcpy.c: No such file or directory. (gdb) bt #0 0x401beb24 in memcpy (dstpp=0x8186ba0, srcpp=0x0, len=1) at ../sysdeps/generic/memcpy.c:61 #1 0x80ce9cc in virtual_filepath_ex (path=0x8186b8c "test.tif", filepath=0xbfffe020, verify_path=0x80ce0d0 <php_is_file_ok>) at tsrm_virtual_cwd.c:461 #2 0x80cea05 in virtual_filepath (path=0x8186b8c "test.tif", filepath=0xbfffe020) at tsrm_virtual_cwd.c:472 #3 0x8087371 in php_if_pdf_open_image_file (ht=3, return_value=0x8186b6c, this_ptr=0x0, return_value_used=1) at pdf.c:2491 #4 0x81092e5 in execute (op_array=0x8181cbc) at ./zend_execute.c:1519 #5 0x80dce88 in zend_execute_scripts (type=8, file_count=3) at zend.c:729 #6 0x8060e91 in php_execute_script (primary_file=0xbffff534) at main.c:1221 #7 0x805f369 in main (argc=2, argv=0xbffff594) at cgi_main.c:738 This error occurs regardless of the imagetype used (gif, tiff). The script runs with 4.0.3pl1 just fine... Greetings Alex --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=8454

« previous php.dev (#42862) next »