[PHP-DEV] Crash when sending SIGHUP to the Apache parent process when IMagick is loaded

2010-02-08 Thread Jess Portnoy

Hello all,

I have IMagick 2.2.2 [latest stable in PECL] loaded with PHP 5.3.1. When 
sending SIGHUP, Apache defuncts, the BT is as follows:

(gdb) bt
#0  0x7f069935b384 in __lll_lock_wait () from /lib/libpthread.so.0
#1  0x7f0699356bf0 in _L_lock_102 () from /lib/libpthread.so.0
#2  0x7f06993564fe in pthread_mutex_lock () from /lib/libpthread.so.0
#3  0x7f06903df7b3 in LockSemaphoreInfo (semaphore_info=0xfa9130) at 
magick/semaphore.c:373

#4  0x7f06903a5160 in DestroyModuleList () at magick/module.c:135
#5  0x7f06903a1d79 in DestroyMagickList () at magick/magick.c:140
#6  0x7f06903a1dff in MagickCoreTerminus () at magick/magick.c:1238
#7  0x7f069037caf7 in DefaultFatalErrorHandler 
(magick_unused_severity=value optimized out,
   reason=0xfa9430 unable to initialize module loader `Inappropriate 
ioctl for device',

   description=0x0) at magick/exception.c:305
#8  0x7f069037d0c6 in CatchException (exception=0x7fff61e2ff80) at 
magick/exception.c:218
#9  0x7f06903a46c0 in GetModuleInfo (tag=value optimized out, 
exception=0xfa8de0)

   at magick/module.c:793
#10 0x7f06903a1232 in GetMagickInfo (name=0x0, exception=0xfa8de0) 
at magick/magick.c:800
#11 0x7f06903a14d0 in MagickCoreGenesis (path=0x0, 
establish_signal_handlers=MagickFalse)

   at magick/magick.c:1201
#12 0x7f06905a9736 in MagickWandGenesis () at wand/magick-wand.c:987
#13 0x7f069072bf56 in zm_startup_imagick () from 
/usr/local/zend/lib/php_extensions/imagick.so

#14 0x7f069322f8ec in zend_startup_module_ex (module=0x12b0310)
   at /php-5.3.1/Zend/zend_API.c:1613
#15 0x7f0693238475 in zend_hash_apply (ht=0x7f0693734ce0,
   apply_func=0x7f069322f800 zend_startup_module_ex) at 
/php-5.3.1/Zend/zend_hash.c:673
#16 0x7f06932322fa in zend_startup_modules () at 
/php-5.3.1/Zend/zend_API.c:1662

#17 0x7f06931dcce4 in php_module_startup (sf=value optimized out,
   additional_modules=0x7f06936fc4a0, num_additional_modules=1) at 
/php-5.3.1/main/main.c:2018

#18 0x7f06932b2c45 in php_apache2_startup (sapi_module=0xfa9130)
   at /php-5.3.1/sapi/apache2handler/sapi_apache2.c:328
#19 0x7f06932b36e6 in php_apache_server_startup (pconf=0xae6168, 
plog=value optimized out,
   ptemp=value optimized out, s=0xaec968) at 
/php-5.3.1/sapi/apache2handler/sapi_apache2.c:437

#20 0x00438cf4 in ap_run_post_config ()
#21 0x00425bbc in main ()

It appears to me as though IMagick's MSHUTDOWN fails to do proper 
cleanup and thus, the crash occurs in the next startup but this does not 
occur with PHP 5_2 [tested 5.2.12] or PHP 5.3.0 and is also resolved in 
5.3.2RC1 which is good.
Can anyone refer me to the revision that solves this issue? I am asking 
because I would very much like to backport it to 5.3.1.


Thanks in advance,

--
May the source be with you,
Best regards,
Jess Portnoy


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Crash when sending SIGHUP to the Apache parent process when IMagick is loaded

2010-02-08 Thread Jess Portnoy

Found the issue.
I've applied a local patchset which included this revision:
http://svn.php.net/viewvc/?view=revisionrevision=291488
Which fixes:

#50261 (Crash When Calling Parent Constructor with call_user_func())

However, it also included a small mistake commit, later reverted in revision 
291491.

Thanks anyway,

May the source be with you,
Best regards,
Jess Portnoy



Jess Portnoy wrote:

Hello all,

I have IMagick 2.2.2 [latest stable in PECL] loaded with PHP 5.3.1. 
When sending SIGHUP, Apache defuncts, the BT is as follows:

(gdb) bt
#0  0x7f069935b384 in __lll_lock_wait () from /lib/libpthread.so.0
#1  0x7f0699356bf0 in _L_lock_102 () from /lib/libpthread.so.0
#2  0x7f06993564fe in pthread_mutex_lock () from /lib/libpthread.so.0
#3  0x7f06903df7b3 in LockSemaphoreInfo (semaphore_info=0xfa9130) 
at magick/semaphore.c:373

#4  0x7f06903a5160 in DestroyModuleList () at magick/module.c:135
#5  0x7f06903a1d79 in DestroyMagickList () at magick/magick.c:140
#6  0x7f06903a1dff in MagickCoreTerminus () at magick/magick.c:1238
#7  0x7f069037caf7 in DefaultFatalErrorHandler 
(magick_unused_severity=value optimized out,
   reason=0xfa9430 unable to initialize module loader `Inappropriate 
ioctl for device',

   description=0x0) at magick/exception.c:305
#8  0x7f069037d0c6 in CatchException (exception=0x7fff61e2ff80) at 
magick/exception.c:218
#9  0x7f06903a46c0 in GetModuleInfo (tag=value optimized out, 
exception=0xfa8de0)

   at magick/module.c:793
#10 0x7f06903a1232 in GetMagickInfo (name=0x0, exception=0xfa8de0) 
at magick/magick.c:800
#11 0x7f06903a14d0 in MagickCoreGenesis (path=0x0, 
establish_signal_handlers=MagickFalse)

   at magick/magick.c:1201
#12 0x7f06905a9736 in MagickWandGenesis () at wand/magick-wand.c:987
#13 0x7f069072bf56 in zm_startup_imagick () from 
/usr/local/zend/lib/php_extensions/imagick.so

#14 0x7f069322f8ec in zend_startup_module_ex (module=0x12b0310)
   at /php-5.3.1/Zend/zend_API.c:1613
#15 0x7f0693238475 in zend_hash_apply (ht=0x7f0693734ce0,
   apply_func=0x7f069322f800 zend_startup_module_ex) at 
/php-5.3.1/Zend/zend_hash.c:673
#16 0x7f06932322fa in zend_startup_modules () at 
/php-5.3.1/Zend/zend_API.c:1662

#17 0x7f06931dcce4 in php_module_startup (sf=value optimized out,
   additional_modules=0x7f06936fc4a0, num_additional_modules=1) at 
/php-5.3.1/main/main.c:2018

#18 0x7f06932b2c45 in php_apache2_startup (sapi_module=0xfa9130)
   at /php-5.3.1/sapi/apache2handler/sapi_apache2.c:328
#19 0x7f06932b36e6 in php_apache_server_startup (pconf=0xae6168, 
plog=value optimized out,
   ptemp=value optimized out, s=0xaec968) at 
/php-5.3.1/sapi/apache2handler/sapi_apache2.c:437

#20 0x00438cf4 in ap_run_post_config ()
#21 0x00425bbc in main ()

It appears to me as though IMagick's MSHUTDOWN fails to do proper 
cleanup and thus, the crash occurs in the next startup but this does 
not occur with PHP 5_2 [tested 5.2.12] or PHP 5.3.0 and is also 
resolved in 5.3.2RC1 which is good.
Can anyone refer me to the revision that solves this issue? I am 
asking because I would very much like to backport it to 5.3.1.


Thanks in advance,



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php