|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-15 11:24 UTC] paolo at i-dome dot com
Calling pdf_open_image_file with a tiff image, PHP get a segfault. This with different versions of pdflib and libtiff. I don't have this problem, when make the same operation with a C program compiled with the pdflib. Thanks PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Pdflib.4.0.2 libtiff-3.5.5-7 Configuration sring: ./configure --with-config-file-path=/etc/httpd/conf --enable-ftp --with-gd=/install/gd-2.0.1 -with-ttf --with-imap --with-ldap --with-mcal=../libmcal --with-mysql --with-pdflib --with-jpeg-dir --with-tiff-dir --with-zlib --with-curl --enable-xml --with-freetype-dir=/usr/local --enable-gd-native-ttf -enable-gd-imgstrttf -with-png-dir --enable-debug RUnning gdb on the core file: (gdb) bt #0 0x816e02c in zend_llist_add_element (l=0x82d5f94, element=0xbffff900) at zend_llist.c:43 #1 0x815edf2 in open_file_for_scanning (file_handle=0xbffff900) at zend_language_scanner.c:2964 #2 0x815eea0 in compile_file (file_handle=0xbffff900, type=2) at zend_language_scanner.c:3006 #3 0x81766bb in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:806 #4 0x807644a in php_execute_script (primary_file=0xbffff900) at main.c:1381 #5 0x807387c in main (argc=2, argv=0xbffff9b4) at cgi_main.c:778 #6 0x40310b65 in __libc_start_main (main=0x8072e6c <main>, argc=2, ubp_av=0xbffff9b4, init=0x8070c3c <_init>, fini=0x820ec7c <_fini>, rtld_fini=0x4000df24 <_dl_fini>, stack_end=0xbffff9ac) at ../sysdeps/generic/libc-start.c:111 #6 0x40310b65 in __libc_start_main (main=0x8072e6c <main>, argc=2, ubp_av=0xbffff9b4, init=0x8070c3c <_init>, fini=0x820ec7c <_fini>, rtld_fini=0x4000df24 <_dl_fini>, stack_end=0xbffff9ac) at ../sysdeps/generic/libc-start.c:111 111 ../sysdeps/generic/libc-start.c: File o directory inesistente. (gdb) do #5 0x807387c in main (argc=2, argv=0xbffff9b4) at cgi_main.c:778 778 if (php_execute_script(&file_handle TSRMLS_CC)) { (gdb) do #4 0x807644a in php_execute_script (primary_file=0xbffff900) at main.c:1381 1381 retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); (gdb) do #3 0x81766bb in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:806 806 EG(active_op_array) = zend_compile_file(file_handle, ZEND_INCLUDE TSRMLS_CC); (gdb) do #2 0x815eea0 in compile_file (file_handle=0xbffff900, type=2) at zend_language_scanner.c:3006 3006 if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) { (gdb) do #1 0x815edf2 in open_file_for_scanning (file_handle=0xbffff900) at zend_language_scanner.c:2964 2964 zend_llist_add_element(&CG(open_files), file_handle); (gdb) do #0 0x816e02c in zend_llist_add_element (l=0x82d5f94, element=0xbffff900) at zend_llist.c:43 43 l->tail->next = tmp;This is a example of script generating a core. The same script sobstutiting a jpeg file or png file don't give crash. I have traied with different tiff file renamed in prova.tif, but all give a segfault. I have, also, writed a C program with the same call linking whith pdflib and run correctly. <?php //Create & Open PDF-Object $pdf = pdf_new(); pdf_open_file($pdf"); pdf_set_info($pdf, "Author","Paolo Morandi"); pdf_set_info($pdf, "Title","visure.cedcamera.com"); pdf_set_info($pdf, "Creator", "morandi@mi.camcom.it"); pdf_set_info($pdf, "Subject", "pdf_open_image_file"); $tiffimage="prova.tif"; $pdfimage=-1; $pdfimage = pdf_open_image_file($pdf, "tiff",$tiffimage, "", 0); pdf_begin_page($pdf, 842, 1190); if($pdfimage > 0) pdf_place_image($pdf, $pdfimage, 0, 0, 1.0); //close it up pdf_end_page($pdf); pdf_close($pdf); $data = pdf_get_buffer($pdf); header('Content-type: application/pdf'); header('Content-disposition: inline; filename=image.pdf'); header('Content-length: ' . strlen($data)); echo $data; ?>