php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60074 Stack trace truncated for long paths
Submitted: 2011-10-16 22:44 UTC Modified: 2011-10-19 07:04 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tyrael@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.4.0beta1 OS:
Private report: No CVE-ID: None
 [2011-10-16 22:44 UTC] tyrael@php.net
Description:
------------
running the test script(via php -n -f test.php) in my home directory gives me:

Fatal error: Uncaught exception 'Exception' with message 'Foo' in 
/home/tyrael/test.php:8
Stack trace:
#0 /home/tyrael/test.php(4): b()
#1 /home/tyrael/test.php(11): a()
#2 {main}
  thrown in /home/tyrael/test.php on line 8

running the same script in a directory with a long path gives me:

Fatal error: Uncaught exception 'Exception' with message 'Foo' in 
/home/tyrael/12345678901234567890123456789012345678901234567890/1234567890123456
7890123456789012345678901234567890/123456789012345678901234567890123456789012345
67890/12345678901234567890123456789012345678901234567890/12345678901234567890123
456789012345678901234567890/12345678901234567890123456789012345678901234567890/1
2345678901234567890123456789012345678901234567890/123456789012345678901234567890
12345678901234567890/foo/12345678901234567890123456789012345678901234567890/1234
5678901234567890123456789012345678901234567890/123456789012345678901234567890123
45678901234567890/12345678901234567890123456789012345678901234567890/12345678901
234567890123456789012345678901234567890/1234567890123456789012345678901234567890
1234567890/12345678901234567890123456789012345678901234567890/123456789012345678
90123456789012345678901234567890/12345678901234567890123456789012345678901234567
890/12345678901234567890123456789012345678901234567890/1234567890123456789012345
67890123456 in 
/home/tyrael/12345678901234567890123456789012345678901234567890/1234567890123456
7890123456789012345678901234567890/123456789012345678901234567890123456789012345
67890/12345678901234567890123456789012345678901234567890/12345678901234567890123
456789012345678901234567890/12345678901234567890123456789012345678901234567890/1
2345678901234567890123456789012345678901234567890/123456789012345678901234567890
12345678901234567890/foo/12345678901234567890123456789012345678901234567890/1234
5678901234567890123456789012345678901234567890/123456789012345678901234567890123
45678901234567890/12345678901234567890123456789012345678901234567890/12345678901
234567890123456789012345678901234567890/1234567890123456789012345678901234567890
1234567890/12345678901234567890123456789012345678901234567890/123456789012345678
90123456789012345678901234567890/12345678901234567890123456789012345678901234567
890/12345678901234567890123456789012345678901234567890/1234567890123456789012345
6789012345678901234567890/12345678901234567890123456789012345678901234567890/123
45678901234567890123456789012345678901234567890/12345678901234567890123456789012
345678901234567890/12345678901234567890123456789012345678901234567890/1234567890
1234567890123456789012345678901234567890/123456789012345678901234567890123456789
01234567890/12345678901234567890123456789012345678901234567890/test.php on line 
8

As you can see, the output doesn't contain the Stack trace anymore.

Test script:
---------------
// create a directory with a long path and run this script from that directory 

<?php

function a(){
        b();
}

function b(){
        throw new Exception("Foo");
}

a();


Expected result:
----------------
it should contain the full stack trace

Actual result:
--------------
the stack trace gets truncated

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-18 23:03 UTC] felipe@php.net
-Status: Open +Status: Bogus
 [2011-10-18 23:03 UTC] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You have to change the log_errors_max_len INI entry. (defaults to 1024)
 [2011-10-19 03:00 UTC] anon at anon dot anon
When would you ever need a thousand character path, honestly?!
 [2011-10-19 07:07 UTC] tyrael@php.net
"When would you ever need a thousand character path, honestly?!"
the problem is reproducible with a much shorter path, as Felipe pointed out the 
log_errors_max_len defaults to 1024, so you can easily bump into this either with 
a moderately long path, or with a long error/stack trace.
I purposely used a very long path in my report to point out that it is possible to 
completely truncate the stack trace.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 02:01:30 2024 UTC