Wow!! That is amazing! :)
I was thinking the other day while trying to debug node_teaser that a tree graph of the functions would make it much easier to understand when and how node_teaser() is called.
I'm running;
- Mac OS X 10.4.10 (I have leopard on my desk though)
- XDEBUG 2.0.0 RC4-dev (as distributed with Komodo IDE 4.something (a few months old))
- MAMP 1.6.1
- apache 2.something
- php 5.2.1
- the most recent versions of zgrviewer and GraphViz.app for mac
- drupal 5.3 (no other modules)
- visualize_backtrace 5.x-1.1
(Wow!! Isn't floss great!)
I got everything working, thanks to your detailed instructions, except for opening the .dot files in zgrviewer. I copied the command line on the page with the table into terminal and got this;
Bevans-MacBook:~ bevan$ /usr/local/bin/zgrviewer/run.sh --Pdot /Users/bevan/Sites/drupal5/files/1193373030_section0.dot
Exception in thread "main" java.lang.NoClassDefFoundError: net/claribole/zgrviewer/ZGRViewerAny ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | screenshot_46.png | 16.66 KB | Bevan |
Comments
Comment #1
KentBye commentedWell unfortunately I'm not a java expert, and I'm not sure if I ever ran across this error.
You can try reading here: http://www.nabble.com/help-needed-t4558833.html
Another thing you might want to try is to cd to /usr/local/bin/zgrviewer -- and then try to do a ./run.sh to see if you can even open up the ZGRViewer.
There may be something you need to initialize.
One final thought is that you may want to try plotting section 1 -- section 0 is the full trace and sometimes it has trouble loading if it is too big and so it's better to start smaller.
Good to hear you've got it mostly set up tho. Follow up here if you got it working. Thanks.
Comment #2
Bevan commented> You can try reading here: http://www.nabble.com/help-needed-t4558833.html
Don't have time right now. Thanks for the reference though.
> Another thing you might want to try is to cd to /usr/local/bin/zgrviewer -- and then try to do a ./run.sh to see if you can even open up the ZGRViewer.
> There may be something you need to initialize.
I did that already as per your INSTALL.txt. ZGRviewer starts fine but with a blank page -- see the screenshot.
> One final thought is that you may want to try plotting section 1 -- section 0 is the full trace and sometimes it has trouble loading if it is too big and so it's better to start smaller.
Same issue.
Comment #3
KentBye commentedWell, the ZGRViewer defaults to a blank screen when you open it with ./run.sh
I guess I should've been more clear with how to actually open one of the *.dot files that is generated.
After you open up ZGRViewer and see the white screen, then try going to:
File -> Open -> Open with dot... -> DOT pipeline (experimental)...
And then browse to your /files location -- in your case /Users/bevan/Sites/drupal5/files/
and then select 1193373030_section1.dot
You will have already needed to have entered in the location of the GraphViz libraries as described in the INSTALL.txt.
Let me know if you can view it this way.
A less desirable alternative is to use PixelGlow's GraphViz to open up the *.dot files, but it is a lot more difficult to pan and zoom and doesn't link back to the line of source code like the ZGRViewer can.
Comment #4
Bevan commentedThat worked! :)
Great! That means I have everything working except automatic opening of tree graphs in ZGRviewer from drupal. However as it's rare that I want to do that, this is a working alternative. The table in drupal provies all this information already just in a less human-friendly form -- right?
Thanks!
Comment #5
KentBye commentedYes, the table format contains all of the same information, but yeah, it is more difficult to quickly mentally parse it.
You can however search it if you know the function or filename of interest.
Glad to hear that you got it working, and I'll have to update the INSTALL.txt with this additional info on the workaround.
Comment #6
KentBye commentedIn future versions, I'll recommend people just copy and paste the command line code or open it up from the ZGRViewer.
I'm going to go ahead and close out this issue.
Comment #7
Bevan commentedI wonder why opening it on command line doesn't work for me. It's awfully convenient to be able to open these files from drupal directly...
Comment #8
teshager commentedHi there,
I've installed this package over the weekend and been trying to get it to work to no avail. Despite the creation of the xt file xtparsed turns out to be empty which in turn creates an empty .dot file :(
xtparsed only contains the following string
"Version: 2.1.0-dev"
I'm wondering if this information points out to xdebug being the 2.1 dev and cannot be parsed correctly by the latest Visualize Backtrace?
My package is the standard, Drupal 5.3, Komodo 4.2 with the most recent xdebug.so from activestate. I'm running all this locally on a Mac 10.5 release.
Before I venture out trying to debug the complex awk script inside the parser, was wondering if anyone has seen this? Also, anyone successful in building Xdebug 2.0 from source file on OSX 10.5 yet using gcc4.0.1?
Thanks much
/c4rider
Comment #9
KentBye commentedHey c4rider,
Thanks for downloading and trying out the module, and sorry that it's giving you troubles.
I created a specific issue and task for your problem as described here:
http://drupal.org/node/193709
Would you be willing to upload an unparsed trace file in that issue queue?
I'll take a look at it.
The awk command is also related to this Windows issue with more details there:
http://drupal.org/node/192391
Thanks again.
Comment #10
Bevan commentedI just upgraded to Komodo 4.2 and it still works fine, however I'm still using 4.1's XDEBUG (XDEBUG 2.0.0 RC4-dev). Maybe try that one and see if it works...
Comment #11
KentBye commentedConsolidating my response by pasting an excerpt from nadavoid from a duplicate issue so that I can answer it here:
Yes, that's one reason why it's not autolaunching from the browser. Launching from the terminal needs to work first.
It's good to know that you can manually open up the *.dot files after doing:
And I agree that it is annoying to not be able autolaunch it from either the command line or from the browser. Getting from the browser is an apache headache, but you should be able to do it from the terminal.
However, I'm no java expert, and I'm going to have to point you to the ZGRViewer mailing list for more help as to what is wrong:
http://sourceforge.net/mailarchive/forum.php?forum_name=zvtm-devel
You can search there. Search with google. And please report back here if you get it to autolaunch from the terminal to make it easier for others reading this thread in the future. :)
Comment #12
nadavoid commentedKent: thank you for the tips/links/suggestions. That got me on the right track. I can launch .dot files from the command line now. The only thing I had to change was...
edit /usr/local/bin/zgrviewer/run.sh
change this line:
ZGRV_HOME=.to this:
ZGRV_HOME=/usr/local/bin/zgrviewerNow, running this:
/usr/local/bin/zgrviewer/run.sh --Pdot /Users/david/Sites/drupal-5.2_2/files/16071_section0.dotresults in the ZGRViewer being launched with the .dot file loaded into it. woo hoo! I think I'm hot stuff now. But that opinion is not open for votes.
Now I'll see if I can get it to launch directly from drupal. Then I'll feel like a rock star. At least until I leave the office.
Comment #13
nadavoid commentedI set the user/group in httpd.conf to david/david and restarted apache. I've confirmed that PHP really is executing as david/david, in a phpinfo().
/usr/local/bin/zgrviewer and everything it contains is owned by david/david. (If you can't tell yet, my username on my computer is "david")
Launching from the command-line works, it's just not loading from drupal, when I click the links such as "Graph Main Section 3"
Is there a configuration inside drupal that I'm missing? Any other tips or tutorials that I just haven't found yet?
Comment #14
KentBye commentednadavoid,
yay! Great to hear that you at least go it to autolaunch from the terminal window.
Now unfortunately I myself am out of my league for getting it set up myself, but I was able to finally do it.
Well, it's an absolute must that you run it on localhost since it's a forked execute command, and so it's not going to work remotely.
I read through these links when I was setting it up, and tried enough suggestions that eventually one combination worked.
Read through these two threads:
http://us3.php.net/manual/en/function.shell-exec.php#37971
http://www.webhostingtalk.com/archive/index.php/t-386461.html
Some keywords to try are some combination of "shell_exec()" "php" "fork" "drupal" "java" -- maybe even drop a note to the ZGRViewer list serve, or ask on someon IRC channel -- possibly #ubuntu or #php
But I'm afraid that I can't be of much more help beyond that, but please report any success or failure for others.
I'll be updating the INSTALL.txt with FAQs down the road.
Comment #15
KentBye commented@nadavoid: Try this first -- do a
ls -lin the terminal window on all of the/usr/local/bin/zgrviewer/files and confirm that they are both owned and in the same group.I was reminded of this after reading through this thread again: http://www.webhostingtalk.com/archive/index.php/t-386461.html
It should say in your case
david davidand notdavid wheel.I believe you can change all of the zgrviewer files with:
$ sudo chown david:david *.*-- and then you may need to do it for each top-level directory.And it'd probably be smart to do a restart if that doesn't work off the bat.
So again, I believe the zgrviewer file permissions should look like this
Comment #16
Bevan commentedI wondered if you have considered using drush for the command-line integration? It might make some of these 'launch from drupal/php' headaches easier...
http://drupal.org/project/drush
Comment #17
nadavoid commentedI do have the zrgviewer file permissions correct: owner is david, group is david, on /usr/local/bin/zgrviewer and everything recursively inside it.
I just looked at the apache error log (can you believe I did that BEFORE someone suggested it!) and it shows this:
So, it looks to me like my particular problem is Java-related. I think apache/php is trying to execute the java app, but the java app is complaining.
KentBye: I'll do some searches using the keywords you suggested, and focus on the Java side. I'm on Leopard, so maybe that has something to do with it.
Thanks for all the help so far. I'll let you know if I get anything more worked out.
Comment #18
nadavoid commentedI finally found the answer. The short answer is:
in /usr/local/bin/zgrviewer/run.sh
add this line after ZRGV_HOME
DYLD_LIBRARY_PATH=
The problem was in fact an environment variable issue. PHP/Apache was setting DYLD_LIBRARY_PATH to a directory inside my MAMP installation. I read on another post that someone had this variable set in their system settings and it was causing the same sort of problem. so I tried unsetting it in run.sh, and it worked!
I was then bothered by the fact that the web page wouldn't load until I quit zgrviewer. a further tweak to run.sh fixed that...
before "java -cp ......" add "nohup" and at the end of that line add "&"
Here's my final run.sh
I'm really pumped about being able to dig around in the inner processes of Drupal now! Thanks so much for putting together this tool.
Comment #19
KentBye commentedNadavoid,
That's Great!
Some incredible debugging work there.
I'll have to point to this thread in the next INSTALL.txt
But I should need to put a USE IN THIS CONFIGURATION AT YOUR OWN RISK since you may be putting your localhost data at risk if there is a malicious or inadvertant shell_exec() command that tries to delete some of your data. So be cautious.
Also there are a couple of known bugs regarding the timing info and the full display of forwardtrace trees, and I'm working on some of them this weekend: http://drupal.org/project/issues/visualize_backtrace?categories=bug
I hope to get at least a dev release out after squashing some more bugs