Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using SAFE for typestate analysis of an object declared in a com.ibm.wala.classLoader.IMethod #2

Open
khatchad opened this issue Jan 30, 2017 · 6 comments

Comments

@khatchad
Copy link
Contributor

khatchad commented Jan 30, 2017

Is it possible to use SAFE to analyze the typestate of an object declared in a com.ibm.wala.classLoader.IMethod that emanating from the WALA framework? It seems that SAFE is very much geared towards running from a command line with specific typestate rules. However, in my case, I don't have a specific typestate to rule to check, instead, I would just like to know the /sequence/ of possible methods called on the object.

@yahave
Copy link
Contributor

yahave commented Jan 30, 2017

yes, it should be possible. You can define a dummy rule that is triggered on every step and record the steps that it goes through. Create a class that inherits from com.ibm.safe.typestate.rules. AbstractTypeStateDFA and make it receive all possible events. Then use matchDispatchEvent to track the events.

@khatchad
Copy link
Contributor Author

khatchad commented Feb 1, 2017 via email

@yahave
Copy link
Contributor

yahave commented Feb 1, 2017

That should work. I think what I've done in the past is to create another solver factory, though. But your approach is also fine.

@khatchad
Copy link
Contributor Author

khatchad commented Feb 3, 2017 via email

@yahave
Copy link
Contributor

yahave commented Feb 3, 2017

You will not be able to know the real possible states of an object based on analysis of client code. Your best bet is to "make up" states based on some limited history (we have often used just the most recent call to name the state). See for example http://www.cs.technion.ac.il/~yahave/papers/oopsla12.pdf

@khatchad
Copy link
Contributor Author

Thank you for the reference. I am just considering intraprocedural analysis at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants