php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48566 set_exception_handler doesn't catch an exception created by imap_fetchstructure
Submitted: 2009-06-16 07:47 UTC Modified: 2009-08-12 01:00 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: e dot mortoray at ecircle dot com Assigned: jani (profile)
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.2.9 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: e dot mortoray at ecircle dot com
New email:
PHP Version: OS:

 

 [2009-06-16 07:47 UTC] e dot mortoray at ecircle dot com
Description:
------------
If imap_fetchstructure encounters a message which contains an invalid sequence in a header field it somehow creates a deferred exception which is thrown on exit and is *not* caught by the handler defined in set_exception_handler.

I have not been able to produce an exact reproduction but I can confirm:
-the global exception handler is normally working
-it is something that imap_fetchstructure is doing -- if I remove this line it doesn't happen
--furthermore, it only seems to happen if one of the headers in the email has an invalid sequence: no encoding specified and contains a non-ascii character -- one which doesn't appear to be a valid latin1 character either


Expected result:
----------------
I'm not expecting any exception to be thrown, but if one is (due to a class destructor exception) I'd expect it to be caught by the default exception handler.

Actual result:
--------------
Just before PHP exits (after the script is finished) the following error:

error_handler(): [8] Unknown: Missing parameter (errflg=3) in Unknown at line 0

Fatal error: Exception thrown without a stack frame in Unknown on line 0



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-04 16:36 UTC] jani@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2009-08-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 17:01:30 2025 UTC