OpenStreetMap

Bugfixing terracer: 9. Be Careful What You Wish For

Posted by alexkemp on 17 January 2017 in English. Last updated on 26 January 2017.
  1. There May be Troubles Ahead
  2. Errors whilst Compiling using Ant
  3. Creating Eclipse Project
  4. Eclipse Debugging Routines
  5. wORD cASE bLINDNESS
  6. Importing the Project Bugs
  7. Have you Tried Restarting Your Program, Sir?
  8. Show Your Bugs, Damn You!
  9. Be Careful What You Wish For
  10. Installing NetBeans

Sure enough, after working my way up Besecar Avenue I reached Phoenix Avenue and Boom! as I tried to create a new semi-detached house on the corner of Besecar & Phoenix terracer throws an exception. I did not mind that, but Eclipse carried on as if nothing had happened. Now, that is truly mean!

In my earlier Diary (7) Eclipse was accurately debugging on JOSM exceptions thrown by JOSM core. How do I launch JOSM from Eclipse so that Eclipse will react to exceptions thrown by JOSM plugins?

Gaah!

Location: Gedling, Carlton, Gedling, Nottinghamshire, England, NG4 4BH, United Kingdom

Discussion

Comment from R0bst3r on 18 January 2017 at 06:44

If you got a stacktrace then put a breakpoint to each line mentioned in the output and start JOSM out of eclipse in debug mode (the bug icon). Redo your previous clicking actions in JOSM.

Now you can see step by step where the exception comes from and you can check the variables.

Comment from alexkemp on 21 January 2017 at 03:12

Hi @R0bst3r

Sorry for the delay in my response; after ~6 weeks I can finally go to bed & not have an hour of cough cough cough (last night). The night before I could not sleep all night due to my coughing, yet the following night I was OK. Anyway, I’m good now.

There is a full stack-trace in ticket-14261.

  • Exception seems to be thrown at OsmPrimitive.java:244 (/josm/core/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java)

      public void checkDataset() {
         if (dataSet == null)
         throw new DataIntegrityProblemException("Primitive must be part of the dataset: " + toString());
      }
    

I’m concerned that if I place a breakpoint in OsmPrimitive.java, then I will have to resume on every single house-creation (it took creating >30 last time before JOSM threw the exception, and took a couple of hours to enter).

The issue, of course, is to know why the dataSet is NUL.

Ah well, I am feeling stronger now, so I’ll have a go after a sleep. What I’m trying to find out at this moment is why previously the debug screens came up when the exception was triggered within JOSM core, but not now when it is triggered by an issue within terracer.

Thanks for your response. I’ll post again when I get some results (I’m hoping to see my grandkids soon so it may be a few days hence).

Comment from alexkemp on 21 January 2017 at 17:17

@R0bst3r

I’ve just completed adding all the houses I had left from the last survey (17 sets of terraces + 1 set of garages); it was not enough to trip an exception. I’ll have to survey some more & try again.

I placed breakpoints at:-

  • OsmPrimitive.java:244 (a certain exception)
  • OsmPrimitive.java:988 (previous step in the stacktrace)
  • TerracerAction.java:473 (top-level in terracer stacktrace)

As fully expected, it stopped at OsmPrimitive.java:988 before completing startup. I tried stepping through using f5 but eventually had to resume using f8. That also continually stopped at OsmPrimitive.java:988 & eventually I determined that I would commit suicide before ever reaching the point of being able to add another house. So, I toggled the OsmPrimitive.java:988 breakpoint enablement, pressed f8 & added all the houses I had left from my last survey.

Comment from alexkemp on 26 January 2017 at 00:16

@R0bst3r

I’ve now spent 3 days adding 100 terraces (sets of houses, NOT 100 individual houses) and it hasn’t thrown an exception at any point. I’m giving up on Eclipse. If I can bugfix with Netbeans then I’ll work on terracer, else will forget it completely (can you tell that I’m truly pissed off?).

Comment from R0bst3r on 26 January 2017 at 07:29

Look on the bright side, no exception means also no error. Next time you get an error you can maybe log the stacktrace and find the problem. Either with Eclipse or with Netbeans or with some other tools.

Good work either! I’m now starting my daily work … debugging other persons problems. :)

Comment from alexkemp on 26 January 2017 at 10:26

You are, of course, correct @R0bst3r. However, there are lots of non-fatal bugs to fix in terracer but I cannot find any way to include it within a debug session.

My last hope was for an exception to be thrown, and for the stacktrace to be able to auto-switch from JOSM to terracer. No chance.

Log in to leave a comment