Bug #17773 Updated: segfault calling pdf_open_image_file with a tiff image

From: Date: Wed, 19 Jun 2002 10:26:55 +0000
Subject: Bug #17773 Updated: segfault calling pdf_open_image_file with a tiff image
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-11362@lists.php.net to get a copy of this message
ID: 17773 Updated by: paolo@i-dome.com Reported By: paolo@i-dome.com -Status: Bogus +Status: Closed Bug Type: PDF related Operating System: Linux PHP Version: 4.2.1 New Comment: Sorry, i have recomiled, reinstalled pdflib, reconfigured and recompiled completly php and now work. Thanks Paolo Previous Comments: ------------------------------------------------------------------------ [2002-06-18 17:00:50] sniper@php.net It's either that you're doing something wrong or that this is actually some bug in PHP 4.2.1 which is fixed in the CVS (I use the very latest sources) and that's why I can't reproduce it. For me PDFlib 4.0.2 did the same as for you without the patches though.. Are you 100% sure you have applied the patch correctly? And you did compile/install the new patched one? Please try with this snapshot: http://snaps.php.net/php4-latest.tar.gz And DO NOT replace the ext/pdf with the one that comes with pdflib sources. ------------------------------------------------------------------------ [2002-06-18 06:11:58] paolo@i-dome.com Thanks, i have applied the patches to pdflib and relinked php but the problem are the same. Why, if i try with a C program calling directly the functions from pdflib i don't have problems? ------------------------------------------------------------------------ [2002-06-17 15:50:18] sniper@php.net I couldn't reproduce this with pdflib 4.0.1...but this is actually problem with pdflib itself, NOT php. Check the patches here: http://www.pdflib.com/pdflib/patches.html I tried the pdflib 4.0.2 with the patch and it works just fine. --Jani ------------------------------------------------------------------------ [2002-06-17 08:23:37] paolo@i-dome.com This is the effect running the program with gdb: Starting program: /usr/local/bin/php exectiff1.php Program received signal SIGSEGV, Segmentation fault. 0x816e02c in zend_llist_add_element (l=0x82d5f94, element=0xbffff920) at zend_llist.c:43 43 l->tail->next = tmp; ------------------------------------------------------------------------ [2002-06-17 08:14:20] paolo@i-dome.com 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; ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17773 -- Edit this bug report at http://bugs.php.net/?id=17773&edit=1

« previous php.bugs (#11362) next »