Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3457 closed defect (duplicate)

Automatic exception report

Reported by: hawke@… Owned by: team
Priority: major Milestone:
Component: Core Version:
Keywords: Cc:

Description (last modified by stoecker)

I was recording with LiveGPS.

Path: trunk
URL: http://josm.openstreetmap.de/svn/trunk
Repository Root: http://josm.openstreetmap.de/svn
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Revision: 2093
Node Kind: directory
Last Changed Author: Gubaer
Last Changed Rev: 2093
Last Changed Date: 2009-09-10 21:00:01 +0200 (Thu, 10 Sep 2009)

Memory Usage: 31 MB / 508 MB (3 MB allocated, but free)
Java version: 1.6.0_0

Plugins: graphviewlivegps
Plugin graphview Version: 17538
Plugin livegps Version: 16945

java.util.ConcurrentModificationException

at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:782)
at java.util.ArrayList$Itr.next(ArrayList.java:754)
at org.openstreetmap.josm.data.gpx.GpxData.length(GpxData.java:123)
at org.openstreetmap.josm.gui.layer.GpxLayer.getToolTipText(GpxLayer.java:373)
at org.openstreetmap.josm.gui.dialogs.LayerListDialog$LayerListCellRenderer.getListCellRendererComponent(LayerListDialog.java:535)
at javax.swing.plaf.basic.BasicListUI.paintCell(BasicListUI.java:208)
at javax.swing.plaf.basic.BasicListUI.paintImpl(BasicListUI.java:317)
at javax.swing.plaf.basic.BasicListUI.paint(BasicListUI.java:240)
at javax.swing.plaf.synth.SynthListUI.update(SynthListUI.java:69)
at javax.swing.JComponent.paintComponent(JComponent.java:774)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:875)
at javax.swing.JComponent.paint(JComponent.java:1047)
at javax.swing.JViewport.paint(JViewport.java:764)
at javax.swing.JComponent.paintChildren(JComponent.java:875)
at javax.swing.JComponent.paint(JComponent.java:1047)
at javax.swing.JComponent.paintChildren(JComponent.java:875)
at javax.swing.JComponent.paint(JComponent.java:1047)
at javax.swing.JComponent.paintChildren(JComponent.java:875)
at javax.swing.JComponent.paint(JComponent.java:1047)
at javax.swing.JComponent.paintChildren(JComponent.java:875)
at javax.swing.JComponent.paint(JComponent.java:1047)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5147)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1411)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1342)
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:318)
at javax.swing.RepaintManager.paint(RepaintManager.java:1145)
at javax.swing.JComponent._paintImmediately(JComponent.java:5095)
at javax.swing.JComponent.paintImmediately(JComponent.java:4905)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:740)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:696)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:676)
at javax.swing.RepaintManager.access$700(RepaintManager.java:57)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1550)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:602)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

Attachments (0)

Change History (4)

in reply to:  description comment:1 by ray.foulkes@…, 15 years ago

Priority: normalmajor

I am using revision 2154 and can confirm that the bug is still there when using livegps. Sometimes it occurs every few seconds, sometimes not for a minute or so. Dismissing the error report is very distracting and makes this version almost unusable for track recording.
I am also using surveyor and Java 1.6.0.0

in reply to:  description comment:2 by ray.foulkes@…, 15 years ago

A further bit of diagnosis... the problem does not occur if the flow from the gps unit is stopped. If the track is already very long (e.g. I just leave it running with the antenna out of the window) the exception occurs so fast that nothing else can be done on the screen other than dismiss the exception. It does not seem to depend on whether autosave is on or off.

Perhaps this will help with the fix - health warning, I have never looked at this code before...
It looks like the fault is in an arraylist iterator. Which is probably of the class:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html
What I do not understand is that it occurs when computing the length of the track list, but "tracks" is a "linkedlist" and not an "Arraylist"; no matter 'cause it has similar contention characteristics.
If you look at the explanation for either linkedlist or arraylist it specifies that the class is not protected (synchronized)for changes by one thread (or indeed as a side effect of, for example, an iterator) during access by another thread. There is a test made for this and it raises java.util.ConcurrentModificationException which is what is happening.

The concurrent modification exception gets raised during an iteration on "tracks" to find the length of the track. So, is it possible that there are two threads simultaneously accessing the instance "data" of the class "gpxdata" in a particular instance of a gpxlayer when I am both displaying the track and capturing it?

If there are two or more threads which might access then the docs do suggest using
List list = Collections.synchronizedList(new ArrayList(...));
to apply an external synchronisation. But of course it might be that the access to the whole of "tracks" needs to be synchonised to avoid other subtle problems.

My skill in Java is not up to actually fixing this problem, just trying to be helpful for somebody who knows their way about this code. PLEASE, try to fix it I REALLY like this application and have great admiration for the development team.

comment:3 by stoecker, 15 years ago

Description: modified (diff)
Resolution: duplicate
Status: newclosed

comment:4 by stoecker, 15 years ago

Closed as duplicate of #2480.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.