IOException running PDFCallGraph example

258 views
Skip to first unread message

ASHISH MISHRA

unread,
Sep 24, 2012, 8:00:21 AM9/24/12
to wala-sourc...@googlegroups.com
Hi all,
I am new to the WALA,I got the code from the git repo and built it in eclipse,when I tried to run the example PDFCallGraph.java on the input JLEX.jar as instructed by the wiki page,I could get the number of nodes methods and other stats by CallGraphstats.getStats(cg).but twhen the code tries building the dot file and then the PDF the program throws an IOException.

I tried debugging the code and I could get the place where the exception occurs i am giving here the  output from my console window,it says -

Call graph stats:
  Nodes: 1344
  Edges: 3083
  Methods: 1274
  Bytecode Bytes: 80191

spawning process [-Tpdf, -o, /home/ashish/git/WALA/com.ibm.wala.core/results/cg.pdf, -v, /home/ashish/git/WALA/com.ibm.wala.core.tests/temp.dt]
java.io.IOException: Cannot run program "-Tpdf": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:466)
at com.ibm.wala.viz.DotUtil.spawnDot(DotUtil.java:100)
at com.ibm.wala.viz.DotUtil.dotify(DotUtil.java:88)
at com.ibm.wala.viz.DotUtil.dotify(DotUtil.java:79)
at com.ibm.wala.examples.drivers.PDFCallGraph.run(PDFCallGraph.java:124)
at com.ibm.wala.examples.drivers.PDFCallGraph.run(PDFCallGraph.java:101)
at com.ibm.wala.examples.drivers.PDFCallGraph.main(PDFCallGraph.java:88)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 8 more
com.ibm.wala.util.WalaException: IOException in class com.ibm.wala.viz.DotUtil
at com.ibm.wala.viz.DotUtil.spawnDot(DotUtil.java:133)
at com.ibm.wala.viz.DotUtil.dotify(DotUtil.java:88)
at com.ibm.wala.viz.DotUtil.dotify(DotUtil.java:79)
at com.ibm.wala.examples.drivers.PDFCallGraph.run(PDFCallGraph.java:124)
at com.ibm.wala.examples.drivers.PDFCallGraph.run(PDFCallGraph.java:101)
at com.ibm.wala.examples.drivers.PDFCallGraph.main(PDFCallGraph.java:88)

As far as I can understand the Unixprocess creatiion throws this exception when it is passed the argument -TPdf ,I am sorry if its something naive,but I have no idea why this error.

Thanks and Regards
Ashish

Pavan Kulkarni

unread,
Apr 7, 2013, 9:49:33 PM4/7/13
to wala-sourc...@googlegroups.com
Hi ashish,

 I am facing a similar problem where on executing PDFSlice I get a following error like " Error loading ..\..\slice.pdf". I checked permissions etc. all seems ok. Do you have any idea on how to solve this issue ? Thanks

Julian Dolby

unread,
Apr 8, 2013, 9:15:53 AM4/8/13
to WALA discussion and Q&A, wala-sourc...@googlegroups.com

Do you have the 'dot' program installed?  It looks like you have not specified the 'dot' executable for the system to find.  WalaExamplesProperties.DOT_EXE needs to be set.

-- Julian

Inactive hide details for Pavan Kulkarni ---04/08/2013 09:06:22 AM---Hi ashish,  I am facing a similar problem where on executiPavan Kulkarni ---04/08/2013 09:06:22 AM---Hi ashish,  I am facing a similar problem where on executing PDFSlice I get a


    From:

Pavan Kulkarni <pavan....@gmail.com>

    To:

wala-sourc...@googlegroups.com,

    Date:

04/08/2013 09:06 AM

    Subject:

Re: [Wala-wala] IOException running PDFCallGraph example

Pavan Kulkarni

unread,
Apr 8, 2013, 9:25:42 AM4/8/13
to WALA discussion and Q&A, wala-sourc...@googlegroups.com
Yes I have specified the dot executable path too.
--

--With Regards
Pavan Kulkarni
ecblank.gif
graycol.gif

Pavan Kulkarni

unread,
Apr 8, 2013, 2:47:33 PM4/8/13
to WALA discussion and Q&A, wala-sourc...@googlegroups.com
Julian,

  I have fixed most of the bugs, butam still facing with these issues.It would be really helpful if you could take a look.Thanks


The bugs I fixed were basically incompatibility between Eclipse versions.
Now I have a doubt on how exactly to run a slice program.

1.I have built the project etc but am not sure how to feed my program to the slicer.
There is no documentation anywhere on how to feed your own program to the PDF Slicer.
Is there a specific way in which a program has to be written to PDFSlicer to run its analysis. 
What kind of format should we use for our own test program : arguments for mainClass , srcCaller, srcCallee

Ex: When i fed my helloworld for analysis this is the error i got
Exception in thread "main" java.lang.IllegalArgumentException: Expected class name to start with L

After changing the name of the class to Lhellowrld, we got this error :
Exception in thread "main" com.ibm.wala.util.debug.UnimplementedError: could not resolve < Application, Lhellowrld, main([Ljava/lang/String;)V >

2. I have set the PDF and graphviz executables accordingly but I see an error  " Error on loading the ../../slice.pdf or cg.pdf.(Basically the pdf is created, but is not capable of being viewed)

 Am not sure what causes this problem. I checked permission on pdf and compatible versions of acrobat and graphviz but the problem still persists.
Any help is highly appreciated.
Thanks

graycol.gif
ecblank.gif

Manu Sridharan

unread,
Apr 8, 2013, 4:30:02 PM4/8/13
to WALA discussion and Q&A

Hi Pavan,

1. The instructions for how to run PDFSlice are in the javadoc for its main() method:

https://github.com/wala/WALA/blob/c20348e89e2da1ce415f0eb2df73ba59b51af517/com.ibm.wala.core.tests/src/com/ibm/wala/examples/drivers/PDFSlice.java#L80

Here are the command-line arguments used in the provided launcher, as an example:

-appJar ${workspace_loc}/com.ibm.wala.core.testdata/bin/com.ibm.wala.core.testdata_1.0.0.jar -mainClass "Lslice/Slice4" -srcCaller "main" -srcCallee "foo" -dd "no_base_no_heap" -cd "none" -dir "forward"

The code expects the mainClass to be specified in the JVM-style format, i.e., Lslice/Slice4 rather than slice.Slice4.  The error about not being able to resolve your class means that WALA could not find the class in the jar provided as the appJar argument.

2. Strange, I see this error too.  I'm able to double-click the resulting PDF file afterward and view it.  Does that work for you?  I'll try to dig into why this is occurring.

Let us know if there are other outstanding questions.

Thanks,
Manu


-------------------------------------------
Manu Sridharan
IBM T.J. Watson Research Center
http://researcher.ibm.com/view.php?person=us-msridhar


Inactive hide details for Pavan Kulkarni ---04/08/2013 11:48:59 AM---Julian,   I have fixed most of the bugs, butam still facinPavan Kulkarni ---04/08/2013 11:48:59 AM---Julian,   I have fixed most of the bugs, butam still facing with these issues.It

--With Regards
Pavan Kulkarni
------------------------------------------------------------------------------


Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal

Sneha Bharath

unread,
Apr 9, 2013, 6:26:23 PM4/9/13
to wala-sourc...@googlegroups.com
Hey Manu,
                  I tried to use WALA as well and faced the same issue decribed by Pavan  (2nd one) - 'Error opening the pdf file'. Even when I try to click on it directly, I'm not able to open it. Does dot.exe require special permissions because as far as I can make out  in my case the slice is being generated but it is not being converted into a pdf effectively.

PS: Also, what is the JVM format?  And say, I want to slice with respect to a line number - where do I specify that in the arguments?

Thanks in advance,

Sneha


On Monday, September 24, 2012 8:00:21 AM UTC-4, ASHISH MISHRA wrote:
Hi all

Pavan Kulkarni

unread,
Apr 9, 2013, 9:46:29 PM4/9/13
to WALA discussion and Q&A, wala-sourc...@googlegroups.com


Hi,

   I was able to fix  the issues with  "Error loading pdf" problem by switching to the latest graphviz 2.30 software.
But am not sure if the output that was generated in the slice.pdf is correct/wrong since we do not have access to the original test program.
This is the output(Click on this dropbox link which has the image) we got 

It would be really helpful if someone can explain what this output is. How can we relate this output to the original test program(terms of line number, bytecode etc) ? 
How do we write a test program for slicing ? How do we analyze a particular statement ? Where is this parameter for what statement to be analysed is set? Thanks a lot 
graycol.gif
4F504425.gif

Pavan Kulkarni

unread,
Apr 9, 2013, 8:50:46 PM4/9/13
to WALA discussion and Q&A
Hi,

   I was able to fix  the issues with  "Error loading pdf" problem by switching to the latest graphviz software.
But am not sure if the output that was generated in the slice.pdf is correct/wrong since we do not have access to the original test program.
This is the output we got 
Inline image 1

It would be really helpful if someone can explain what this output is. How can we relate this output to the original test program(terms of line number, bytecode etc) ? Thanks a lot 


On Mon, Apr 8, 2013 at 4:30 PM, Manu Sridharan <msri...@us.ibm.com> wrote:
image.png
4F504425.gif
graycol.gif

Pavan Kulkarni

unread,
Apr 9, 2013, 9:43:03 PM4/9/13
to WALA discussion and Q&A
4F504425.gif
image.png
graycol.gif

Manu Sridharan

unread,
Apr 25, 2013, 7:27:23 PM4/25/13
to WALA discussion and Q&A

Hi Pavan,

The original test program is here:

https://github.com/wala/WALA/blob/master/com.ibm.wala.core.testdata/src/slice/Slice4.java?source=c

The slice is a forward slice on the call to foo() from main(), and you can see that the slice includes the call to bar(), as expected.  For more on the slicer, see here:

http://wala.sourceforge.net/wiki/index.php/UserGuide:Slicer

--Manu


 
-------------------------------------------
Manu Sridharan
IBM T.J. Watson Research Center
http://researcher.ibm.com/view.php?person=us-msridhar


Inactive hide details for Pavan Kulkarni ---04/09/2013 07:42:47 PM---Hi,    I was able to fix  the issues with  "Error loading Pavan Kulkarni ---04/09/2013 07:42:47 PM---Hi,    I was able to fix  the issues with  "Error loading pdf" problem by

--With Regards
Pavan Kulkarni
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter_______________________________________________
Wala-wala mailing list
Wala...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wala-wala

Reply all
Reply to author
Forward
0 new messages