Giter Site home page Giter Site logo

Comments (12)

SagnikGanguly96 avatar SagnikGanguly96 commented on May 28, 2024 1

@ricardoboss, I've manually gone through all the related files of the 'Webgrind' library to find out the exact cause and I found the error I've already mentioned in my first comment then to solve the above problem I found that actually webgrind doesn't extract the compressed XDebug profiles to parse, instead, it parses only raw XDebug profiles. So the problem could be solved by just disabling compression (in my case) which could be done using xdebug.use_compression = false.
And here's my 99-xdebug.ini configured for profiling:

zend_extension = xdebug
;xdebug.mode = develop
xdebug.mode = profile
xdebug.output_dir = "E:/php/common/tmp/XDebug/Profile"
xdebug.profiler_enable = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.use_compression  = false
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.show_local_vars = 1

from webgrind.

scottchiefbaker avatar scottchiefbaker commented on May 28, 2024 1

I'm new to Webgrind and I just ran in to this issue as well. I thought I was going crazy, as you get no error it just doesn't work.

I can confirm this is fixed on master.

from webgrind.

csandanov avatar csandanov commented on May 28, 2024 1

Hi, would it be possible to release a tag with the compression support? Thank you!

from webgrind.

ricardoboss avatar ricardoboss commented on May 28, 2024

Same with the current docker image:

<br />
<b>Warning</b>:  fread(): Length parameter must be greater than 0 in <b>/var/www/html/library/Reader.php</b> on line <b>247</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /var/www/html/library/Reader.php:247) in <b>/var/www/html/index.php</b> on line <b>243</b><br />
...json stuf...

from webgrind.

alpha0010 avatar alpha0010 commented on May 28, 2024

Could you provide a cachegrind file that that triggers this error?

from webgrind.

SagnikGanguly96 avatar SagnikGanguly96 commented on May 28, 2024

Hi @ricardoboss, @alpha0010, I would like to inform you that I've solved the problem. I'm sorry I forgot to inform the same hereafter opening the issue.

from webgrind.

alpha0010 avatar alpha0010 commented on May 28, 2024

Thanks for the update.

Compression support already in master; I forgot to tag a release for it... will do so soon.

from webgrind.

danielbeardsley avatar danielbeardsley commented on May 28, 2024

I'm running master and am still getting this error. I'll happily provide a cachegrind file. Send a message to my public email address.

from webgrind.

scottchiefbaker avatar scottchiefbaker commented on May 28, 2024

@danielbeardsley don't put the burden on the developers to contact you. Just attach the file here.

from webgrind.

danielbeardsley avatar danielbeardsley commented on May 28, 2024

Just attach the file here.

TIL you can attach arbitrary files to github comments :-) I prompted for the email cause @alpha0010 didn't have an email address on their account.

Here's one
cachegrind.out.2941563.gz

From the following command:

XDEBUG_PROFILE=1 php -d "xdebug.use_compression=1" -d "xdebug.mode=profile" -d "xdebug.profile=1" -r "function test() {echo 'test';} test();"
 PHP Fatal error:  Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /mnt/ebs/var/www/ifixit/pub/Misc/webgrind/library/Reader.php:255
 Stack trace:
 #0 /mnt/ebs/var/www/ifixit/pub/Misc/webgrind/library/Reader.php(255): fread(Resource id #594, 0)
 #1 /mnt/ebs/var/www/ifixit/pub/Misc/webgrind/library/Reader.php(91): Webgrind_Reader->read(0)
 #2 /mnt/ebs/var/www/ifixit/pub/Misc/webgrind/library/Reader.php(76): Webgrind_Reader->init()
 #3 /mnt/ebs/var/www/ifixit/pub/Misc/webgrind/library/FileHandler.php(165): Webgrind_Reader->__construct('/tmp/cachegrind...', 'usec')
 #4 /mnt/ebs/var/www/ifixit/pub/Misc/webgrind/index.php(43): Webgrind_FileHandler->getTraceReader('cachegrind.out....', 'usec')
 #5 {main}
   thrown in /mnt/ebs/var/www/ifixit/pub/Misc/webgrind/library/Reader.php on line 255

I get this on the most recent master.

from webgrind.

SagnikGanguly96 avatar SagnikGanguly96 commented on May 28, 2024

@danielbeardsley, Turn off the compression by changing the following xdebug.use_compression=1 to xdebug.use_compression=0. It should solve the issue.

from webgrind.

danielbeardsley avatar danielbeardsley commented on May 28, 2024

Turn off the compression

Yes, I'm aware that the bug is in the support of compressed profiles and that not using compression doesn't expose the bug. The point of this issue is that compression support is not finished and seemingly still doesn't work on master.

from webgrind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.