Giter VIP home page Giter VIP logo

Comments (4)

zhangt2333 avatar zhangt2333 commented on August 15, 2024 1

After I dug into this I found it was indeed a frontend-related issue and although "--allow-phantom" can suppress the error, there are some potential pitfalls.

For example, in the following case, the frontend will not execute valid reference analysis on U.class, then the class U will not be included in the World of analysis (then Soot error occurs).

public class Test {
    public static void main(String[] args) throws Exception {
        Class<U> klass = U.class; // U is another empty class in the same directory with Test
        java.lang.reflect.Method[] declaredMethods = klass.getDeclaredMethods(); // just for using U
    }
}

"--allow-phantom" can suppress the error, but notes that some classes will be empty/ignored, that is, in the above case, U and its related process will be ignored. (There are so many U.class in the main method of org.apache.hadoop.hbase.mapreduce.Driver)

If you are very concerned about U‘s handling, then you can manually add U via --input-classes according to wiki.

It is an issue about Soot frontend, we are working on it.

from tai-e.

zhangt2333 avatar zhangt2333 commented on August 15, 2024

Try to add --allow-phantom to suppress the resolving error because of frontend according to wiki:

        String files = Stream.of(new File("target").listFiles())
                .filter(file -> !file.isDirectory())
                .map(File::toString)
-                .collect(Collectors.joining(":"));
+                .collect(Collectors.joining(File.pathSeparator));

        Main.main(new String[]{ "-cp", files,
+                "--allow-phantom", // or "-ap"
                "-m", "org.apache.hadoop.hbase.mapreduce.Driver",
                "-java", "8",
                "-a", "pta"
        });

from tai-e.

FXTi avatar FXTi commented on August 15, 2024

Thanks! It solve my problem.

from tai-e.

FXTi avatar FXTi commented on August 15, 2024

After I dug into this I found it was indeed a frontend-related issue and although "--allow-phantom" can suppress the error, there are some potential pitfalls.

For example, in the following case, the frontend will not execute valid reference analysis on U.class, then the class U will not be included in the World of analysis (then Soot error occurs).

public class Test {
    public static void main(String[] args) throws Exception {
        Class<U> klass = U.class; // U is another empty class in the same directory with Test
        java.lang.reflect.Method[] declaredMethods = klass.getDeclaredMethods(); // just for using U
    }
}

"--allow-phantom" can suppress the error, but notes that some classes will be empty/ignored, that is, in the above case, U and its related process will be ignored. (There are so many U.class in the main method of org.apache.hadoop.hbase.mapreduce.Driver)

If you are very concerned about U‘s handling, then you can manually add U via --input-classes according to wiki.

It is an issue about Soot frontend, we are working on it.

I'm curious about the progress of new frontend. Any plan?
Maybe you can open a https://github.com/pascal-lab/Tai-e/projects and give out an outline of new frontend. Community contribution can boost the progress. : )

from tai-e.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.