[Soot-list] Soot crashes at Jimple bodycreation

Tillmann Runkel tirunkel at informatik.uni-bremen.de
Wed Sep 14 05:30:15 EDT 2011


Hi,

i got the problem listed below. It only appears when i create the 
Jimplefiles from Java-Sourcecode and not from compiled Classes.

In my opinion the method below is very simple and i have no idea why the 
nop statement here is problematic (Chain already contains object: nop).

Has anyone any idea when looking at the code?

Thanks in advance.

Tillmann Runkel

Error generating 
com.sun.javaee.blueprints.petstore.captcha.SimpleCaptcha: public 
BufferedImage getCaptchaImage(String message, int w, int h) {
     BufferedImage bufferImg = new BufferedImage(w, h, 
BufferedImage.TYPE_INT_RGB);
     Graphics g = null;
     Graphics g2 = null;
     BufferedImage lastBimg = null;
     try {
       g = bufferImg.getGraphics();
       g.setColor(background);
       g.fillRect(0, 0, w, h);
       g.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 30));
       g.setColor(Color.GRAY);
       drawRandomLine(g, 16);
       drawMessage(g, message);
       ImageProducer source = bufferImg.getSource();
       ImageFilter filter = new BlueFilter();
       ImageProducer producer = new FilteredImageSource(source, filter);
       Image filteredImg = 
Toolkit.getDefaultToolkit().createImage(producer);
       lastBimg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
       g2 = lastBimg.getGraphics();
       g2.drawImage(filteredImg, 0, 0, null);
     }
     finally {
       if(g != null)
         g.dispose();
       if(g2 != null)
         g2.dispose();
     }
     return lastBimg;
   }
java.lang.RuntimeException: Chain already contains object: nop
     at soot.util.HashChain.addLast(HashChain.java:283)
     at soot.util.HashChain.add(HashChain.java:66)
     at soot.PatchingChain.add(PatchingChain.java:65)
     at soot.JastAddJ.Body.add(Body.java:128)
     at soot.JastAddJ.Body.addLabel(Body.java:154)
     at soot.JastAddJ.IfStmt.jimplify2(IfStmt.java:107)
     at soot.JastAddJ.Block.jimplify2(Block.java:91)
     at soot.JastAddJ.TryStmt.emitFinallyCode(TryStmt.java:179)
     at soot.JastAddJ.TryStmt.emitExceptionHandler(TryStmt.java:278)
     at soot.JastAddJ.TryStmt.jimplify2(TryStmt.java:225)
     at soot.JastAddJ.Block.jimplify2(Block.java:91)
     at soot.JastAddJ.MethodDecl.jimplify2(MethodDecl.java:872)
     at 
soot.JastAddInitialResolver$1.getBody(JastAddInitialResolver.java:127)
     at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:82)
     at soot.SootMethod.retrieveActiveBody(SootMethod.java:315)
     at soot.PackManager.retrieveAllBodies(PackManager.java:989)
     at soot.PackManager.runPacks(PackManager.java:338)
     at 
de.tirunkel.da.analysis.JimpleGeneration.generate(JimpleGeneration.java:93)
     at 
de.tirunkel.da.transformer.Transformer.findReplacementPoints(Transformer.java:90)
     at de.tirunkel.da.main.Controller.main(Controller.java:104)
     at de.tirunkel.da.main.SimulatedStart.main(SimulatedStart.java:37)
Exception in thread "main" java.lang.NullPointerException
     at 
de.tirunkel.da.transformer.Transformer.findReplacementPoints(Transformer.java:94)
     at de.tirunkel.da.main.Controller.main(Controller.java:104)
     at de.tirunkel.da.main.SimulatedStart.main(SimulatedStart.java:37)


More information about the Soot-list mailing list