Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 17:04
    msridhar commented #863
  • 15:50
    eleumasc closed #863
  • 15:50
    eleumasc commented #863
  • 14:23

    dependabot-preview[bot] on gradle

    (compare)

  • 14:23

    msridhar on master

    Bump com.diffplug.eclipse.maven… (compare)

  • 14:23
    msridhar closed #864
  • 05:34
    dependabot-preview[bot] review_requested #864
  • 05:34
    dependabot-preview[bot] labeled #864
  • 05:34
    dependabot-preview[bot] opened #864
  • 05:34

    dependabot-preview[bot] on gradle

    Bump com.diffplug.eclipse.maven… (compare)

  • Feb 23 17:17
    msridhar commented #863
  • Feb 23 15:47
    eleumasc edited #863
  • Feb 23 15:42
    eleumasc opened #863
  • Feb 23 14:33

    dependabot-preview[bot] on gradle

    (compare)

  • Feb 23 14:32

    msridhar on master

    Bump com.diffplug.eclipse.maven… (compare)

  • Feb 23 14:32
    msridhar closed #862
  • Feb 23 05:36
    dependabot-preview[bot] review_requested #862
  • Feb 23 05:36
    dependabot-preview[bot] labeled #862
  • Feb 23 05:36
    dependabot-preview[bot] opened #862
  • Feb 23 05:36

    dependabot-preview[bot] on gradle

    Bump com.diffplug.eclipse.maven… (compare)

Linghui Luo
@linghuiluo
you can look at my code there
234235235
@234235235
thx a lot! ;)
Linghui Luo
@linghuiluo
you just need add the JavaSourceAnalysisSope
234235235
@234235235
Im trying to do it with the JavaSourceCodeAnalysisScope as you said, but unfortionally there are errors since importing in the package com.ibm.wala.cast.java and i can't use this class therefore currently
did you also run into the following errors: ?
image.png
I did import WALA into eclipse java oxygen with buildship gradle integration 3.0 and gradle version 6.4-rc-1 as well as Java jdk8, and right after importing this errors occur
Linghui Luo
@linghuiluo
no, i didn't.
This is configuration problem
if you are using maven
the wala jars should be downloaded automaticially when you configure the pom file
234235235
@234235235
So should i import the project into eclipse with maven instead of gradle?
Linghui Luo
@linghuiluo
It depends on what you want
my project i shared uses maven
234235235
@234235235
I actually programmed my own stuff already which is working on jar files, but i need to get it working on java source code
therefore i think i just need to change the analysis scope right?
so i just need to get the wala project running somewhow idc how xD
Linghui Luo
@linghuiluo
i think so, you just need to change the analysis scope
234235235
@234235235
im trying to import it as maven project now and see if it works that way ;)
234235235
@234235235
okay that even results in more errors probabbly uninstalling gradel etc will help hopefully .X
234235235
@234235235
even after cleaning i run into this error, dont know how to resolve it yet at leas t:D
Manu Sridharan
@msridhar
@234235235 check out the WALA-start project: https://github.com/wala/WALA-start It shows how to import the WALA jars from Maven Central. You should not need to clone WALA from github to run the Java source front-end analysis
234235235
@234235235
@msridhar thx a lot ;) Is there also some kind of "fuzzy parser"? Im trying to find a solution on how to build the analysis scope with java source code i.e. just providing a some (or at the start for testing just one i.e. main.java) file as input. is this possible?
in order to build a callgraph
234235235
@234235235
if i try to run it with the SourceDirectoryTreeModule i get java.lang.ClassNotFoundException: com.ibm.wala.cast.java.translator.polyglot.PolyglotSourceLoaderImpl
234235235
@234235235
So the "only" thing i need is a callgraph of a file and ideally which might be incomplete meaningn wihtout giving a main function, just that wala would generate a call graph based on a file, i would then repeat this for different files and after that combine the "local" callgraphs into a global one
because im focussing on androids framework and am unable to build a jar in containting all classes since android does not provide a "main" function in this sense
234235235
@234235235
Does any one know why exactly entry points are needed for creating a call graph in WALA?
wouldnt it be possible to create a CG without a main method?
Manu Sridharan
@msridhar
Yes, you can create a CG for programs without a main method
You just provide whatever Entrypoints you want to consider to the AnalysisOptions object
234235235
@234235235
@msridhar thx a lot thats what i needed ;)
Manu Sridharan
@msridhar
Sure thing!
Marcel Bruch
@MarcelBruch

Hi, occassionally I get errors like the following:

instruction type: class com.ibm.wala.classLoader.JavaLanguage$JavaInstructionFactory$10 call site: invokestatic < Application, Ljava/lang/invoke/LambdaMetafactory, metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; >@20 caller: Node: < Application, Lru/saidgadjiev/ormnext/core/field/FieldAccessor, makeGetter(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/invoke/MethodHandle;)Ljava/util/function/Function; > Context: DelegatingContext [A=CallStringContext: [ com.ibm.wala.FakeRootClass.fakeRootMethod()V@4 ], B=Everywhere] unexpected non-invokedynamic instruction!

Is there anything I can do about this?

Manu Sridharan
@msridhar
@MarcelBruch i think this is fixed on WALA master branch. Can you check? If it works for you I can cut a new release with the fix
8 replies
Marcel Bruch
@MarcelBruch

With the changes in master I run into problems in my code.

fun SSAInvokeInstruction.getLambdaMethod(): IMethodName {
        require(this.isLambdaMetafactoryInvoke()) { "instruction is not a call to LambdaMetafactory" }
        require(this is SSAInvokeDynamicInstruction){"instruction is not a SSAInvokeDynamicInstruction: $this"} // here it fails
        val cp = bootstrap.cp // <— how do I get access to the bootstrap? I’m looking for the method that get’s invoked.
        val index = (0 until bootstrap.callArgumentCount()).first { bootstrap.callArgumentKind(it) == ClassConstants.CONSTANT_MethodHandle.toInt() }.let { bootstrap.callArgumentIndex(it) }
        val methodName = "L${cp.getCPHandleClass(index)}.${cp.getCPHandleName(index)}${cp.getCPHandleType(index)}"
        return VmMethodName.of(methodName)
    }

The cast fails (it’s not a SSAInvokeDynamic anymore). But w/o that cast i don’t get access to the bootstrap object. How would I solve this now?

Marcel Bruch
@MarcelBruch
@msridhar ^ (but it doesn’t fail in all cases - sometimes it is an SSAInvokeDynamicInstrcution, sometimes it’s not)
Manu Sridharan
@msridhar
@MarcelBruch are you analyzing JDK11 bytecodes? That may be the issue; we haven't tested that much.
Marcel Bruch
@MarcelBruch
I’m not exactly sure but that’s likely true. I’m analyzing (parts of ) maven central.
Manu Sridharan
@msridhar
If there's any way you could provide a repro test case and file an issue, that would be great
If it's related to JDK 11 it may require some deeper investigation and may not be a quick fix
Marcel Bruch
@MarcelBruch
I can easily share the jars (from maven central) and the conrete method where this fails. A reproducible test that compiles something with jdk11+ will be tricky… what do you need?
Manu Sridharan
@msridhar
WALA tries to pattern match on the expected bytecodes for invoking a lambda. But maybe those patterns have changed. Also invokedynamic is being used for more and more stuff, and it's hard to support arbitrary bootstrap methods, so we kind of play whack-a-mole with these issues
2 replies
If you can share a jar and what exactly fails that should be enough
ligen
@ligenPro
image.png
hi, everyone, I have some ideas on optimizing wala pointer analysis, what do you think about this?
I recorded it in the issue: wala/WALA#789