Bug #76618 [Asn]: segfault on imap_reopen

From: Date: Mon, 16 Jul 2018 14:15:09 +0000
Subject: Bug #76618 [Asn]: segfault on imap_reopen
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216353@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76618&edit=1 ID: 76618 Updated by: cmb@php.net Reported by: slim at inbox dot lv Summary: segfault on imap_reopen Status: Assigned Type: Bug Package: IMAP related Operating System: linux PHP Version: 7.1.19 Assigned To: nikic Block user comment: N Private report: N New Comment: It seems to me the correct fix would be to remove imap_reopen(). Consider how bool freopen($res) would work. Previous Comments: ------------------------------------------------------------------------ [2018-07-16 12:55:46] kalle@php.net Nikita, is this the correct fix (being our presidental php-ng expert)? ------------------------------------------------------------------------ [2018-07-13 11:37:09] cmb@php.net Simple reproducer without mailserver: <?php $imap = imap_open('~/good-mailbox', '', '', 0); var_dump($imap); $foo = $imap; var_dump(imap_num_msg($imap)); var_dump(imap_reopen($imap, '~/bad-mailbox')); var_dump(imap_num_msg($imap)); ------------------------------------------------------------------------ [2018-07-13 07:54:03] slim at inbox dot lv Description: ------------ php segfaults randomly on heavy imap_reopen usage with 7.x branches. From phpng-upgrading docs it looks like on failed mail_open() streamind should be closed, not deleted ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76618&edit=1

« previous php.bugs (#216353) next »