[Talk-ca] Did I just find a potentially significant bug in JOSM?

Dan Charrois dan at syz.com
Tue Mar 8 00:42:09 GMT 2011


I've spent the past several hours trying to find out out why some of my edits resulted in some accidental road removals.  I think I've found the problem, which seems to relate to an apparent bug in JOSM, or at least a preference somewhere set to something unintuitive that I haven't been able to find - as such, I thought it would be best to communicate with the group to see if anyone's experienced this problem before, or at least give a heads up as to what has been happening to me in case it's inadvertently happening to others.

I downloaded an area around the Beaumont, Alberta region to try and add some roads from Canvec that don't exist in OSM (roads which I could have sworn I've added when I worked on the same area a month or two ago).  I then saved this downloaded area, along with the changes I made, to an .osm file in JOSM.  I ran the Validator which found a few duplicate nodes and such.  Telling it to fix errors, it did its thing.  And then, I clicked on "warnings" and told it to fix those.  Lo and behold, some (though not all) of the roads I'd just added suddenly disappeared.  Since validation was the last step in my process before I uploaded the data, and I was often zoomed all the way out when I did so, I hadn't noticed this happen before, but it probably had been going on right before I uploaded my changes.  In particular, sometimes I would replace lower quality OSM roads with better Canvec data, and if JOSM was deleting some of those Canvec roads I'd added in its "fix warnings" validation step, those original OSM roads would have disappeared without replacements.

I tried to isolate further exactly what it was doing, and at least in this situation it looks like it may be related to unnamed ways.  I have 41 unnamed ways in my data.  If I click on the "unnamed ways" folder specifically in the "warnings" validation dialog, it doesn't give me the option to fix them - it shouldn't, since it doesn't know what to call them anyway.  But if I click on the parent (root) icon just labelled "Warnings", the fix button is enabled, and I thought it was just supposed to fix all the enclosed warnings in categories that it is able to fix.  When I click to "fix" all warnings like this, in the progress bar, I see that it spends some time "fixing" unnamed ways.  And then those ways are gone when it's done.

I was using JOSM 3751, so I checked for updates and found that 3961 was available.  I've updated my JOSM to see if it's still an issue.  But now, when I do the "global" fix warnings on the data set, it gets part way through, then consistently gives me an unexpected exception (coding error).  When I dismiss that dialog, I find that those roads have again been removed, so it seems as though this is still a problem.  The unexpected exception isn't encouraging either.

I suppose that I can work around the problem by selectively choosing "fix" in the validations warning area for each of the separate categories, instead of doing them all at once.  Though now I'm unsure as to whether or not there is still an underlying problem with fixing warnings that may give rise to an inadvertent loss of data.  At the very least, I wanted to make a posting about it so that others can be warned away from having the same problems I have run into.

If anyone is interested in trying to duplicate the problems I'm having, just let me know your email address and I can send you the .osm file I'm working with (compressed, it's about 600 kB).  And of course, if anyone has any ideas, or suggestions about something stupid I'm doing, please let me know!

Dan
--
Syzygy Research & Technology
Box 83, Legal, AB  T0G 1L0 Canada
Phone: 780-961-2213




More information about the Talk-ca mailing list