Concurrent code analyzer
Asked Answered
L

3

4

I was wondering if there is any framework or application(app)/program out there that can analyze the concurrency of any java code?

If the tool knows all the implementations of the jre shipped classes and methods then it comes down to a simple analyzing of synchronized blocks and method and their call hierarchies. From here it can create a petri net and tell you for sure if you could ever experience a deadlock.

Am I missing out on something or is this really so easy? Then there must be some cool tool doing that kind of stuff? Or would such a tool report too many possible deadlocks that are completely save because of some underlying program/business logic? Petri nets should be powerful enough to handle these situations?

This would save so many man hours of searching for bugs that might or might not be related to dead locking issues.

Lemnos answered 22/5, 2011 at 20:47 Comment(1)
I believe that it's possible to send any synchronized code at all into an infinite loop using a correctly timed Thread.stop.Fissirostral
R
5

Although (many) concurrency related bugs can be found using static code analysis, it doesn't apply to every type of bug. Some bugs only appear at runtime under certain conditions.

IBM has a tool called ConTest that "schedules the execution of program threads such that program scenarios that are likely to contain race conditions, deadlocks, and other intermittent bugs (collectively called synchronization problems) are forced to appear with high frequency".

This requires running (unit)tests against an instrumented version of your app. More background info in this developerWorks article.

Robillard answered 22/5, 2011 at 21:23 Comment(1)
Is ConTest still available to download somewhere? Searched for it for ages, but AlphaWorks is updated, there's no link for download (or at least it doesn't shows up for a simple serach), and cannot find any binaries just tutorials and papers... Thanks in advance!Antique
H
1

This paper describes a tool that performs static analysis of a library and determines if deadlock is possible.

Hylomorphism answered 22/5, 2011 at 20:59 Comment(0)
S
0

Some more :

Spraddle answered 2/12, 2011 at 18:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.