Opened 7 months ago

Last modified 7 months ago

#18511 closed defect

[Patch] StackOverflowError at GpxExtension.hashCode — at Version 4

Reported by: tshrub Owned by: team
Priority: critical Milestone: 20.01
Component: Core Version:
Keywords: template_report gpx Cc: Bjoeni

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. PlugIn InfoMode: right mouse click on "this and older deletions"

What is the expected result?

What happens instead?

Please provide any additional information below. Attach a screenshot if possible.

But the plugin has a few small display errors:
the popup runs out of the right edge of the screen, because the fourth line does not convert html markups (<p></br>) and
it remains absolutely in the foreground, no matter what other application windows are in front of JOSM.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-01-02 22:34:59 +0100 (Thu, 02 Jan 2020)
Revision:15628
Build-Date:2020-01-02 21:52:31
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (15628 de) Linux Ubuntu 19.10
Memory Usage: 341 MB / 2922 MB (72 MB allocated, but free)
Java version: 11.0.5+10-post-Ubuntu-0ubuntu1.1, Private Build, OpenJDK 64-Bit Server VM
Screen: :0.0 1280x1024
Maximum Screen Size: 1280x1024
Java package: openjdk-11-jre:amd64-11.0.5+10-0ubuntu1.1
Java ATK Wrapper package: libatk-wrapper-java:all-0.35.0-3
libcommons-compress-java: libcommons-compress-java:all-1.18-3
libcommons-logging-java: libcommons-logging-java:all-1.2-2
fonts-noto: fonts-noto:-
VM arguments: [-Djosm.restart=true, -Djava.net.useSystemProxies=true]

Plugins:
+ ElevationProfile (35248)
+ ImageWayPoint (35248)
+ InfoMode (35248)
+ PicLayer (35248)
+ SeaMapEditor (35248)
+ apache-commons (35092)
+ editgpx (35248)
+ ejml (35122)
+ geotools (35169)
+ importvec (35248)
+ jaxb (35092)
+ jts (35122)
+ measurement (35248)
+ opendata (35248)
+ photo_geotagging (35248)
+ print (35248)
+ tageditor (35258)
+ utilsplugin2 (35248)

Validator rules:
+ resource://data/validator/power.mapcss

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.
- W: Hinzufügen von resource://data/validator/power.mapcss zum Merkmalsprüfer fehlgeschlagen
- W: java.io.IOException: Das Öffnen eines Eingabestroms für die Resource 'resource://data/validator/power.mapcss' ist fehlgeschlagen.
- E: Fehler beim Laden des Bildes 'Waypoint'
- E: Fehler beim Laden des Bildes 'Waypoint'
- E: Fehler beim Laden des Bildes 'Waypoint'
- E: Fehler beim Laden des Bildes 'Waypoint'
- E: Fehler beim Laden des Bildes 'Waypoint'
- E: Fehler beim Laden des Bildes 'Waypoint'
- E: Handled by bug report queue: java.lang.StackOverflowError


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (19) of main
java.lang.StackOverflowError
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
...
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.WithAttributes.hashCode(WithAttributes.java:95)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)
	at org.openstreetmap.josm.data.gpx.GpxExtension.hashCode(GpxExtension.java:236)
	at java.base/java.util.ArrayList.hashCodeRange(ArrayList.java:626)
	at java.base/java.util.ArrayList.hashCode(ArrayList.java:613)
	at java.base/java.util.Arrays.hashCode(Arrays.java:4685)
	at java.base/java.util.Objects.hash(Objects.java:146)

Change History (4)

comment:1 Changed 7 months ago by Don-vip

Cc: Bjoeni added
Description: modified (diff)
Keywords: gpx added
Priority: normalcritical
Summary: PlugIn InfoMode, right mouse click on "this and older deletions"StackOverflowError at GpxExtension.hashCode

comment:2 Changed 7 months ago by Bjoeni

Summary: StackOverflowError at GpxExtension.hashCode[Patch] StackOverflowError at GpxExtension.hashCode

Remove parent from equals contract

  • src/org/openstreetmap/josm/data/gpx/GpxExtension.java

     
    233233
    234234    @Override
    235235    public int hashCode() {
    236         return Objects.hash(prefix, key, value, attr, parent, visible, super.hashCode());
     236        return Objects.hash(prefix, key, value, attr, visible, super.hashCode());
    237237    }
    238238
    239239    @Override
     
    269269                return false;
    270270        } else if (!attr.equals(other.attr))
    271271            return false;
    272         if (parent == null) {
    273             if (other.parent != null)
    274                 return false;
    275         } else if (!parent.equals(other.parent))
    276             return false;
    277272        return true;
    278273    }
    279274}
  • test/unit/org/openstreetmap/josm/data/gpx/GpxExtensionTest.java

     
    3838        col.add("josm", "from-server", "true");
    3939        EqualsVerifier.forClass(GpxExtension.class).usingGetClass()
    4040        .suppress(Warning.NONFINAL_FIELDS)
    41         .withIgnoredFields("qualifiedName")
     41        .withIgnoredFields("qualifiedName", "parent")
    4242        .withPrefabValues(GpxExtensionCollection.class, new GpxExtensionCollection(), col)
    4343        .verify();
    4444    }

comment:3 Changed 7 months ago by Don-vip

Milestone: 20.01

comment:4 Changed 7 months ago by Don-vip

Description: modified (diff)
Note: See TracTickets for help on using tickets.