|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-07-02 00:46 UTC] lnxgeek at us dot ibm dot com
Description:
------------
With php 4.2.1 or 4.1.2 and c-client 2001a or current c-client devel snap shot I cannot use any imap_open() calls to cyrus 2.1.5. Attempted imap_open() calls result in an error being logged by apache in error_log:
[notice] child pid 27897 exit signal Segmentation fault (11)
[notice] child pid 27902 exit signal Segmentation fault (11)
[notice] child pid 27901 exit signal Segmentation fault (11)
followed by a 'Page contains no data' error in the browser.
Environment:
------------
Red Hat 7.3
php-4.2.1 compiled from src
imap-2002.DEV.SNAP-0206241612 (c-client) compiled from src
cyrus-sasl-2.1.5 compiled from src
cyrus-imapd-2.1.5 compiled from src
Also Tried:
-----------
php-4.1.2-7 RPMS from Red Hat 7.3
imap-devel 2001a (c-client) from Red Hat 7.3
Config:
-------
I have RH 7.3 with Cyrus IMAP and Cyrus-SASL compiled from source and installed fine. IMAP clients, Mozilla, Evo, fetchmail, etc, have no problems connecting to my imapd via imap or imaps. I am using a self signed cert but have tested with imaps and cyrus tls_cert_* options disabled. (ie: I've tested without cyrus imapd loading any type of SSL/TLS support).
Test Case and Results
----------------------
I have the following test.php script running with php 4.2.1 and c-client 2002 DEV SNAP on the same Red Hat 7.3 server with Cyrus IMAPd 2.1.5:
<pre>
<?php
$ref = imap_open("{localhost:143}", "lnxgeek", "passwd", "OP_HALFOPEN")
or die ("Failed imap_open with: ".imap_last_error());
print "imap connection opened!";
imap_close($ref);
?>
</pre>
I have also tried the following $server parms for imap_open(). The results of each test are listed in [].
{localhost:143} [self cert err]
{localhost:143/imap} [self cert err]
{localhost:143/imap/notls} [segfalt sig 11]
{localhost:143/imap/novalidate-cert} [segfault sig 11]
{localhost:143/imap/notls/novalidate-cert} [segfault sig 11]
{localhost:993} [no connect]
{localhost:993/imap} [no connect]
{localhost:993/imap/ssl} [self cert error]
{localhost:993/imap/ssl/novalidate-cert} [segfault sig 11]
{localhost:993/imap/tls/novalidate-cert} [no connect]
The imtest client provided with cyrus has no problems connecting via imap or imaps using DIGEST, CRAM, or PLAIN passwords.
Additional Trouble Shooting
----------------------------
With the cyrus imapd running imap and imaps on the host 'ogg.raleigh.ibm.com', I attempted the same test script from a stock Red Hat 7.3 install. By default Red Hat 7.3 uses imap-devel 2001a (c-client) and php-4.1.2-7. Repeating the same tests as above resulted in the same errors shown.
Checking the logs of my cyrus server I can see that all connections were always accepted. For example I will typically see:
Jul 2 00:33:11 ogg imapd[28137]: mydelete: starting txn 2147483718
Jul 2 00:33:11 ogg imapd[28137]: mydelete: committing txn 2147483718
Jul 2 00:33:11 ogg imapd[28137]: mystore: starting txn 2147483719
Jul 2 00:33:11 ogg imapd[28137]: mystore: committing txn 2147483719
Jul 2 00:33:11 ogg imapd[28137]: starttls: TLSv1 with cipher DES-CBC3-SHA (168/168 bits new) no authentication
This shows a good connection has been made but at this point the apache child segfaults. Eventually the cyrus imapd session times out and closes.
GDB BackTrace
-------------
Next step: build php 4.2.1 with debug enabled and provide a gdb backtrace.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 20:00:02 2025 UTC |
#0 0x42080c14 in strnlen () from /lib/i686/libc.so.6 #1 0x42051e42 in vfprintf () from /lib/i686/libc.so.6 #2 0x4206dbf3 in vsprintf () from /lib/i686/libc.so.6 #3 0x4205a257 in sprintf () from /lib/i686/libc.so.6 #4 0x4096f751 in auth_md5_client (challenger=0x4098aa10 <imap_challenge>, responder=0x4098aab0 <imap_response>, service=0x409f4cad "imap", mb=0xbfffcdb0, stream=0x8190be8, trial=0xbfffcd18, user=0xbfffd150 "lnxgeek") at auth_md5.c:107 #5 0x4098a690 in imap_auth (stream=0x8190be8, mb=0xbfffcdb0, tmp=0xbfffd550 "00000001 AUTHENTICATE CRAM-MD5", usr=0xbfffd150 "lnxgeek") at imap4r1.c:884 #6 0x40989b58 in imap_open (stream=0x8190be8) at imap4r1.c:666 #7 0x40962226 in mail_open (stream=0x0, name=0x8190bb4 "{ogg.raleigh.ibm.com:143/imap/notls}", options=0) at mail.c:1058 #8 0x4094f1c0 in php_imap_do_open (ht=4, return_value=0x819317c, this_ptr=0x0, return_value_used=1, persistent=0) at php_imap.c:844 #9 0x4094f2cc in zif_imap_open (ht=4, return_value=0x819317c, this_ptr=0x0, return_value_used=1) at php_imap.c:874 #10 0x4043aef1 in abuf.0 () from /etc/httpd/modules/libphp4.so #11 0x4044bb24 in abuf.0 () from /etc/httpd/modules/libphp4.so #12 0x4045e402 in abuf.0 () from /etc/httpd/modules/libphp4.so #13 0x40458d92 in abuf.0 () from /etc/httpd/modules/libphp4.so #14 0x40459c00 in abuf.0 () from /etc/httpd/modules/libphp4.so #15 0x40459c7a in abuf.0 () from /etc/httpd/modules/libphp4.so #16 0x0805475d in ap_invoke_handler () #17 0x080671fc in process_request_internal () #18 0x08067273 in ap_process_request () #19 0x0805f4f7 in child_main () #20 0x0805f69a in make_child () #21 0x0805f7dd in startup_children () #22 0x0805fe30 in standalone_main () #23 0x08060723 in main () #24 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6I tried building SNAP php4-200207060900 but it also fails to link mysqlclient libs correctly. Based on that I tried the following: 1) untar php-4.2.1.tar.gz 2) cp php4-200207060900/ext/imap/* php-4.2.1/ext/imap/ 3) ./configure; make; make install; 4) restart httpd with -X and run gdb against it. Here is the resulting back trace from php 4.2.1 with updated imap ext from php4-200207060900. I do NOT think this is a problem with c-client since the mtest program provided with c-client has NO problems logging in with CRAM-MD5. The php4 imap extention however will core apache every time when using CRAM-MD5. PLAIN mechs work fine in both mtest and php4. #1 0x42051f32 in vfprintf () from /lib/i686/libc.so.6 #2 0x4206dce3 in vsprintf () from /lib/i686/libc.so.6 #3 0x4205a347 in sprintf () from /lib/i686/libc.so.6 #4 0x40918a61 in auth_md5_client (challenger=0x40933d20 <imap_challenge>, responder=0x40933dc0 <imap_response>, service=0x4099dfad "imap", mb=0xbfffcc40, stream=0x811fd50, trial=0xbfffcba8, user=0xbfffcfe0 "lnxgeek") at auth_md5.c:107 #5 0x409339a0 in imap_auth (stream=0x811fd50, mb=0xbfffcc40, tmp=0xbfffd3e0 "00000001 AUTHENTICATE CRAM-MD5", usr=0xbfffcfe0 "lnxgeek") at imap4r1.c:884 #6 0x40932e68 in imap_open (stream=0x811fd50) at imap4r1.c:666 #7 0x4090b536 in mail_open (stream=0x0, name=0x812110c "{ogg.raleigh.ibm.com:143/imap/notls}", options=0) at mail.c:1058 #8 0x408f823c in php_imap_do_open (ht=4, return_value=0x8153a3c, this_ptr=0x0, return_value_used=1, persistent=0) at php_imap.c:863 #9 0x408f8354 in zif_imap_open (ht=4, return_value=0x8153a3c, this_ptr=0x0, return_value_used=1) at php_imap.c:893 #10 0x4043aef1 in abuf.0 () from /etc/httpd/modules/libphp4.so #11 0x4044bb24 in abuf.0 () from /etc/httpd/modules/libphp4.so #12 0x4045e402 in abuf.0 () from /etc/httpd/modules/libphp4.so #13 0x40458d92 in abuf.0 () from /etc/httpd/modules/libphp4.so ---Type <return> to continue, or q <return> to quit--- #14 0x40459c00 in abuf.0 () from /etc/httpd/modules/libphp4.so #15 0x40459c7a in abuf.0 () from /etc/httpd/modules/libphp4.so #16 0x0805475d in ap_invoke_handler () #17 0x080671fc in process_request_internal () #18 0x08067273 in ap_process_request () #19 0x0805f4f7 in child_main () #20 0x0805f69a in make_child () #21 0x0805f7dd in startup_children () #22 0x0805fe30 in standalone_main () #23 0x08060723 in main () #24 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6Like I said before, I can not reprocude this with the UW imapd. Can you provide an account for your server? My test script: <?php $mbox = imap_open("{localhost:143/imap/notls}", "user", "pass"); $status = imap_headers($mbox); imap_close($mbox); print_r($status); ?>I built php4-200207060900 with the following options: './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-debug' '--with-openssl' '--with-imap' '--with-imap-ssl' '--with-apxs=/usr/sbin/apxs' '--without-cyrus' '--with-kerberos' My c-client libs are ssl/kerberos enabled which is why I need those two options. The rest is just path info. I still get a segfault. Here is the back trace: #0 0x42080d04 in strnlen () from /lib/i686/libc.so.6 #1 0x42051f32 in vfprintf () from /lib/i686/libc.so.6 #2 0x4206dce3 in vsprintf () from /lib/i686/libc.so.6 #3 0x4205a347 in sprintf () from /lib/i686/libc.so.6 #4 0x40586da1 in auth_md5_client (challenger=0x405a2060 <imap_challenge>, responder=0x405a2100 <imap_response>, service=0x40652c8d "imap", mb=0xbfffbd60, stream=0x80f7be0, trial=0xbfffbcc8, user=0xbfffc100 "test") at auth_md5.c:107 #5 0x405a1ce0 in imap_auth (stream=0x80f7be0, mb=0xbfffbd60, tmp=0xbfffc500 "00000000 AUTHENTICATE CRAM-MD5", usr=0xbfffc100 "test") at imap4r1.c:884 #6 0x405a11a8 in imap_open (stream=0x80f7be0) at imap4r1.c:666 #7 0x40579876 in mail_open (stream=0x0, name=0x812bfac "{213.243.182.199:143/imap/notls}", options=0) at mail.c:1058 #8 0x40426c48 in php_imap_do_open (ht=3, return_value=0x80fb32c, this_ptr=0x0, return_value_used=1, persistent=0) at /root/php4-200207060900/ext/imap/php_imap.c:863 #9 0x40426d60 in zif_imap_open (ht=3, return_value=0x80fb32c, this_ptr=0x0, return_value_used=1) at /root/php4-200207060900/ext/imap/php_imap.c:893 #10 0x4056ecc1 in execute (op_array=0x80f663c) at /root/php4-200207060900/Zend/zend_execute.c:1587 #11 0x4055d4f8 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php4-200207060900/Zend/zend.c:810 #12 0x4052a532 in php_execute_script (primary_file=0xbffff6b0) at /root/php4-200207060900/main/main.c:1388 #13 0x40573c1a in apache_php_module_main (r=0x80ed1c8, display_source_mode=0) at /root/php4-200207060900/sapi/apache/sapi_apache.c:55 #14 0x40574ac0 in send_php (r=0x80ed1c8, display_source_mode=0, filename=0x80eed78 "/var/www/html/test2.php") at /root/php4-200207060900/sapi/apache/mod_php4.c:550 #15 0x40574b2d in send_parsed_php (r=0x80ed1c8) at /root/php4-200207060900/sapi/apache/mod_php4.c:565 #16 0x0805475d in ap_invoke_handler () #17 0x080671fc in process_request_internal () #18 0x08067273 in ap_process_request () #19 0x0805f4f7 in child_main () #20 0x0805f69a in make_child () #21 0x0805f7dd in startup_children () #22 0x0805fe30 in standalone_main () #23 0x08060723 in main () #24 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6