Edit report at https://bugs.php.net/bug.php?id=64924&edit=1

 ID:                 64924
 Comment by:         andrew_lz at poczta dot fm
 Reported by:        matteosistisette at gmail dot com
 Summary:            500 internal server error caused by PHP  but nothing
                      logged  in error log
 Status:             Not a bug
 Type:               Bug
 Package:            *Web Server problem
 Operating System:   ubuntu 12.10
 PHP Version:        5.4.15
 Block user comment: N
 Private report:     N

 New Comment:

I have similar situation caused by Error Control Operator (@). If you have 2 
scripts e.g. a.php and b.php. b.php will generate fatal error (in my case non 
existing required file). If you include b.php in a.php using error control 
operator (@include 'b.php';) a.php will fail and trace will not be saved to log 
file.

a.php:
<?php
echo "Script A";
@include 'b.php';

b.php:
<?php
require 'not_existing_file.php';
echo "Script B";


Previous Comments:
------------------------------------------------------------------------
[2013-06-01 15:26:42] matteosistisette at gmail dot com

Why hasn't this been reopened yet?

------------------------------------------------------------------------
[2013-05-27 15:11:42] matteosistisette at gmail dot com

However, the isolated string offset error alone does not trigger the crash, it 
gets stack-traced correctly by my error handler.

The same error inside a stack of method calls triggers the issue. Unfortunately 
I 
haven't been able to isolate a minimal code that will let you reproduce the 
issue, I do can reproduce it 100% systematically but with complex code + 
database 
and complicated sequence of steps of which I have no idea what is relevant to 
the 
issue.

------------------------------------------------------------------------
[2013-05-27 15:07:50] matteosistisette at gmail dot com

I'll try to post the error handler replacing the [at] character with [at] (you 
get what I mean), let's see if that is what bothers the antispam...


set_error_handler(function($errno, $errstr, $errfile, $errline){
    http_response_code(500);
    header("Content-Type: text/plain");
    $backtrace=debug_backtrace();
    $output="$errstr \n [at] $errfile($errline)\n";
    foreach ($backtrace as $i=>$item) {
        if ($i>0) $output.= "#$i. [at] ".$item['file']."
(".$item['line']."): ".(isset($item['class'])?
$item['class']:'')."::".$item['function']."(".(is_array($item['args'])?
[at]implode(",",$item['args']):'').")\n";
    }
    die($output);
});

------------------------------------------------------------------------
[2013-05-27 14:50:28] matteosistisette at gmail dot com

And you definitely do need to see it before you can say what you are saying

------------------------------------------------------------------------
[2013-05-27 14:49:14] matteosistisette at gmail dot com

No man, my error hanler sends a 500 AND prints a stack trace.
I've had thousands of errors in my code before, and my error handler correctly 
printed a stack trace.

And if there was an error in my error handler, then the PHP error should be 
normally logged in the error_log. NOTHING is logged in the error_log, that 
seems 
to indicate PHP is crashing.
No matter how bad is my error handler, if it crashes PHP there's a bug in PHP

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=64924


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

Reply via email to