Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined offset: 0 #127

Open
Chofoteddy opened this issue May 1, 2020 · 3 comments
Open

Undefined offset: 0 #127

Chofoteddy opened this issue May 1, 2020 · 3 comments

Comments

@Chofoteddy
Copy link

Chofoteddy commented May 1, 2020

What happen?

The list for cachegrind files is empty, even when there are files under the path shown in the page served by webgrind.

empty list

$ ls -l /private/tmp/cachegrid
total 183800
-rw-r--r--  1 chofoteddy  wheel   3097203 May  1 15:44 cachegrind.out.10829
-rw-r--r--  1 chofoteddy  wheel   3097417 May  1 15:44 cachegrind.out.10829.05a205
-rw-r--r--  1 chofoteddy  wheel       520 May  1 15:44 cachegrind.out.10829.061506
-rw-r--r--  1 chofoteddy  wheel       520 May  1 15:44 cachegrind.out.10829.08e0fc
-rw-r--r--  1 chofoteddy  wheel   3097033 May  1 15:44 cachegrind.out.10830
-rw-r--r--  1 chofoteddy  wheel   3095246 May  1 15:44 cachegrind.out.10830.0002e8
-rw-r--r--  1 chofoteddy  wheel   3803660 May  1 15:44 cachegrind.out.10830.019814
-rw-r--r--  1 chofoteddy  wheel       520 May  1 15:44 cachegrind.out.10830.074b2e
-rw-r--r--  1 chofoteddy  wheel   3097247 May  1 15:44 cachegrind.out.10830.077da9
-rw-r--r--  1 chofoteddy  wheel       520 May  1 15:44 cachegrind.out.10830.092476
-rw-r--r--  1 chofoteddy  wheel       520 May  1 15:44 cachegrind.out.10830.0aa128
-rw-r--r--  1 chofoteddy  wheel       520 May  1 15:44 cachegrind.out.10830.0cb162
-rw-r--r--  1 chofoteddy  wheel  22579326 May  1 15:44 cachegrind.out.10830.0e07a6
-rw-r--r--  1 chofoteddy  wheel       520 May  1 15:44 cachegrind.out.10830.0e9a67
-rw-r--r--  1 chofoteddy  wheel   3096110 May  1 15:44 cachegrind.out.10831
-rw-r--r--  1 chofoteddy  wheel   3145366 May  1 15:44 cachegrind.out.10831.029477
…

Console details:

$ composer serve
> php -S 0.0.0.0:8080 index.php
[Fri May  1 15:42:29 2020] 127.0.0.1:62991 [200]: /styles/style.css
[Fri May  1 15:42:29 2020] 127.0.0.1:62997 [200]: /styles/custom.css
[Fri May  1 15:42:29 2020] 127.0.0.1:63005 [200]: /js/jquery.tablesorter.js
[Fri May  1 15:42:29 2020] 127.0.0.1:63007 [200]: /js/jquery.selectboxes.js
[Fri May  1 15:42:29 2020] 127.0.0.1:63001 [200]: /js/jquery.js
[Fri May  1 15:42:29 2020] 127.0.0.1:63003 [200]: /js/jquery.blockUI.js
[Fri May  1 15:42:29 2020] 127.0.0.1:63009 [200]: /js/sprintf.js
[Fri May  1 15:42:29 2020] 127.0.0.1:63024 [200]: /img/reload.png
[Fri May  1 15:42:29 2020] 127.0.0.1:63028 [200]: /img/head.png
[Fri May  1 15:42:29 2020] 127.0.0.1:63038 [200]: /favicon.ico
[Fri May  1 15:42:48 2020] 127.0.0.1:63129 [200]: /styles/style.css
[Fri May  1 15:42:48 2020] 127.0.0.1:63133 [200]: /styles/custom.css
[Fri May  1 15:42:48 2020] 127.0.0.1:63139 [200]: /js/jquery.blockUI.js
[Fri May  1 15:42:48 2020] 127.0.0.1:63141 [200]: /js/jquery.tablesorter.js
[Fri May  1 15:42:48 2020] 127.0.0.1:63137 [200]: /js/jquery.js
[Fri May  1 15:42:48 2020] 127.0.0.1:63143 [200]: /js/jquery.selectboxes.js
[Fri May  1 15:42:48 2020] 127.0.0.1:63145 [200]: /js/sprintf.js
[Fri May  1 15:42:48 2020] 127.0.0.1:63159 [200]: /img/reload.png
[Fri May  1 15:42:48 2020] 127.0.0.1:63163 [200]: /img/head.png
[Fri May  1 15:42:48 2020] 127.0.0.1:63167 [200]: /favicon.ico
[Fri May  1 15:42:49 2020] 127.0.0.1:63183 [200]: /styles/style.css
[Fri May  1 15:42:49 2020] 127.0.0.1:63187 [200]: /styles/custom.css
[Fri May  1 15:42:49 2020] 127.0.0.1:63199 [200]: /js/sprintf.js
[Fri May  1 15:42:49 2020] 127.0.0.1:63195 [200]: /js/jquery.tablesorter.js
[Fri May  1 15:42:49 2020] 127.0.0.1:63197 [200]: /js/jquery.selectboxes.js
[Fri May  1 15:42:49 2020] 127.0.0.1:63191 [200]: /js/jquery.js
[Fri May  1 15:42:49 2020] 127.0.0.1:63193 [200]: /js/jquery.blockUI.js
[Fri May  1 15:42:49 2020] 127.0.0.1:63213 [200]: /img/reload.png
[Fri May  1 15:42:49 2020] 127.0.0.1:63217 [200]: /img/head.png
[Fri May  1 15:42:49 2020] 127.0.0.1:63221 [200]: /favicon.ico
[Fri May  1 15:42:50 2020] 127.0.0.1:63237 [200]: /styles/style.css
[Fri May  1 15:42:50 2020] 127.0.0.1:63241 [200]: /styles/custom.css
[Fri May  1 15:42:50 2020] 127.0.0.1:63247 [200]: /js/jquery.blockUI.js
[Fri May  1 15:42:50 2020] 127.0.0.1:63249 [200]: /js/jquery.tablesorter.js
[Fri May  1 15:42:50 2020] 127.0.0.1:63245 [200]: /js/jquery.js
[Fri May  1 15:42:50 2020] 127.0.0.1:63251 [200]: /js/jquery.selectboxes.js
[Fri May  1 15:42:50 2020] 127.0.0.1:63253 [200]: /js/sprintf.js
[Fri May  1 15:42:50 2020] 127.0.0.1:63267 [200]: /img/reload.png
[Fri May  1 15:42:50 2020] 127.0.0.1:63271 [200]: /img/head.png
[Fri May  1 15:42:50 2020] 127.0.0.1:63275 [200]: /favicon.ico
[Fri May  1 15:42:55 2020] 127.0.0.1:63305 [200]: /styles/style.css
[Fri May  1 15:42:55 2020] 127.0.0.1:63307 [200]: /styles/custom.css
[Fri May  1 15:42:56 2020] 127.0.0.1:63319 [200]: /styles/style.css
[Fri May  1 15:42:56 2020] 127.0.0.1:63324 [200]: /styles/custom.css
[Fri May  1 15:42:56 2020] 127.0.0.1:63325 [200]: /js/jquery.js
[Fri May  1 15:42:56 2020] 127.0.0.1:63328 [200]: /js/jquery.blockUI.js
[Fri May  1 15:42:56 2020] 127.0.0.1:63330 [200]: /js/jquery.tablesorter.js
[Fri May  1 15:42:57 2020] 127.0.0.1:63333 [200]: /js/jquery.selectboxes.js
[Fri May  1 15:42:57 2020] 127.0.0.1:63339 [200]: /js/sprintf.js
[Fri May  1 15:42:57 2020] 127.0.0.1:63349 [200]: /img/reload.png
[Fri May  1 15:42:57 2020] 127.0.0.1:63353 [200]: /img/head.png
[Fri May  1 15:42:57 2020] 127.0.0.1:63363 [200]: /favicon.ico
[Fri May  1 15:43:13 2020] PHP Notice:  Undefined offset: 0 in /Users/user/Downloads/webgrind-master/index.php on line 41
[Fri May  1 15:43:13 2020] PHP Stack trace:
[Fri May  1 15:43:13 2020] PHP   1. {main}() /Users/user/Downloads/webgrind-master/index.php:0
ld: warning: option -s is obsolete and being ignored
[Fri May  1 15:43:18 2020] PHP Warning:  fread(): Length parameter must be greater than 0 in /Users/user/Downloads/webgrind-master/library/Reader.php on line 247
[Fri May  1 15:43:18 2020] PHP Stack trace:
[Fri May  1 15:43:18 2020] PHP   1. {main}() /Users/user/Downloads/webgrind-master/index.php:0
[Fri May  1 15:43:18 2020] PHP   2. Webgrind_FileHandler->getTraceReader() /Users/user/Downloads/webgrind-master/index.php:43
[Fri May  1 15:43:18 2020] PHP   3. Webgrind_Reader->__construct() /Users/user/Downloads/webgrind-master/library/FileHandler.php:169
[Fri May  1 15:43:18 2020] PHP   4. Webgrind_Reader->init() /Users/user/Downloads/webgrind-master/library/Reader.php:76
[Fri May  1 15:43:18 2020] PHP   5. Webgrind_Reader->read() /Users/user/Downloads/webgrind-master/library/Reader.php:91
[Fri May  1 15:43:18 2020] PHP   6. fread() /Users/user/Downloads/webgrind-master/library/Reader.php:247

HTTP details (HAR file):
webgrind-2020-05-01.har.txt

Env details:

PHP 7.3.17 (cli) (built: May  1 2020 13:41:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.17, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans
    with Zend OPcache v7.3.17, Copyright (c) 1999-2018, by Zend Technologies
@Chofoteddy
Copy link
Author

Chofoteddy commented May 2, 2020

This issue seems related to #6.

@DieterHolvoet
Copy link

Having the same issue, maybe the format of cachegrind files changed? If you want I can send you an example file.

@alpha0010
Copy link
Collaborator

I can attempt to take a look soon. It would be helpful if you could provide:

  • Any warnings/errors from logs (e.g. apache, php, etc.)
  • PHP version
  • Xdebug version
  • OS version
  • Cachegrind file with this problem (ideally produced from a minimal script, e.g. two or three functions and a print)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants