|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-10-15 19:00 UTC] greubel at nkey dot de
Description:
------------
While creating an instance of Zend_Mail_Storage_Pop3 using an username and NO password, the Apache Connection was ended. In error log and windows event log the message appears, that the child has exited.
Reproduce code:
---------------
$storage = new Zend_Mail_Storage_Pop3(array(
'host' => $mailbox->incomingServer,
'user' => $mailbox->loginName,
'password' => $mailbox->loginPasswd == null ? '' : $mailbox->loginPasswd
));
Expected result:
----------------
A error or exception that the connection to remote host could not be established
Actual result:
--------------
Apache Child crash:
[Thu Oct 15 20:43:11 2009] [notice] Parent: child process exited with status 255 -- Restarting.
[Thu Oct 15 20:43:11 2009] [notice] Apache/2.2.14 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Thu Oct 15 20:43:11 2009] [notice] Server built: Sep 28 2009 22:41:08
Windows event log XML output:
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2009-10-15T18:43:08.000Z" />
<EventRecordID>1685</EventRecordID>
<Channel>Application</Channel>
<Computer>Callipso</Computer>
<Security />
</System>
- <EventData>
<Data>httpd.exe</Data>
<Data>2.2.14.0</Data>
<Data>4ac181d6</Data>
<Data>php5ts.dll</Data>
<Data>5.3.0.0</Data>
<Data>4a4922e7</Data>
<Data>c0000005</Data>
<Data>00083381</Data>
<Data>d44</Data>
<Data>01ca4dc6c4770430</Data>
</EventData>
</Event>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 16:00:01 2025 UTC |
<?php require 'Zend/Mail/Storage/Pop3.php'; try { $acc = new Zend_Mail_Storage_Pop3( array( 'host' => 'pop.gmx.de', 'user' => 'someone@gmx.de', 'password' => '' ) ); } catch(Exception $e) { echo $e->getMessage(); echo "<pre>"; echo $e->getTraceAsString(); echo "</pre>"; } ?>I tried to find the source of the problem. If the Zend_Mail_Protocol_Pop3 is used as class to create a communication object, an exception is thrown instead of crash. Used code: <?php require 'Zend/Mail/Protocol/Pop3.php'; try { $acc = new Zend_Mail_Protocol_Pop3(); $acc->connect('pop.gmx.de'); $acc->login('someone@gmx.de', ''); } catch(Exception $e) { echo $e->getMessage(); echo "<pre>"; echo $e->getTraceAsString(); echo "</pre>"; } ?> The crashing method in Zend_Mail_Storage_Pop3 seems to be the Zend_Mail_Protocol_Pop3::login() method call in the constructor.Please close. I'm not able to reproduce the problem with a small script. I tried to strip down the code from ZF to provide the same functionality but provoke the bug. This seems to be not possible on this circumstances. This code works well: <?php class foo { private $sock; private $errno; private $error; public function __construct() { $this->sock = fsockopen('pop.gmx.net', 110, $this->errno, $this->error); $r = fgets($this->sock); echo "$r<br/>"; fputs($this->sock, "USER mike.greubel@gmx.de\r\n"); $r = fgets($this->sock); echo "$r<br/>"; fputs($this->sock, "PASS \r\n"); $r = fgets($this->sock); echo "$r<br/>"; fputs($this->sock, "QUIT\r\n"); $r = fgets($this->sock); echo "$r<br/>"; } public function close() { fclose($this->sock); $this->sock = null; } } $bar = new foo(); $bar->close(); ?> So please close.The bug occurs when exception is caught in destructor during another exception processing Reproduce code: --------------- <?php class A { function __destruct() { try { throw new Exception("2"); } catch (Exception $e) { echo $e->getMessage() . "\n"; } } } class B { function __construct() { $this->a = new A(); throw new Exception("1"); } } try { $b = new B(); } catch(Exception $e) { echo $e->getMessage() . "\n";; } ?> Expected result: ---------------- 2 1 Actual result: -------------- 2 valgrind -------- ==26823== Invalid read of size 4 ==26823== at 0x856480A: ZEND_ASSIGN_SPEC_CV_VAR_HANDLER (zend.h:385) ==26823== by 0x84D7B98: execute (zend_vm_execute.h:104) ==26823== by 0x84ACA44: zend_execute_scripts (zend.c:1194) ==26823== by 0x844186E: php_execute_script (main.c:2260) ==26823== by 0x8572CDE: main (php_cli.c:1192) ==26823== Address 0x51f1428 is 8 bytes inside a block of size 20 free'd ==26823== at 0x4B8C90A: free (vg_replace_malloc.c:323) ==26823== by 0x848B079: _efree (zend_alloc.c:2348) ==26823== by 0x849C3E3: _zval_ptr_dtor (zend_execute_API.c:444) ==26823== by 0x84D8156: zend_leave_helper_SPEC (zend_vm_execute.h:226) ==26823== by 0x84DA521: ZEND_HANDLE_EXCEPTION_SPEC_HANDLER (zend_vm_execute.h:680) ==26823== by 0x84D7B98: execute (zend_vm_execute.h:104) ==26823== by 0x84ACA44: zend_execute_scripts (zend.c:1194) ==26823== by 0x844186E: php_execute_script (main.c:2260) ==26823== by 0x8572CDE: main (php_cli.c:1192)