Out of bounds when using getddg and dot function

36 views
Skip to first unread message

Andreas Olschnögger

unread,
Sep 4, 2023, 3:49:15 AM9/4/23
to Boa Language and Infrastructure User Forum
Hello,

I recently started working with boa using the Program Analysis feature. I would like to work with the DDG, but it seems that the DDG cannot be created for all methods in the dataset.

I would also like to visually display the graph of random methods for testing purposes.
The dot function doesn't seem to work for some graphs either.

Is this behavior intentional, or have I programmed something wrong in the code?

Thanks
Andreas


This code results in a lot of java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1 errors:

m: output set of string;
visit(input, visitor {
before node: CodeRepository -> {
snapshot := getsnapshot(node);
foreach (i: int; def(snapshot[i]))
visit(snapshot[i]);
stop;
}
before node: Method -> {
ddg := getddg(node);
m << "";
}
});

m: output set of string;
visit(input, visitor {
before node: CodeRepository -> {
snapshot := getsnapshot(node);
foreach (i: int; def(snapshot[i]))
visit(snapshot[i]);
stop;
}
before node: Method -> {
cfg := getcfg(node);
m << dot(cfg);
}
});

Robert Dyer

unread,
Sep 4, 2023, 3:53:32 PM9/4/23
to boa-...@googlegroups.com
Hi Andreas,

I’ll have to dig into a bit more, but my suspicion is that you ran on Python data.

We never fully extended the program analysis support over to the Python dataset, so officially it is “untested”.

I just pushed a simple fix that, at the very least, might get you some progress.  Now if it fails to build a graph, it will just return undefined instead of crashing.

You can check if “def(dog)” and proceed for things it gave you a graph:


I had to exclude 25 projects to get this working, because it caused out of memory errors… but it did run eventually.

Note there are 34k methods that cause the error you were seeing, and now just return undefined.

- Robert

--
More information about Boa: http://boa.cs.iastate.edu/
---
You received this message because you are subscribed to the Google Groups "Boa Language and Infrastructure User Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boa-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/boa-user/f8c6d4de-bd07-4a3f-be86-cf8c613c6300n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages