Modify

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#7789 closed defect (fixed)

Map icons sometimes disapear after an "Update Data" command

Reported by: rickmastfan67 Owned by: team
Priority: normal Milestone:
Component: Internal mappaint style Version: latest
Keywords: Cc:

Description

Steps to reproduce:

  1. Download the following area:
    minlat: 40.4515984 --- min lon: -79.1456171
    maxlat: 40.4533673 --- max lon: -79.1422074
    
  2. Once downloaded, search for the way "116,915,565" and select it. (on the left of the screen of downloaded data)
  3. Once selected, look at the properties and scroll down to the bottom and see that the way is part of a "no_u_turn" restriction.
  4. Look at the map and notice that the "No-U-Turn" icon is missing.

I've been able to duplicate this every time I've tested in [5281] & [5278] without fail AS LONG AS I download the same bounding box area. If I just download the small area that the problem is happening in, it doesn't happen.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-06-11 01:31:17
Last Changed Author: simon04
Revision: 5278
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-06-11 00:17:12 +0200 (Mon, 11 Jun 2012)
Last Changed Rev: 5278

Identification: JOSM/1.5 (5278 en)
Memory Usage: 150 MB / 2730 MB (92 MB allocated, but free)
Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7
Dataset consistency test: No problems found

Plugin: turnrestrictions (28412)

Attachments (3)

bug zone.7z (89.5 KB ) - added by rickmastfan67 12 years ago.
josm_before_update.png (308.1 KB ) - added by Don-vip 12 years ago.
josm_after_update.png (308.8 KB ) - added by Don-vip 12 years ago.

Download all attachments as: .zip

Change History (38)

comment:1 by rickmastfan67, 12 years ago

Also, if I delete the downloaded layer and then re-download the data (WITHOUT closing and restarting JOSM), more icons disappear. To be more specific, the other "No-U-Turn" restriction icon for the other direction of US-22 disappears as well as the stop icon for a node tagged "highway=stop" in the same area as the missing No-U-Turn icon from the beginning.

comment:2 by rickmastfan67, 12 years ago

I'm starting to think this might be because of Java 1.7, as I never had this problem with Java 1.6.

Can anybody else confirm this who is running Java 1.7?

comment:3 by rickmastfan67, 12 years ago

Summary: Map icons sometimes don't get displayed after downloading dataMap icons sometimes disapear after an "Update Data" command

Nobody else has had this problem? I'm even able to duplicate it (not to the same extent as with my normal profile) with a clean profile with no plugins downloaded/installed.

Alright, here's some better steps to reproducing this with a clean profile and the file that I'm going to attach after this post.

  1. Delete your profile (or just rename the folder) so that JOSM will create a new profile for you when it's started.
  2. Start JOSM and let it create the new profile.
  3. Close and restart JOSM.
  4. Once JOSM has started again, open the attached file, "bug zone.osm" (will be compressed, so uncompress it first) via the File > Open command (Ctrl+O).
  5. Once the file has opened, Ctrl+F, select the "replace selection", and paste in the following text into the text bar and then hit the Start Search button: Fanny Edel Falk Laboratory School
  6. File > Update Data
  7. Notice that the school icon has disappeared for "Fanny Edel Falk Laboratory School".

I can duplicate this 100% of the time. In some other files, all icons completely disappear, but I wanted to attach a file that I wasn't editing currently and one that might not have anything new added in it's area in the near future that would throw up conflicts.

Anyways, this is really annoying me when I hit the that "Update Data" button to see the icons disappear. So, with the steps above and the file I've attached, can anybody now duplicate this? You must be running Java 1.7 because this never happened with 1.6. Hopefully this isn't a bug that is on Java's end only and is something that can be fixed on this end to work with Java 1.7 properly.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-06-30 01:31:12
Last Changed Author: Don-vip
Revision: 5309
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-06-29 22:12:06 +0200 (Fri, 29 Jun 2012)
Last Changed Rev: 5309

Identification: JOSM/1.5 (5309 en)
Memory Usage: 154 MB / 2730 MB (121 MB allocated, but free)
Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7

by rickmastfan67, 12 years ago

Attachment: bug zone.7z added

comment:4 by bastiK, 12 years ago

Cannot reproduce on my system.

Build-Date: 2012-06-19 23:45:51
Revision: 5283
Is-Local-Build: true

Identification: JOSM/1.5 (5283 SVN en)
Memory Usage: 281 MB / 1767 MB (249 MB allocated, but free)
Java version: 1.7.0_147-icedtea, Oracle Corporation, OpenJDK 64-Bit Server VM
Operating system: Linux

comment:5 by rickmastfan67, 12 years ago

Anybody else out there using Windows having this happening?

in reply to:  5 comment:6 by Don-vip, 12 years ago

Replying to rickmastfan67:

Anybody else out there using Windows having this happening?

Yes, I just reproduced it by running your steps 4 to 7. Now, why this is happening...

Build-Date: 2012-07-01 14:53:54
Revision: 5313
Is-Local-Build: true

Identification: JOSM/1.5 (5313 SVN fr)
Memory Usage: 181 MB / 1816 MB (65 MB allocated, but free)
Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7

by Don-vip, 12 years ago

Attachment: josm_before_update.png added

by Don-vip, 12 years ago

Attachment: josm_after_update.png added

comment:7 by Don-vip, 12 years ago

However, I cannot reproduce it 100% of the time. Here's my screen before/after updating:



comment:8 by rickmastfan67, 12 years ago

I also see that the "Hospital" icon disappeared as well in your test on the left of the screen. That icon wasn't disappearing in my tests. (I've more often seen "highway" related icons disappear, like traffic lights, stop signs, and turn restriction icons when I've been doing editing.)

Hopefully the bug that is causing this to happen can be identified now since you've been able to duplicate it Don. :)

comment:9 by bastiK, 12 years ago

@Don-vip: For debugging you can have a look at the second tab of "Advanced object info" (Ctrl+I) before and after update.

in reply to:  9 ; comment:10 by Don-vip, 12 years ago

Replying to bastiK:

@Don-vip: For debugging you can have a look at the second tab of "Advanced object info" (Ctrl+I) before and after update.

Thanks. Before:

Styles Cache for "Fanny Edel Falk Laboratory School ?(40.4471711, -79.9594584) [id: 1,668,195,992]":

> applying xml style "JOSM"

Range:|s0.0-Infinity
 default: 
Cascade{ }

> skipping "Potlatch 2" (not active)

> applying mapcss style "Registre Parcellaire Graphique (France)"

Range:|s0.0-Infinity
 default: 
Cascade{ }

List of generated Styles:
 * NodeElemStyle{z_idx=[4.0/0.0/0.0]  icon=[education/school.png]}
 * BoxTextElemStyle{z_idx=[5.0/0.0/0.0]  labelCompositionStrategy={DeriveLabelFromNameTagsCompositionStrategy} font=java.awt.Font[family=Dialog,name=Helvetica,style=plain,size=8] color=#ffffff box=java.awt.Rectangle[x=-8,y=-8,width=16,height=16] hAlign=RIGHT vAlign=BOTTOM}

After:

Styles Cache for "Fanny Edel Falk Laboratory School ?(40.4471711, -79.9594584) [id: 1,668,195,992]":

> applying xml style "JOSM"

Range:|s0.0-Infinity
 default: 
Cascade{ text:Keyword{auto}; icon-image:IconReference{iconName='education/school.png' source='JOSM'}; }

> skipping "Potlatch 2" (not active)

> applying mapcss style "Registre Parcellaire Graphique (France)"

Range:|s0.0-Infinity
 default: 
Cascade{ text:Keyword{auto}; icon-image:IconReference{iconName='education/school.png' source='JOSM'}; }

List of generated Styles:
 * NodeElemStyle{z_idx=[4.1/0.0/0.0] }
 * BoxTextElemStyle{z_idx=[5.0/0.0/0.0]  labelCompositionStrategy={DeriveLabelFromNameTagsCompositionStrategy} font=java.awt.Font[family=Dialog,name=Helvetica,style=plain,size=8] color=#ffffff box=java.awt.Rectangle[x=-2,y=-2,width=5,height=5] hAlign=RIGHT vAlign=BOTTOM}

comment:11 by rickmastfan67, 12 years ago

Don't know if this will help, but in one file I'm working on, an intersection of a divided highway that has traffic lights is showing some weird behavior. One traffic light icon is showing up, yet the other one isn't. Hope this "Advanced Info" from those two nodes will help out:

Styles Cache for "1811117129 ‎(40.3955211, -79.4419837) [id: 1,811,117,129]":

> applying xml style "Internal Style"

Range:|s0.0-Infinity
 default: 
Cascade{ }

> skipping "Potlatch 2" (not active)

> skipping "Maxspeed" (not active)

List of generated Styles:
 * NodeElemStyle{z_idx=[4.1/0.0/0.0] }


Styles Cache for "1811117115 ‎(40.3954117, -79.4419795) [id: 1,811,117,115]":

> applying xml style "Internal Style"

Range:|s0.0-Infinity
 default: 
Cascade{ }

> skipping "Potlatch 2" (not active)

> skipping "Maxspeed" (not active)

List of generated Styles:
 * NodeElemStyle{z_idx=[4.0/0.0/0.0]  icon=[vehicle/restriction/traffic-light.png]}


The 2 selected objects have different style caches.

in reply to:  10 comment:12 by bastiK, 12 years ago

Replying to Don-vip:

Replying to bastiK:

@Don-vip: For debugging you can have a look at the second tab of "Advanced object info" (Ctrl+I) before and after update.

Thanks. Before:

Styles Cache for "Fanny Edel Falk Laboratory School ?(40.4471711, -79.9594584) [id: 1,668,195,992]":

> applying xml style "JOSM"

Range:|s0.0-Infinity
 default: 
Cascade{ }

> skipping "Potlatch 2" (not active)

> applying mapcss style "Registre Parcellaire Graphique (France)"

Range:|s0.0-Infinity
 default: 
Cascade{ }

List of generated Styles:
 * NodeElemStyle{z_idx=[4.0/0.0/0.0]  icon=[education/school.png]}
 * BoxTextElemStyle{z_idx=[5.0/0.0/0.0]  labelCompositionStrategy={DeriveLabelFromNameTagsCompositionStrategy} font=java.awt.Font[family=Dialog,name=Helvetica,style=plain,size=8] color=#ffffff box=java.awt.Rectangle[x=-8,y=-8,width=16,height=16] hAlign=RIGHT vAlign=BOTTOM}

There are already errors in the "Before" part: An empty cascade is created, but still an icon is derived from that in the style list. This is impossible, because only the information from the final cascade is used to generate the styles. So the code that generates the cascade seems to have different results depending on some unkown condition, although the tags and the style definitions are unchanged.

comment:13 by rickmastfan67, 12 years ago

Any luck on figuring this out Don?

in reply to:  13 comment:14 by Don-vip, 12 years ago

Replying to rickmastfan67:

Any luck on figuring this out Don?

Not yet, sorry, I still have to find enough hours ahead in my planning to investigate this problem in depth. I am afraid of its complexity, especially because I am not enough familiar (yet) with the cascade-styled rendering. But I did not forget you, I promise :)

comment:15 by bastiK, 12 years ago

One possible reason could be errors in equals and hashCode methods.

comment:16 by stoecker, 12 years ago

See also #8101.

comment:17 by bastiK, 12 years ago

Ticket #8101 has been marked as a duplicate of this ticket.

comment:18 by bastiK, 12 years ago

In 5530/josm:

see #7789 - Map icons sometimes disapear after an "Update Data" command

comment:19 by bastiK, 12 years ago

Could reproduce the in Windows 7 / Java 7.

It is quite strange, very basic commands aren't executed the way I expect them to. In particular the line

return requiresUpdate(current, candidate, scale, mc) ? candidate : current; 

in [5530] is weird. My debug output confirms, that requiresUpdate returns true and that candidate is != null, however the whole expression evaluates to null. As soon as I do the trivial rework [5530], the problem goes away completely on my system.

Please check, whether the bug is fixed!

Version 0, edited 12 years ago by bastiK (next)

comment:20 by Don-vip, 12 years ago

Very weird. The only difference I could find between ternary operator and if/else statement is this one:
http://stackoverflow.com/questions/8098953/tricky-ternary-operator-in-java-autoboxing

But this does not concern our case :( I'd like to understand !

comment:21 by rickmastfan67, 12 years ago

Just tested this in the two locations I mentioned that were having this problem. Couldn't get the icons to disappear, so, I think this is now fixed.

in reply to:  20 comment:22 by bastiK, 12 years ago

Resolution: fixed
Status: newclosed

Replying to Don-vip:

Very weird. The only difference I could find between ternary operator and if/else statement is this one:
http://stackoverflow.com/questions/8098953/tricky-ternary-operator-in-java-autoboxing

But this does not concern our case :( I'd like to understand !

The problem is, that debugging makes it go away. This usually happens in multi-threading environment for race conditions, but here it seems to be all local and one line of execution. Please tell, if you get any more insights!

comment:23 by stoecker, 12 years ago

Can you compile a java bug report? I think this may cause other troubles as well, so probably a java bug report is the better idea than fixing this again and again in josm :-)

in reply to:  23 comment:24 by bastiK, 12 years ago

Replying to stoecker:

Can you compile a java bug report? I think this may cause other troubles as well, so probably a java bug report is the better idea than fixing this again and again in josm :-)

Done.

I trimmed it down further:

    private String returnSecond(String first, String second) {
        return alwaysTrue() ? second : first;
    }

    private boolean alwaysTrue() {
        return true;
    }

    private IconPrototype getNode(OsmPrimitive primitive, Double scale, MultiCascade mc) {

        if (primitive.getId() == 746457511)
        {
            String test = returnSecond(null, "second");
            System.err.println("test: " + test);
        }

        [...]
    }

Output:

Open file: C:\Users\te\Downloads\aaaa.osm (690139 bytes)
test: second
GET http://api.openstreetmap.org/api/0.6/map?bbox=14.1311646,51.2202174,14.1445541,51.2294629
test: null

It should be pretty obvious, that something is seriously wrong here. However, I cannot provide a small self-contained test case, so I'm not sure whether Oracle will accept my bug report.

comment:25 by rickmastfan67, 11 years ago

bastiK, just curious, but did Oracle ever accept the bug report?

comment:26 by bastiK, 11 years ago

No reaction so far (except for automatic confirmation mail).

comment:27 by Don-vip, 11 years ago

Did you receive a bug ID in the confirmation mail ?

comment:28 by bastiK, 11 years ago

No, just an internal review ID.

comment:29 by stoecker, 11 years ago

Like my first and last try to report a java bug. Automatic response was all I got.

comment:30 by Don-vip, 11 years ago

You were unlucky, the two only bugs I submitted to Oracle did eventually show on public tracker, even one that has been closed as "not an issue":

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7158257
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7194099

comment:32 by Don-vip, 11 years ago

This new public JIRA instance is awesome. I found the ticket just by searching for "josm" \o/ The bug is P3 and not closed, so there's definitively hope to have an answer in the coming months/years

For more details see Mark Reinhold's announce:
http://mail.openjdk.java.net/pipermail/announce/2013-September/000153.html

comment:33 by anonymous, 10 years ago

Can someone try this with JDK7u40? Does this go away?

in reply to:  33 ; comment:34 by bastiK, 10 years ago

Replying to anonymous:

Can someone try this with JDK7u40? Does this go away?

On my the system, the problem seems to be gone with

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

I can still reproduce with

java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.10.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

in reply to:  34 comment:35 by anonymous, 10 years ago

Thanks. If this is fixed in JDK7u40 then I'll close the bug and recommend people upgrade. Thank you for bringing up this issue.

Replying to bastiK:

Replying to anonymous:

Can someone try this with JDK7u40? Does this go away?

On my the system, the problem seems to be gone with

java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

I can still reproduce with

java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.10.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

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.