|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-06-20 16:44 UTC] andy at webtatic dot com
Description:
------------
imap_search($connection, 'ALL') seems to be causing a segmentation fault.
The backtrace (from what I guess), seems to suggest the command is recursively calling itself to free the searchset, the same thing being called endlessly.
The php build was based on the CentOS testing php-5.2.6 rpm modified to compile php-5.2.10. php-5.2.9 did not have this issue.
build --enable-force-cgi-redirect \
--enable-pcntl \
--with-imap=shared --with-imap-ssl \
--enable-mbstring=shared --enable-mbstr-enc-trans \
--enable-mbregex \
--with-ncurses=shared \
--with-gd=shared \
--enable-bcmath=shared \
--enable-dba=shared --with-db4=%{_prefix} \
--with-xmlrpc=shared \
--with-ldap=shared --with-ldap-sasl \
--with-mysql=shared,%{_prefix} \
--with-mysqli=shared,%{_bindir}/mysql_config \
--enable-dom=shared \
--with-dom-xslt=%{_prefix} --with-dom-exslt=%{_prefix} \
--with-pgsql=shared \
--with-snmp=shared,%{_prefix} \
--enable-soap=shared \
--with-xsl=shared,%{_prefix} \
--enable-xmlreader=shared --enable-xmlwriter=shared \
--enable-fastcgi \
--enable-pdo=shared \
--with-pdo-odbc=shared,unixODBC,%{_prefix} \
--with-pdo-mysql=shared,%{_prefix} \
--with-pdo-pgsql=shared,%{_prefix} \
--with-pdo-sqlite=shared,%{_prefix} \
--enable-json=shared \
--enable-zip=shared \
--with-readline \
--enable-dbase=shared \
--enable-debug
Actual result:
--------------
#0 0x020393ff in mail_free_searchset () from /usr/lib/libc-client.so.1
#1 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#2 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#3 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#4 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#5 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#6 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#7 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#8 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#9 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
#10 0x0203941b in mail_free_searchset () from /usr/lib/libc-client.so.1
...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
The c client I'm using is the one part of CentOS 5.3, 2004g-2.2.1 I added the --enable-debug to the configure earlier, and got a php build that had a version like: PHP 5.2.10 (cli) (built: Jun 20 2009 18:09:52) (DEBUG) I'm not sure why its not adding debug information. Sorry, the proper ./configure is more like: configure \ --cache-file=../config.cache \ --with-libdir=%{_lib} \ --with-config-file-path=%{_sysconfdir} \ --with-config-file-scan-dir=%{_sysconfdir}/php.d \ --with-pic \ --disable-rpath \ --without-pear \ --with-bz2 \ --with-curl \ --with-exec-dir=%{_bindir} \ --with-freetype-dir=%{_prefix} \ --with-png-dir=%{_prefix} \ --enable-gd-native-ttf \ --without-gdbm \ --with-gettext \ --with-gmp \ --with-iconv \ --with-jpeg-dir=%{_prefix} \ --with-openssl \ --with-png \ --with-pspell \ --with-expat-dir=%{_prefix} \ --with-pcre-regex=%{_prefix} \ --with-zlib \ --with-layout=GNU \ --enable-exif \ --enable-ftp \ --enable-magic-quotes \ --enable-sockets \ --enable-sysvsem --enable-sysvshm --enable-sysvmsg \ --enable-track-vars \ --enable-trans-sid \ --enable-yp \ --enable-wddx \ --with-kerberos \ --enable-ucd-snmp-hack \ --with-unixODBC=shared,%{_prefix} \ --enable-memory-limit \ --enable-shmop \ --enable-calendar \ --enable-dbx \ --enable-dio \ --without-mime-magic \ --without-sqlite \ --with-libxml-dir=%{_prefix} \ --with-xml \ --with-system-tzdata \ --enable-debug \ --enable-force-cgi-redirect \ --enable-pcntl \ --with-imap=shared --with-imap-ssl \ --enable-mbstring=shared --enable-mbstr-enc-trans \ --enable-mbregex \ --with-ncurses=shared \ --with-gd=shared \ --enable-bcmath=shared \ --enable-dba=shared --with-db4=%{_prefix} \ --with-xmlrpc=shared \ --with-ldap=shared --with-ldap-sasl \ --with-mysql=shared,%{_prefix} \ --with-mysqli=shared,%{_bindir}/mysql_config \ --enable-dom=shared \ --with-dom-xslt=%{_prefix} --with-dom-exslt=%{_prefix} \ --with-pgsql=shared \ --with-snmp=shared,%{_prefix} \ --enable-soap=shared \ --with-xsl=shared,%{_prefix} \ --enable-xmlreader=shared --enable-xmlwriter=shared \ --enable-fastcgi \ --enable-pdo=shared \ --with-pdo-odbc=shared,unixODBC,%{_prefix} \ --with-pdo-mysql=shared,%{_prefix} \ --with-pdo-pgsql=shared,%{_prefix} \ --with-pdo-sqlite=shared,%{_prefix} \ --enable-json=shared \ --enable-zip=shared \ --with-readline \ --enable-dbase=sharedI've made a patch for it, as I'd like to have it patched in my rpms of 5.2.10. I can't see anywhere to upload files, so I'll post it here, only short: --- php-5.2.10/ext/imap/php_imap.c.pgmfree 2009-06-20 21:44:54.000000000 +0100 +++ php-5.2.10/ext/imap/php_imap.c 2009-06-20 21:45:16.000000000 +0100 @@ -3701,7 +3701,7 @@ flags = SE_FREE; } else { convert_to_long_ex(search_flags); - flags = Z_LVAL_PP(search_flags); + flags = Z_LVAL_PP(search_flags) & SE_FREE; if (argc == 4) { convert_to_string_ex(charset); } @@ -3712,10 +3712,6 @@ mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? Z_STRVAL_PP(charset) : NIL), pgm, flags); - if (pgm) { - mail_free_searchpgm(&pgm); - } - if (IMAPG(imap_messages) == NIL) { efree(search_criteria); RETURN_FALSE;