Bug 55826 - Unsynchronised concurrent accesses to list in field RespTimeGraphVisualizer.internalList
Unsynchronised concurrent accesses to list in field RespTimeGraphVisualizer.i...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.10
PC All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-11-28 16:37 UTC by Bob Atkey
Modified: 2013-11-29 22:33 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Atkey 2013-11-28 16:37:04 UTC
We ran our static analysis tool ThreadSafe [1] on version 2.10 of JMeter, which appeared to uncover a couple of concurrency issues. One of the most interesting was a potential for unsynchronised concurrent accesses to the LinkedList stored in the field RespTimeGraphVisualizer.internalList.

The list stored in this field can be read from the method RespTimeGraphVisualize.actionPerformed(..), which will be called by the Swing UI thread, and is also modified by the method RespTimeGraphVisualizer.add(..), is a call-graph descendent of the run() method of the thread AsynchSampleSender.Worker thread.

Therefore, it is possible that incorrect data may be read from the list by the UI thread, due to the lack of synchronisation.

We're not sure that this can actually result in a user-visible bug, but we thought you'd like to know.

We are also planning to use this finding as an example of Android-related concurrency mistakes in an article about ThreadSafe. Obviously, if you, as the developers of JMeter, have any objections to our using this as an example, then we won't.

[1] ThreadSafe is a static analysis tool for Java concurrency, developed by Contemplate Ltd.:
     http://www.contemplateltd.com/
Comment 1 Bob Atkey 2013-11-28 16:46:03 UTC
I wrote:

> We are also planning to use this finding as an example of Android-related 
> concurrency mistakes in an article about ThreadSafe.

Obviously, "Android-related" was a mistake here. I meant to write "Java-related". Sorry about that.
Comment 2 Philippe Mouawad 2013-11-29 22:32:45 UTC
Date: Fri Nov 29 22:29:00 2013
New Revision: 1546654

URL: http://svn.apache.org/r1546654
Log:
Bug 55826 - Unsynchronised concurrent accesses to list in field RespTimeGraphVisualizer.internalList
Bugzilla Id: 55826

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
    jmeter/trunk/xdocs/changes.xml
Comment 3 Philippe Mouawad 2013-11-29 22:33:33 UTC
Thanks for report.
Regarding use of this example, can you ask the question on dev list ?

Thank you