[Soot-list] Problem with access to .class

Marco Bakera marco.bakera at uni-dortmund.de
Wed Sep 5 09:53:42 EDT 2007


Thanks for that hint. That made my day. Now everything is working fine. :)


Greetings,
Marco.

On Wednesday 05 September 2007 09:59, Ming-Yee Iu wrote:
> I recently had the same problem. I found that if you download the
> sootall package, go into the polyglot directory, and then look in the
> libs directory, there's a java_cup jar that seems to make things work
> for me.
>
> -Ming
>
> On 9/4/07, Marco Bakera <marco.bakera at uni-dortmund.de> wrote:
> > Now I added java-cup-11a-runtime and everything seems to be running as
> > expected. However there is an exception printed to console. What does
> > this mean?
> >
> > Soot finished on Tue Sep 04 16:57:12 CEST 2007
> > Soot has run for 0 min. 8 sec.
> > Jasmin:1: Jasmin: exception - <java.lang.NullPointerException> null..
> > .source
> >        ^
> > java.lang.NullPointerException
> >        at java_cup.runtime.lr_parser.parse(lr_parser.java:553)
> >        at jasmin.ClassFile.readJasmin(ClassFile.java:1052)
> >        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)
> > Jasmin: Found 1 errors
> >
> >
> > Thanks for your patience,
> > Marco.
> >
> > On Tuesday 04 September 2007 16:36, Eric Bodden wrote:
> > > 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:12
> > > >4) 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:9
> > > > > > > >8) 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.


More information about the Soot-list mailing list