[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#317634: php4-imagick: Segfaults when calling imagick functions

Package: php4-imagick
Version: 0.9.11-1
Followup-For: Bug #298448
Severity: important

Since some times, my php-imagick module has broken down. At first glance this
bug seems identical to #298448 (archived), though it seems to show the same
symptoms as #272687 too.

I have first noticed segfaults appearing in my apache error.log:
[Sat Jul  9 21:50:44 2005] [notice] child pid 28074 exit signal Segmentation fault (11)
Which is the same symptom as #298448.

In both bug reports this is claimed to be fixed in 0.9.11-0.2 and 0.9.11-1. I
have 0.9.11-1 installed, which does not seem to fix the problem (not that the
last post in the archived #298448 did not acknowledge the fix).

Some extra debugging shows there is some kind of problem when cleaning up, I
managed to make the following stacktrace (Unfortunately still with the
original .deb, didn't get around to compiling with debugging symbols yet).
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1210791712 (LWP 31810)]
> 0xb7b3edfa in _efree () from /usr/lib/apache/1.3/libphp4.so
> (gdb)
> (gdb)
> (gdb) bt
> #0  0xb7b3edfa in _efree () from /usr/lib/apache/1.3/libphp4.so
> #1  0xb77638e8 in zm_deactivate_imagick () from
> /usr/lib/php4/20020429/imagick.so
> #2  0xb7b514d9 in module_registry_cleanup () from
> /usr/lib/apache/1.3/libphp4.so
> #3  0xb7b53949 in zend_hash_apply () from /usr/lib/apache/1.3/libphp4.so
> #4  0xb7b4e3d0 in zend_deactivate_modules () from
> /usr/lib/apache/1.3/libphp4.so
> #5  0xb7b1f315 in php_request_shutdown () from /usr/lib/apache/1.3/libphp4.so
> #6  0xb7b631df in apache_php_module_main () from
> /usr/lib/apache/1.3/libphp4.so
> #7  0xb7b63ddc in apache_php_module_main () from
> /usr/lib/apache/1.3/libphp4.so
> #8  0xb7b63fa1 in apache_php_module_main () from
> /usr/lib/apache/1.3/libphp4.so
> #9  0x080553c3 in ap_invoke_handler ()
> #10 0x08068465 in ap_some_auth_required ()
> #11 0x08068614 in ap_process_request ()
> #12 0x08060bd2 in ap_child_terminate ()
> #13 0x08060e9a in ap_child_terminate ()
> #14 0x08060f10 in ap_child_terminate ()
> #15 0x08061a9a in ap_child_terminate ()
> #16 0x08061ff8 in main ()
> (gdb) quit

This stacktrace was made by running apache in single mode and requesting
line.php from the examples.

I also tried running the same from the command line (using all of "php",
"php4" and "php4-cgi") on several files, all giving a similar output. The
following is from running line.php.

> <br />
> <b>Warning</b>:  imagick_iserror() expects parameter 1 to be resource, boolean
> given in <b>/var/www/examples/line.php</b> on line <b>3</b><br />
> <br />
> <b>Warning</b>:  imagick_begindraw() expects parameter 1 to be resource,
> boolean given in <b>/var/www/examples/line.php</b> on line <b>12</b><br />
> <br />
> <b>Warning</b>:  imagick_drawline() expects parameter 1 to be resource,
> boolean given in <b>/var/www/examples/line.php</b> on line <b>14</b><br />
> <br />
> <b>Warning</b>:  imagick_failedreason() expects parameter 1 to be resource,
> boolean given in <b>/var/www/examples/line.php</b> on line <b>16</b><br />
> <br />
> <b>Warning</b>:  imagick_faileddescription() expects parameter 1 to be
> resource, boolean given in <b>/var/www/examples/line.php</b> on line
> <b>17</b><br />
> imagick_drawline() failed!<BR>
> Reason: <BR>
> Description: <BR>
> Segmentation fault

It seems imagick_readimage does not return a valid handle or something like
that. It is probably worth noting that when I tried an older version of
php4-imagick (0.9.7-1.3) I got the very same errors when requesting the php
files from my web browser (just without the segfault I presume).

I have tried this on three systems. Of these, two showed the same problems.
The third, which had no previous installation of php, did not show the same
problems (for some reason, the resize.php example failed with a timeout, but I
expect this to be due to other reasons).

I have just purged apache, php4, imagemagick and php4-imagick packages and
reinstalled them, to no avail (same segfault).

Any tips on where to look further?


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.10
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

ii  libapache-mod-php4 [phpa 4:4.3.10-15     server-side, HTML-embedded scripti
ii  libbz2-1.0               1.0.2-7         high-quality block-sorting file co
ii  libc6                    2.3.2.ds1-22    GNU C Library: Shared libraries an
ii  libjpeg62                6b-10           The Independent JPEG Group's JPEG 
ii  libmagick6               6:     Image manipulation library
ii  libpng12-0               1.2.8rel-1      PNG library - runtime
ii  libtiff4                 3.7.2-3         Tag Image File Format (TIFF) libra
ii  php4-cgi [phpapi-2002091 4:4.3.10-15     server-side, HTML-embedded scripti
ii  php4-cli [phpapi-2002091 4:4.3.10-15     command-line interpreter for the p

php4-imagick recommends no packages.

-- debconf information:
  php4/extension_imagick_cli: true
  php4/extension_imagick_cgi: true
  php4/add_extension: true
  php4/remove_extension: true
  php4/extension_imagick_apache: true

Reply to: