Bug #18104 Updated: imap_open() results in apache child pid exit segfaul sig (11)

From: Date: Sat, 06 Jul 2002 17:20:40 +0000
Subject: Bug #18104 Updated: imap_open() results in apache child pid exit segfaul sig (11)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13321@lists.php.net to get a copy of this message
ID: 18104 Updated by: lnxgeek@us.ibm.com Reported By: lnxgeek@us.ibm.com Status: Open Bug Type: IMAP related Operating System: Red Hat Linux 7.3 PHP Version: 4.2.1 New Comment: I 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.6 Previous Comments: ------------------------------------------------------------------------ [2002-07-03 23:47:24] lnxgeek@us.ibm.com Building php4-latest.tgz fails on Red Hat 7.3 with an odd problem about not finding mysqlclient when clearly it should be able to find it. php 4.2.1 stable does not have this issue. /usr/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status make: *** [libphp4.la] Error 1 [root@ogg php4-200207031800]# /sbin/ldconfig -v | grep mysql /usr/lib/mysql: libmysqlclient.so.10 -> libmysqlclient.so.10.0.0 [root@ogg php4-200207031800]# I used the following ./configure line: './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-force-cgi-redirect' \ '--enable-debug' \ '--enable-dbg=shared' \ '--with-dbg-profiler' \ '--enable-pic' \ '--disable-rpath' \ '--enable-inline-optimization' \ '--with-bz2' \ '--with-db3' \ '--with-curl' \ '--with-dom=/usr' \ '--with-exec-dir=/usr/bin' \ '--with-freetype-dir=/usr' \ '--with-png-dir=/usr' \ '--with-gd' \ '--enable-gd-native-ttf' \ '--with-ttf' \ '--with-gdbm' \ '--with-gettext' \ '--with-ncurses' \ '--with-gmp' \ '--with-iconv' \ '--with-jpeg-dir=/usr' \ '--with-mm' \ '--with-openssl' \ '--with-png' \ '--with-pspell' \ '--with-regex=system' \ '--with-xml' \ '--with-expat-dir=/usr' \ '--with-zlib' \ '--with-layout=GNU' \ '--enable-bcmath' \ '--enable-debugger' \ '--enable-exif' \ '--enable-ftp' \ '--enable-magic-quotes' \ '--enable-safe-mode' \ '--enable-sockets' \ '--enable-sysvsem' \ '--enable-sysvshm' \ '--enable-discard-path' \ '--enable-track-vars' \ '--enable-trans-sid' \ '--enable-yp' \ '--enable-wddx' \ '--without-oci8' \ '--with-imap=shared' \ '--with-imap-ssl' \ '--with-kerberos=/usr/kerberos' \ '--with-ldap=shared' \ '--with-mysql=shared,/usr' \ '--with-pgsql=shared' \ '--with-snmp=shared,/usr' \ '--with-snmp=shared' \ '--enable-ucd-snmp-hack' \ '--with-unixODBC=shared' \ '--enable-memory-limit' \ '--enable-bcmath' \ '--enable-shmop' \ '--enable-versioning' \ '--enable-calendar' \ '--enable-dbx' \ '--enable-dio' \ '--enable-mcal' \ '--enable-mbstring' \ '--enable-mbstr-enc-trans' \ '--with-apxs=/usr/sbin/apxs' \ '--without-cyrus' ------------------------------------------------------------------------ [2002-07-03 20:24:17] sniper@php.net Using the imap-2002.DEV.SNAP-0206241612.tar.Z c-client lib with PHP and the imapd from that same package does not cause any crash. Neither did it crash with the imap-2001a c-client.. Try this PHP snapshot: http://snaps.php.net/php4-latest.tar.gz It would also help a bit if you could provide an account for your server to test this. That gdb backtrace does suggest that this crash happens in c-client, NOT in PHP. But please try that snapshot. ------------------------------------------------------------------------ [2002-07-03 00:42:42] lnxgeek@us.ibm.com #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.6 ------------------------------------------------------------------------ [2002-07-02 23:59:46] sniper@php.net Keep this at 'feedback' until you can get us that GDB backtrace.. ------------------------------------------------------------------------ [2002-07-02 23:54:17] lnxgeek@us.ibm.com Yup, I understand you don't want the core file. I know that _I_ want the core file so I can give you a bt. I'll try again. And yes, I already tried _both_ sets of directions. Neither one did me good. That said, I've narrowed the problem down to issues with php 4.2.1 / 4.1.2 imap module. The segfault will ONLY happen when trying to use CRAM-MD5 mech for authentication. If the imapd does not advertise CRAM-MD5 then PLAIN is used and everything works as expected. That said, I check out the mtest tool provided with imap-2001a and verified that mtest will correctly login to an imap server with CRAM-MD5. PHP however continues to segfault when trying to do the same login with CRAM-MD5. I'm fairly certain this narrows the issue down to somethig having to do with MD5 auth in php4/ext/imap/imap.c and NOT the imap-2001a c-client libs. For a simple test case I recomend the script posted in this bug report and to verify it works against an imapd server that advertises MD5-CRAM. I'm using Cyrus IMAPd 2.1.5 with SASL 2.1.5 for my tests. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/18104 -- Edit this bug report at http://bugs.php.net/?id=18104&edit=1

« previous php.bugs (#13321) next »