[Soot-list] Problem with access to .class

Eric Bodden eric.bodden at mail.mcgill.ca
Tue Sep 4 10:36:02 EDT 2007


Yes, CUP needs to be on the classpath.

Eric

On 04/09/07, Marco Bakera <marco.bakera at uni-dortmund.de> wrote:
> On Friday 31 August 2007 15:43, Eric Bodden wrote:
> >
> > I cannot reproduce this.
>
> The problem only occurs when using jasmin-2.2.4, polyglotclasses-1.3.4 and
> sootclasses-2.2.4.
>
> Switching to the version currently available at the homepage produces the
> following exception. Are there any dependencies to cup i need to include in
> my classpath?
>
> java.lang.NoClassDefFoundError: java_cup/runtime/Scanner
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         at jasmin.ClassFile.readJasmin(ClassFile.java:1045)
>         at jasmin.Main.assemble(Main.java:24)
>         at soot.util.JasminOutputStream.flush(JasminOutputStream.java:35)
>         at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:410)
>         at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)
>         at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
>         at java.io.PrintWriter.flush(PrintWriter.java:270)
>         at soot.PackManager.writeClass(PackManager.java:901)
>         at soot.PackManager.writeOutput(PackManager.java:463)
>         at soot.PackManager.writeOutput(PackManager.java:390)
>         at soot.Main.run(Main.java:204)
>         at soot.Main.main(Main.java:146)
>
> >
> > However this line here...
> >
> >     Main.main(new String[]{Testclass2.class.getName()})
> >
> > ... already asks for classpath trouble: This only works if Testclass2
> > is both on your soot build path and on your soot-class-path, which
> > generally is to be avoided. So you rather want to use something like
> > "Testclass2" (in String form) there.
>
> Problems occur as well when using the string version of the classes name.
>
>
> Greetings,
> Marco.
>
> >
> > Eric
> >
> > On 30/08/2007, Marco Bakera <marco.bakera at uni-dortmund.de> wrote:
> > > The problem occurs when invoking the code
> > >
> > >   G.reset();
> > >   Main.main(new String[]{Testclass2.class.getName()});
> > >
> > > on the following Testclass2
> > >
> > >   public class Testclass2 {
> > >
> > >       public Testclass2() {
> > >           Class c = Testclass2.class;
> > >           System.out.println("Testclass2.Testclass2() c="+c);
> > >       }
> > >   }
> > >
> > > On Thursday 30 August 2007 15:14, Chris Pickett wrote:
> > > > Hi Marco,
> > > >
> > > > Please attach a test case.
> > > >
> > > > Chris
> > > >
> > > > Marco Bakera wrote:
> > > > > Hey everybody!
> > > > >
> > > > > I am using Soot to transform Java source code into control flow
> > > > > graphs (namely Unit graphs in Soot). However there are some problems
> > > > > whenever there is access to the .class member in the source code. In
> > > > > such a case the following rather cryptic exception occurs.
> > > > >
> > > > > java.lang.RuntimeException: Attempting to push a non-constant cp
> > > > > entry at soot.coffi.CFG.processCPEntry(CFG.java:2716)
> > > > >     at soot.coffi.CFG.processFlow(CFG.java:1717)
> > > > >     at soot.coffi.CFG.jimplify(CFG.java:1341)
> > > > >     at soot.coffi.CFG.jimplify(CFG.java:1125)
> > > > >     at
> > > > > soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:98) at
> > > > > soot.SootMethod.getBodyFromMethodSource(SootMethod.java:80) at
> > > > > soot.SootMethod.retrieveActiveBody(SootMethod.java:304) at
> > > > > soot.PackManager.retrieveAllBodies(PackManager.java:711) at
> > > > > soot.PackManager.runPacks(PackManager.java:302)
> > > > >     at soot.Main.run(Main.java:179)
> > > > >     at soot.Main.main(Main.java:153)
> > > > >
> > > > > If there is not access to .class everything is running fine.
> > > > >
> > > > > Any suggestions how to circumvent the problem?
> > > > >
> > > > > Thanks for any help in advance. :)
> > > > >
> > > > > Greetings,
> > > > > Marco Bakera.
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list