ID:               25911
 User updated by:  markus at digitaldiversity dot info
 Reported By:      markus at digitaldiversity dot info
-Status:           Feedback
+Status:           Open
 Bug Type:         IMAP related
 Operating System: FreeBSD 5.0
 PHP Version:      4.3.3
 New Comment:

Still causes SIGBUS, but I've pinpointed the problem a bit more: If the
mailbox is empty, it works like it should, 
but if there are mails in the mailbox, it crashes apache with the said
SIGBUS error, with more or less the same backtrace
(#0 being mail_fetch_structure (stream=0x813fe00, msgno=1, body=0x0,
flags=0) at mail.c:1395).

Tested version was 4.3.4RC2-dev (php4-STABLE-200310200930).


Previous Comments:
------------------------------------------------------------------------

[2003-10-19 13:28:44] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



------------------------------------------------------------------------

[2003-10-19 11:49:29] markus at digitaldiversity dot info

Oh, I forgot to mention that the imap_status() function works just
fine, it's just the imap_mailboxmsginfo() function that causes the
SIGBUS.

------------------------------------------------------------------------

[2003-10-19 11:46:20] markus at digitaldiversity dot info

Description:
------------
Apparently there seems to be some problems with imap_mailboxmsginfo(),
causing a SIGBUS error in Apache.

My configure-line is

./configure' \
'--with-apxs=/usr/local/apache/bin/apxs' \
'--enable-cli' \
'--with-zlib' \
'--with-bz2' \
'--with-dom' \
'--with-dom-xslt' \
'--with-dom-exslt' \
'--with-expat' \
'--enable-exif' \
'--enable-ftp' \
'--with-jpeg-dir=/usr/local' \
'--with-gd' \
'--with-pgsql' \
'--with-gettext' \
'--with-ldap' \
'--with-mcrypt' \
'--enable-pcntl' \
'--with-pdflib' \
'--enable-sockets' \
'--enable-wddx' \
'--with-openssl' \
'--with-curl' \
'--with-interbase' \
'--with-xmlrpc' \
'--with-yaz' \
'--enable-shmop' \
'--with-imap=/usr/local/imap-2000e' \
'--enable-debug' \

IMAP being imap-uw version 2000e. I've also tried imap-2002d, both of
which gave the same error.

I did read about mcrypt being one possible problem, so I updated that
to version 2.6.4_1 in the FreeBSD ports collection, but that didn't
help either.


Reproduce code:
---------------
<?php

if (($mbox = imap_open('{mail.server:110/pop3}', 'user', 'password'))
=== FALSE) {

            imap_close($mbox);
            var_dump(imap_errors());

        }

        $check = imap_mailboxmsginfo($mbox);

        imap_close($mbox);

?>

Expected result:
----------------
Nothing happens when running the above code, except 
Apache (1.2.27) crashing with a SIGBUS and a

[Sun Oct 19 18:41:40 2003] [notice] child pid 27550 exit signal Bus
error (10)

being left in the Apache error logs.

Actual result:
--------------
The GDB backtrace looks like this:

Program received signal SIGBUS, Bus error.
mail_fetch_structure (stream=0x814dc00, msgno=1, body=0x0, flags=0) at
mail.c:1395
1395          hdr[hdrsize] = '\0';      /* tie off header */
(gdb) bt
#0  mail_fetch_structure (stream=0x814dc00, msgno=1, body=0x0, flags=0)
at mail.c:1395
#1  0x2829ef1d in zif_imap_mailboxmsginfo (ht=1,
return_value=0x8172524, this_ptr=0x0, return_value_used=1)
    at /usr/home/mle/devel/php-4.3.3/ext/imap/php_imap.c:1901
#2  0x2840aa2a in execute (op_array=0x8173424) at
/usr/home/mle/devel/php-4.3.3/Zend/zend_execute.c:1616
#3  0x283f92f9 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/home/mle/devel/php-4.3.3/Zend/zend.c:885
#4  0x283c1fe7 in php_execute_script (primary_file=0xbfbff6e0) at
/usr/home/mle/devel/php-4.3.3/main/main.c:1723
#5  0x2840fae4 in apache_php_module_main (r=0x816c034,
display_source_mode=0)
    at /usr/home/mle/devel/php-4.3.3/sapi/apache/sapi_apache.c:54
#6  0x28410aa0 in send_php (r=0x816c034, display_source_mode=0,
    filename=0x816cc14
"/usr/local/apache/htdocs/Projects/STAY/lib/webmail.extension.php")
    at /usr/home/mle/devel/php-4.3.3/sapi/apache/mod_php4.c:620
#7  0x28410b11 in send_parsed_php (r=0x816c034) at
/usr/home/mle/devel/php-4.3.3/sapi/apache/mod_php4.c:635
#8  0x08053b6a in ap_invoke_handler ()
#9  0x08067f26 in process_request_internal ()
#10 0x08067f88 in ap_process_request ()
#11 0x0805f1a8 in child_main ()
#12 0x0805f348 in make_child ()
#13 0x0805f4b1 in startup_children ()
#14 0x0805fa8e in standalone_main ()
#15 0x080602ac in main ()
#16 0x0804ec45 in _start ()



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25911&edit=1

Reply via email to