php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17692 imap_status caught Segmentation fault
Submitted: 2002-06-11 03:44 UTC Modified: 2002-06-11 06:58 UTC
From: dynein at fasterweb dot net Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 4.2.1 OS: linux
Private report: No CVE-ID: None
 [2002-06-11 03:44 UTC] dynein at fasterweb dot net
$mbox = imap_open("{my.imap.host:imap_port}","username","password")
      or die("can't connect: ".imap_last_error());

$status = imap_status($mbox,"INBOX",SA_ALL);
This operation has made apache Segmentation fault.
"child pid xxxx exit signal Segmentation fault (11)" will appear in the apache log file.

but below works well:
$status = imap_status($mbox,"{my.imap.host:imap.port}INBOX",SA_ALL);

related software:imap-devel-2001a,php4.1.2,php4.2.1,apache 1.3.23,redhat 7.1

my configure line:
./configure --with-apxs=/usr/local/apache/bin/apxs --enable-sigchild --with-imap --with-gettext --with-mysql=/usr --with-mm=/usr --enable-trans-sid --enable-inline-optimization --enable-versioning --with-zlib --with-mhash=/usr --with-mcrypt --with-iconv --enable-shmop

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-11 03:53 UTC] mfischer@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2002-06-11 05:02 UTC] dynein at fasterweb dot net
the test script:
<?php
$mbox=imap_open("{127.0.0.1:143}INBOX", $username, $password) or die("Can't connect");
$mbox_status = imap_status($mbox,"INBOX",SA_ALL);
print $mbox_status->messages;
?>

the backtrace:
#0  imap_status (stream=0x0, mbx=0x82709b4 "INBOX", flags=31) at imap4r1.c:496
496       if (LEVELSTATUS (stream)) {   /* have STATUS command? */
(gdb) bt
#0  imap_status (stream=0x0, mbx=0x82709b4 "INBOX", flags=31) at imap4r1.c:496
#1  0x0817ace3 in imap_status (stream=0x826ff30, mbx=0x82709b4 "INBOX", flags=31)
    at imap4r1.c:490
#2  0x08156102 in mail_status (stream=0x826ff30, mbx=0x82709b4 "INBOX", flags=31) at mail.c:936
#3  0x080f35ab in zif_imap_status (ht=3, return_value=0x826b61c, this_ptr=0x0, 
    return_value_used=1) at php_imap.c:2654
#4  0x0814438b in execute (op_array=0x826b75c) at ./zend_execute.c:1598
#5  0x080d01e2 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810
#6  0x0806da9a in php_execute_script (primary_file=0xbffff9d0) at main.c:1381
#7  0x08067f58 in main (argc=2, argv=0xbffffa84) at cgi_main.c:778
#8  0x40158647 in __libc_start_main (main=0x80674b0 <main>, argc=2, ubp_av=0xbffffa84, 
    init=0x8065e10 <_init>, fini=0x81a4f50 <_fini>, rtld_fini=0x4000dcd4 <_dl_fini>, 
    stack_end=0xbffffa7c) at ../sysdeps/generic/libc-start.c:129
(gdb) frame 0 
#0  imap_status (stream=0x0, mbx=0x82709b4 "INBOX", flags=31) at imap4r1.c:496
496       if (LEVELSTATUS (stream)) {   /* have STATUS command? */
(gdb) frame 1
#1  0x0817ace3 in imap_status (stream=0x826ff30, mbx=0x82709b4 "INBOX", flags=31)
    at imap4r1.c:490
490         return imap_status (NIL,mbx,flags);
(gdb) frame 2
#2  0x08156102 in mail_status (stream=0x826ff30, mbx=0x82709b4 "INBOX", flags=31) at mail.c:936
936       return SAFE_STATUS (dtb,stream,mbx,flags);
(gdb) frame 3
#3  0x080f35ab in zif_imap_status (ht=3, return_value=0x826b61c, this_ptr=0x0, 
    return_value_used=1) at php_imap.c:2654
2654            if (mail_status(imap_le_struct->imap_stream, Z_STRVAL_PP(mbx), Z_LVAL_PP(flags))) {
(gdb) frame 4
#4  0x0814438b in execute (op_array=0x826b75c) at ./zend_execute.c:1598
1598                                                    ((zend_internal_function *) EX(function_state).function)->handler(EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC);
(gdb) frame 5
#5  0x080d01e2 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810
810                             zend_execute(EG(active_op_array) TSRMLS_CC);
(gdb) frame 6
#6  0x0806da9a in php_execute_script (primary_file=0xbffff9d0) at main.c:1381
1381                    retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);

the confingure line:
./configure --enable-force-cgi-redirect --enable-sigchild --with-imap --enable-debug
 [2002-06-11 05:11 UTC] mfischer@php.net
Are you using the latest version if imap ? It seems like a bug there.
 [2002-06-11 05:37 UTC] dynein at fasterweb dot net
My imap server is courier-imap1.4.6,the c-client library is imap-devel-2001a-1.71.0.
 [2002-06-11 06:58 UTC] sniper@php.net
It's not a PHP bug. Report this to the c-client author.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 22:01:28 2024 UTC