View Issue Details

IDProjectCategoryView StatusLast Update
0002069XdebugProfilingpublic2022-04-04 11:32
Reporternickc Assigned Toderick  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version3.1.3 
Target Version3.1devFixed in Version3.1.4 
Summary0002069: Warn when profiler_append is used together with zlib compression
Description

Original title: "Cant use files produced with xdebug.profiler_append = 1"

Each page load for my wordpress site generates 8-10 files, mostly attributable to ajax requests. I was disappointed to find that xdebug.profiler_aggregate was deprecated, but tried to use "xdebug.profiler_append = 1" along with a generic filename in order to join together all of the files into one.

However, I cannot uncompress the file. Similarly, if I use "xdebug.use_compression = 0", qcachegrind cannot open the file - it just crashes.

It is entirely possible that this isn't a bug, but just a technical limitation - perhaps profiler files from different types of page requests can't be appended? Is there something else that I might be doing wrong?

Steps To Reproduce

zend_extension = xdebug
xdebug.mode = debug, develop, profile
xdebug.start_with_request = trigger
xdebug.client_port = 9003
xdebug.trigger_value = triggervalue
xdebug.profiler_output_name = cachegrind.out.%H
xdebug.profiler_append = 1
xdebug.use_compression = 1 (or 0 for testing)

Use Chrome xdebug helper extension to trigger profiler.
Load a page
Turn off profiler
Try to uncompress file (or open the already uncompressed version).

Additional Information

I'm using xdebug 3.1.3, but the product version dropdown only allows up to 3.1.2

TagsNo tags attached.
Operating System
PHP Version7.4.20-7.4.29

Activities

nickc

2022-03-03 01:50

reporter   ~0006226

I just manually combined the separate files and the file loads just fine in qcachegrind. However, they show up in different tabs, so I then removed the header lines from each and the show as one tab/page load.

But I'd rather not have to do that, so hopefully there's a way to fix how xdebug generates the aggregated/appended file!

derick

2022-03-07 16:12

administrator   ~0006233

I think there are two issues here:

  1. You can't use xdebug.profiler_append with compressed files. A compressed file can only really exist as a unitary unit, and wouldn't allow for appending. For the same reason you can't just append two .gz files and expect that to work.
  2. There is no way to have a single profile from multiple requests. The original "profiler_aggregate" from Xdebug 2 did that, but it never really worked well, and also wasn't working as well as it should be. Reintroducing that could be part of my effort to rewrite the profiler (0002072, just created)

I will re-style this issue to address point 1 above, to disable compression when xdebug.profiler_append is set to 1, and do that as a bug fix for the 3.1.x series.

Does that work?

cheers,
Derick

nickc

2022-03-07 23:15

reporter   ~0006235

  1. That makes complete sense.
  2. How is profiler_append supposed work, if you can't have a single profile from multiple requests? Perhaps you could add a bit more colour in the documentation for the setting?

I look forward to seeing what you come up with for the profiler rewrite!

Thanks so much for such an incredible tool - I only started web development 9 months ago and having xdebug for the past few months has made an incredible difference in my ability to learn and develop. I can't fathom how anyone has ever worked without it.

derick

2022-03-09 18:14

administrator   ~0006239

I've added a warning, with a fallback to uncompressed files, for Xdebug 3.1.x.

derick

2022-03-11 17:54

administrator   ~0006241

I have now also documented this on the website through https://github.com/xdebug/xdebug.org/commit/47a9e25999a6320c108b4d6bb5716f5218e89126 : https://xdebug.org/docs/errors#CFG-W-ZLIB-A

Issue History

Date Modified Username Field Change
2022-03-03 00:54 nickc New Issue
2022-03-03 01:50 nickc Note Added: 0006226
2022-03-07 15:52 derick Product Version 3.1.2 => 3.1.3
2022-03-07 16:12 derick Assigned To => derick
2022-03-07 16:12 derick Status new => feedback
2022-03-07 16:12 derick Note Added: 0006233
2022-03-07 23:15 nickc Note Added: 0006235
2022-03-07 23:15 nickc Status feedback => assigned
2022-03-09 17:47 derick Target Version => 3.1dev
2022-03-09 17:47 derick Summary Cant use files produced with xdebug.profiler_append = 1 => Warn when profiler_append is used together with zlib compression
2022-03-09 17:47 derick Description Updated
2022-03-09 18:14 derick Status assigned => closed
2022-03-09 18:14 derick Resolution open => fixed
2022-03-09 18:14 derick Fixed in Version => 3.1dev
2022-03-09 18:14 derick Note Added: 0006239
2022-03-11 17:54 derick Note Added: 0006241
2022-04-04 11:32 derick Fixed in Version 3.1dev => 3.1.4