Segmentation faults
| From: | Jome | Date: | Mon, 25 Mar 2002 21:19:15 +0000 |
| Subject: | Segmentation faults | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-4730@lists.php.net to get a copy of this message | ||
Hello,
I've compiled PHP with gd2.0.1 and libpng 1.2.1. When I'm trying to make a PNG-image (with
the sample available at http://www.php.net/manual/en/function.imagecreate.php)
I'm getting a seg fault.
root@destiny:/home/www/develop.emoj.net/qa# php -q gd.php
Segmentation fault
I've tried this with both PHP 4.2.0RC1 and PHP 4.3.0-dev and still getting seg faults. I'm
running Linux 2.4.17 and Apache 1.3.22. Has anyone been able to recreate this error?
Trying to make a jpeg works fine. I've also tried this with gd 1.3 (creating a gif file) on
another machine and that works fine too.
My whole configure line: ./configure --with-apxs=/usr/local/apache/bin/apxs
--with-config-file-path=/usr/local/apache/conf --enable-versioning --with-mysql --enable-ftp
--with-gd --enable-bcmath --disable-debug --enable-memory-limit=yes --enable-track-vars
--with-pdflib --with-ttf --with-imap --with-jpeg-dir=../jpeg-6b --with-png-dir=../libpng-1.2.1
--with-freetype-dir=../freetype-2.0.6 --with-ircg --with-ircg-config=/usr/local/bin/ircg-config
--with-ming=../ming-0.2a --with-zlib-dir=../zlib-1.1.3 --enable-mailparse --enable-debug
Attached is debugging output from gdb.
-jome
root@destiny:/usr/src/php-4.2.0RC1# gdb php GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-slackware-linux"... (gdb) run /home/www/develop.emoj.net/qa/gd.php Starting program: /usr/local/bin/php /home/www/develop.emoj.net/qa/gd.php Program received signal SIGSEGV, Segmentation fault. 0x689 in ?? () at eval.c:88 88 eval.c: No such file or directory. (gdb) bt full #0 0x689 in ?? () at eval.c:88 No locals. #1 0x40186818 in png_create_write_struct_2 () at eval.c:88 No locals. #2 0x40187bfd in png_create_write_struct () at eval.c:88 No locals. #3 0x40250a4d in gdImagePngCtx (im=0x82c58a0, outfile=0x82c5874) at gd_png.c:461 i = 136301258 j = 28 bit_depth = 134949871 interlace_type = -1073748836 width = 50 height = 100 colors = 2 open = (int *) 0x82c64b0 mapping = {-1073748840, -1073748872, 0, 0, -1073748404, 134789671, 136583712, 136293220, 0, 1077143442, 1077922392, 0, 1, 137102568, 137102564, 2, 1, 1, 98, 0 <repeats 41 times>, 1929379840, 32, 0, -1, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136293778, 0, 0, 0, 0, 0, 136293215, 0, 2, -1073748016, -1073748404, 30, -1, 0 <repeats 24 times>, 136293220, 0 <repeats 37 times>, 107, -1073749196, 1073772733, 1076120617, 134596840, 0, 1073772261, 1073829876, 134552384, 1073831440, 0, 0, 0, 0, 0, 0, 149, -1073749132, 1073772733, 1076120601, 134597006, 0, 1073772261, 1073829876, 0, 1076120196, 1076115732, 1075820000, 0, 0, 17, 1076822704, 10, -1073749204, 134552384, 1, 0, 1073831780, 51163477, 1073816491, -1073749120, 1073831440, 134596840, 1075820000, 0, 0, 17, 1076117444, 1075820000, -1073749116, 1073789187, 1073831780, 7, 0, 211990972, 1073816491, -1073749056, 1073831440, 1073788974, 136583712, 134992056, 16, 17, 1076118116, 134802876, 136583712, 16, -1073749044, 134705187, -1073749064, 137138073, -1073749060, 134813545, 136836420, 136286948, 929, 134813512, 136583712, 16, -1073748996, 134705187, 137137292, 1, -1073749012, 134817032, 136836420, 1, -1073749016, 134816996, 136583712, 137138000, 4, 134704524, 4, 18, -1073748948, 134699224, 137123984, 136519852, 4, 134698973, 136583712, 134968876, -1073748916, 134786232, 136583712, 0} trans_values = '\000' <repeats 216 times>, "\026\000\000\000\234;(\b,àÿ¿\030è5@\\èÿ¿\000\000\000\000läÿ¿D¾\b\b\001\000\000\000ä\004,\b" trans_rgb_value = {index = 0 '\000', red = 0, green = 0, blue = 0, gray = 0} palette = {{red = 0 '\000', green = 0 '\000', blue = 0 '\000'} <repeats 256 times>} png_ptr = 0x0 info_ptr = 0x0 transparent = -1 remap = 0 #4 0x80b2d10 in _php_image_output_ctx (ht=1, return_value=0x82c555c, this_ptr=0x0, return_value_used=0, image_type=2, tn=0x81fd36b "PNG", func_p=0x402509ec <gdImagePngCtx>) at gd_ctx.c:94 imgind = (zval **) 0x82c04e4 file = (zval **) 0x82c5568 quality = (zval **) 0x80758d8 im = 0x82c58a0 fn = 0x0 fp = (FILE *) 0x0 argc = 1 q = -1 i = 134992056 ctx = (gdIOCtx *) 0x82c5874 #5 0x80b766b in zif_imagepng (ht=1, return_value=0x82c555c, this_ptr=0x0, return_value_used=0) at gd.c:1479 No locals. #6 0x81cc407 in execute (op_array=0x82c57ec) at ./zend_execute.c:1598 original_return_value = (zval **) 0x82ca344 return_value_used = 0 execute_data = {opline = 0x82ca32c, function_state = {function_symbol_table = 0x0, function = 0x82bbcc8, reserved = { 0x806f178, 0x806f1d0, 0x8241a20, 0x0}}, fbc = 0x0, object = {ptr = 0x0}, Ts = 0xbfffe4f4, original_in_execution = 0 '\000'} #7 0x808a834 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 files = 0xbfffe858 i = 1 file_handle = (zend_file_handle *) 0xbffffa70 orig_op_array = (zend_op_array *) 0x0 local_retval = (zval *) 0x0 #8 0x809acd5 in php_execute_script (primary_file=0xbffffa70) at main.c:1381 orig_bailout = {{__jmpbuf = {1077922392, 1073831268, -1073743116, -1073743220, -1073743532, 134668693}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 32 times>}}}} orig_bailout_set = 1 '\001' prepend_file_p = (zend_file_handle *) 0x0 append_file_p = (zend_file_handle *) 0x0 prepend_file = {type = 165 '¥', filename = 0x403fca58 "\210Æ\020", opened_path = 0x40015d64 "", handle = {fd = 4096, fp = 0x1000}, free_filename = 0 '\000'} append_file = {type = 76 'L', filename = 0x4035ad8e "[\201ÃÊ\034\n", opened_path = 0x403fca58 "\210Æ\020", handle = { fd = 1073831268, fp = 0x40015d64}, free_filename = 244 'ô'} old_cwd = 0xbfffe864 "" retval = 0 #9 0x806e83c in main (argc=2, argv=0xbffffaf4) at php_cli.c:586 orig_bailout = {{__jmpbuf = {0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 32 times>}}}} orig_bailout_set = 0 '\000' exit_status = 0 c = 60 file_handle = {type = 2 '\002', filename = 0xbffffc07 "/home/www/develop.emoj.net/qa/gd.php", opened_path = 0x0, handle = {fd = 137123128, fp = 0x82c5538}, free_filename = 0 '\000'} behavior = 1 no_headers = 1 orig_optind = 1 orig_optarg = 0x0 arg_free = 0xbffffc07 "/home/www/develop.emoj.net/qa/gd.php" arg_excp = (char **) 0xbffffaf8 script_file = 0xbffffc07 "/home/www/develop.emoj.net/qa/gd.php" global_vars = {head = 0x0, tail = 0x0, size = 4, count = 0, dtor = 0, persistent = 0 '\000', traverse_ptr = 0x8241a20} interactive = 0 exec_direct = 0x0 #10 0x4030e2eb in __libc_start_main (main=0x806e058 <main>, argc=2, ubp_av=0xbffffaf4, init=0x806b690 <_init>, fini=0x81ec96c <_fini>, rtld_fini=0x4000c130 <_dl_fini>, stack_end=0xbffffaec) at ../sysdeps/generic/libc-start.c:129 ubp_av = (char **) 0xbffffaf4 fini = (void (*)()) 0x40015d64 <_dl_debug_mask> rtld_fini = (void (*)()) 0x40196f00 <png_libpng_ver> ubp_ev = (char **) 0x689 (gdb)
root@destiny:/usr/src/php-4.2.0RC1# gdb php GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-slackware-linux"... (gdb) run /home/www/develop.emoj.net/qa/gd.php Starting program: /usr/local/bin/php /home/www/develop.emoj.net/qa/gd.php Program received signal SIGSEGV, Segmentation fault. 0x689 in ?? () at eval.c:88 88 eval.c: No such file or directory. (gdb) bt full #0 0x689 in ?? () at eval.c:88 No locals. #1 0x40186818 in png_create_write_struct_2 () at eval.c:88 No locals. #2 0x40187bfd in png_create_write_struct () at eval.c:88 No locals. #3 0x40250a4d in gdImagePngCtx (im=0x82c58a0, outfile=0x82c5874) at gd_png.c:461 i = 136301258 j = 28 bit_depth = 134949871 interlace_type = -1073748836 width = 50 height = 100 colors = 2 open = (int *) 0x82c64b0 mapping = {-1073748840, -1073748872, 0, 0, -1073748404, 134789671, 136583712, 136293220, 0, 1077143442, 1077922392, 0, 1, 137102568, 137102564, 2, 1, 1, 98, 0 <repeats 41 times>, 1929379840, 32, 0, -1, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136293778, 0, 0, 0, 0, 0, 136293215, 0, 2, -1073748016, -1073748404, 30, -1, 0 <repeats 24 times>, 136293220, 0 <repeats 37 times>, 107, -1073749196, 1073772733, 1076120617, 134596840, 0, 1073772261, 1073829876, 134552384, 1073831440, 0, 0, 0, 0, 0, 0, 149, -1073749132, 1073772733, 1076120601, 134597006, 0, 1073772261, 1073829876, 0, 1076120196, 1076115732, 1075820000, 0, 0, 17, 1076822704, 10, -1073749204, 134552384, 1, 0, 1073831780, 51163477, 1073816491, -1073749120, 1073831440, 134596840, 1075820000, 0, 0, 17, 1076117444, 1075820000, -1073749116, 1073789187, 1073831780, 7, 0, 211990972, 1073816491, -1073749056, 1073831440, 1073788974, 136583712, 134992056, 16, 17, 1076118116, 134802876, 136583712, 16, -1073749044, 134705187, -1073749064, 137138073, -1073749060, 134813545, 136836420, 136286948, 929, 134813512, 136583712, 16, -1073748996, 134705187, 137137292, 1, -1073749012, 134817032, 136836420, 1, -1073749016, 134816996, 136583712, 137138000, 4, 134704524, 4, 18, -1073748948, 134699224, 137123984, 136519852, 4, 134698973, 136583712, 134968876, -1073748916, 134786232, 136583712, 0} trans_values = '\000' <repeats 216 times>, "\026\000\000\000\234;(\b,àÿ¿\030è5@\\èÿ¿\000\000\000\000läÿ¿D¾\b\b\001\000\000\000ä\004,\b" trans_rgb_value = {index = 0 '\000', red = 0, green = 0, blue = 0, gray = 0} palette = {{red = 0 '\000', green = 0 '\000', blue = 0 '\000'} <repeats 256 times>} png_ptr = 0x0 info_ptr = 0x0 transparent = -1 remap = 0 #4 0x80b2d10 in _php_image_output_ctx (ht=1, return_value=0x82c555c, this_ptr=0x0, return_value_used=0, image_type=2, tn=0x81fd36b "PNG", func_p=0x402509ec <gdImagePngCtx>) at gd_ctx.c:94 imgind = (zval **) 0x82c04e4 file = (zval **) 0x82c5568 quality = (zval **) 0x80758d8 im = 0x82c58a0 fn = 0x0 fp = (FILE *) 0x0 argc = 1 q = -1 i = 134992056 ctx = (gdIOCtx *) 0x82c5874 #5 0x80b766b in zif_imagepng (ht=1, return_value=0x82c555c, this_ptr=0x0, return_value_used=0) at gd.c:1479 No locals. #6 0x81cc407 in execute (op_array=0x82c57ec) at ./zend_execute.c:1598 original_return_value = (zval **) 0x82ca344 return_value_used = 0 execute_data = {opline = 0x82ca32c, function_state = {function_symbol_table = 0x0, function = 0x82bbcc8, reserved = { 0x806f178, 0x806f1d0, 0x8241a20, 0x0}}, fbc = 0x0, object = {ptr = 0x0}, Ts = 0xbfffe4f4, original_in_execution = 0 '\000'} #7 0x808a834 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 files = 0xbfffe858 i = 1 file_handle = (zend_file_handle *) 0xbffffa70 orig_op_array = (zend_op_array *) 0x0 local_retval = (zval *) 0x0 #8 0x809acd5 in php_execute_script (primary_file=0xbffffa70) at main.c:1381 orig_bailout = {{__jmpbuf = {1077922392, 1073831268, -1073743116, -1073743220, -1073743532, 134668693}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 32 times>}}}} orig_bailout_set = 1 '\001' prepend_file_p = (zend_file_handle *) 0x0 append_file_p = (zend_file_handle *) 0x0 prepend_file = {type = 165 '¥', filename = 0x403fca58 "\210Æ\020", opened_path = 0x40015d64 "", handle = {fd = 4096, fp = 0x1000}, free_filename = 0 '\000'} append_file = {type = 76 'L', filename = 0x4035ad8e "[\201ÃÊ\034\n", opened_path = 0x403fca58 "\210Æ\020", handle = { fd = 1073831268, fp = 0x40015d64}, free_filename = 244 'ô'} old_cwd = 0xbfffe864 "" retval = 0 #9 0x806e83c in main (argc=2, argv=0xbffffaf4) at php_cli.c:586 orig_bailout = {{__jmpbuf = {0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 32 times>}}}} orig_bailout_set = 0 '\000' exit_status = 0 c = 60 file_handle = {type = 2 '\002', filename = 0xbffffc07 "/home/www/develop.emoj.net/qa/gd.php", opened_path = 0x0, handle = {fd = 137123128, fp = 0x82c5538}, free_filename = 0 '\000'} behavior = 1 no_headers = 1 orig_optind = 1 orig_optarg = 0x0 arg_free = 0xbffffc07 "/home/www/develop.emoj.net/qa/gd.php" arg_excp = (char **) 0xbffffaf8 script_file = 0xbffffc07 "/home/www/develop.emoj.net/qa/gd.php" global_vars = {head = 0x0, tail = 0x0, size = 4, count = 0, dtor = 0, persistent = 0 '\000', traverse_ptr = 0x8241a20} interactive = 0 exec_direct = 0x0 #10 0x4030e2eb in __libc_start_main (main=0x806e058 <main>, argc=2, ubp_av=0xbffffaf4, init=0x806b690 <_init>, fini=0x81ec96c <_fini>, rtld_fini=0x4000c130 <_dl_fini>, stack_end=0xbffffaec) at ../sysdeps/generic/libc-start.c:129 ubp_av = (char **) 0xbffffaf4 fini = (void (*)()) 0x40015d64 <_dl_debug_mask> rtld_fini = (void (*)()) 0x40196f00 <png_libpng_ver> ubp_ev = (char **) 0x689 (gdb)