From: Operating system: Mac OS X 10.6.8 PHP version: 5.3.8 Package: *Graphics related Bug Type: Bug Bug description:Apache crashes when dumping results of getPixelREgionIterator
Description: ------------ I need to remove background color of an image created using MagickImage, but there's no "imagecolorat" in the MagickImage library. I used the "getPixelRegionIterator" instead, but it makes Apache2 to crash when accessing "getColor" of the first MagickPixel object of the resulting row. This bug is quite simple to reproduce and does not need an image, the test script above "just crashes well". Good luck for debugging :-) Test script: --------------- $width = 320; $height = 240; $im = new Imagick(); $im->newimage($width, $height, '#000000'); $im->setImageMatte(true); $im->unsharpMaskImage(0 , 0.5 , 1 , 0.05); $im->normalizeImage(); $corners = new STDClass(); $corners->TL = $im->getPixelRegionIterator(0, 0, 1, 1)->getNextIteratorRow(); $corners->TL = $corners->TL[0]->getColor(); var_dump($corners); Expected result: ---------------- object(stdClass)#3 (4) { ["TL"]=> array(4) { ["r"]=> int(0) ["g"]=> int(0) ["b"]=> int(0) ["a"]=> int(0) } } Actual result: -------------- syslog : Oct 16 21:34:17 KolyMac com.apple.ReportCrash.Root[65501]: 2011-10-16 21:34:17.855 ReportCrash[65501:1407] Saved crash report for httpd[65463] version ??? (???) to /Library/Logs/DiagnosticReports/httpd_2011-10-16-213417_localhost.crash /Library/Logs/DiagnosticReports/httpd_2011-10-16-213417_localhost.crash (only backtrace) : Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libSystem.B.dylib 0x00007fff8356c9ce __semwait_signal_noca ncel + 101 libSystem.B.dylib 0x00007fff8356c8d0 nanosleep$NOCANCEL + 1292 libSystem.B.dylib 0x00007fff835c93ce usleep$NOCANCEL + 57 3 libSystem.B.dylib 0x00007fff835e8a00 abort + 93 4 libSystem.B.dylib 0x00007fff835d59bc __pthread_markcancel + 0 5 libMagickWand.4.dylib 0x0000000101ceeff8 PixelGetRed + 1686 imagick.so 0x0000000101bbfca7 zim_imagickpixel_getc olor + 87 7 libphp5.so 0x000000010127e66a zend_do_fcall_common_ helper_SPEC + 29868 libphp5.so 0x000000010125284b execute + 491 9 libphp5.so 0x000000010122a7ab zend_execute_scripts + 363 10 libphp5.so 0x00000001011d2382 php_execute_script + 482 11 libphp5.so 0x00000001012baa8c php_handler + 1660 12 httpd 0x00000001000016fb ap_run_handler + 123 13 httpd 0x000000010000359d ap_invoke_handler + 141 14 httpd 0x0000000100025368 ap_process_request + 440 15 httpd 0x0000000100021e98 ap_process_http_connection + 344 16 httpd 0x000000010000ee6b ap_run_process_connection + 123 17 httpd 0x000000010002a14d child_main + 957 18 httpd 0x000000010002a40a make_child + 266 19 httpd 0x000000010002ad0c ap_mpm_run + 2092 20 httpd 0x0000000100008098 main + 2328 21 httpd 0x00000001000012d4 start + 52 Thread 1: 0 libSystem.B.dylib 0x00007fff83534a6a __semwait_signal + 10 1 libSystem.B.dylib 0x00007fff83538881 _pthread_cond_wait + 1286 2 libMagickCore.4.dylib 0x0000000101f0ac4b gomp_sem_wait + 75 3 libMagickCore.4.dylib 0x0000000101f0acff gomp_barrier_wait_end + 143 4 libMagickCore.4.dylib 0x0000000101f0a3bd gomp_thread_start + 333 5 libSystem.B.dylib 0x00007fff83532fd6 _pthread_start + 331 6 libSystem.B.dylib 0x00007fff83532e89 thread_start + 13 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x000000000000003c rbx: 0x00007fff5fbfea00 rcx: 0x00007fff5fbfe9b8 rdx: 0x0000000000000001 rdi: 0x0000000000000803 rsi: 0x0000000000000000 rbp: 0x00007fff5fbfe9f0 rsp: 0x00007fff5fbfe9b8 r8: 0x0000000000000000 r9: 0x0000000000989680 r10: 0x0000000000000001 r11: 0x0000000000000246 r12: 0x0000000000000000 r13: 0x0000000101d08429 r14: 0x0000000101d02cc0 r15: 0x00007fff7056c790 rip: 0x00007fff8356c9ce rfl: 0x0000000000000247 cr2: 0x0000000122afa000 -- Edit bug report at https://bugs.php.net/bug.php?id=60071&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60071&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60071&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60071&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60071&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60071&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60071&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60071&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60071&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60071&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60071&r=support Expected behavior: https://bugs.php.net/fix.php?id=60071&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60071&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60071&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60071&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60071&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60071&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60071&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60071&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60071&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60071&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60071&r=mysqlcfg