|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-24 10:29 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Description: ------------ Using latest 5.2 snapshot (Nov24, 2006 0730 GMT) and building on Linux RHEL4 with the following basic configuration: ./configure --disable-all --with-imap=/opt/imap-2004g --with-imap-ssl --enable-shared --enable-session=shared --enable-debug --enable-maintainer-zts --enable-cli --disable-cgi with "extension=session.so" added to php.ini the resulting CLI fails on startup, i.e. something as simple as "php -m" seg faults. Looking at the core produced on the seg fault with GDB gives the following back trace: http://pastebin.ca/256507 The reason for the fault is that imap initialization assumes that standard/file initialization has already completed and acquired and initialized "file globals". Unfortunately imap does not have a defined module dependency on standard so the module initialization order is not guaranteed to be correct. The reason for the crash in this case is that PHP 5.2 has defined a new dependency between standard and session so the order of session and standard in the startup order will be flipped by zend_sort_modules() when it sorts the module_registry. With session defined as shared and imap statically linked the resulting module initialization order will be session .......imap.....standard and we fail due to the unspecified dependency between imap and standard I get same seg fault if imap is also compiled as a shared module; the key to reproducing the problem is configuring PHP with imap support with session defined as shared and ZTS enabled. If both session and imap are defined as shared the problem can be resolved by ordering the php.ini entries as follows: extension = session.so extension = imap.so as this results in a initialization order of session..... standard ...imap and all is OK. But with imap linked statically there is no workaround to the issue The problem is easily resolved by defining the missing dependency between imap and standard. The following patch adds the necessary dependency: http://pastebin.ca/256510 Reproduce code: --------------- Build with above config on Linux and "php -m" fails with a seg fault. Expected result: ---------------- [root@rhel4 php5.2-200611240730]# php -m [PHP Modules] date imap Reflection session standard [Zend Modules] Actual result: -------------- [root@rhel4 php5.2-200611240730]# php -m Segmentation fault (core dumped)