Id: Cannot draw areas, leads to crash. Reproducible

Created on 28 Feb 2019  Â·  7Comments  Â·  Source: openstreetmap/iD

Since today I cannot draw areas anymore. It always leads to a crash.
I can place 3 points and on the fourth it is crashing - reproducible...

When I'm home I will post a screencast.

User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
bug

Most helpful comment

I just fixed this! This was a fun bug.
Clicking on point 3 would change its parent way by adding a new vertex, then clicking on point 4 would crash. It only happens when you click on an empty spot along a way adjacent to a vertex with an intersection and then click on that intersection.

Root cause was this:
While drawing, we do some funny things to the graph - to pop off and replace temporary drawing objects with real ones. Every time the graph would change, it would dispatch a change event, which would trigger a redraw of some things. In this case, one of those things was the sidebar for point 4, which (because it was an intersection) redraw the restrictions editor, and because the graph was in a weird state, the restriction editor was not happy.

I solved it by adding some functions to iD.coreHistory to pause and resume the dispatching of change events. It's not the first time I've come across this issue, and we might use it other places in the code.

(I might get rid of coreHistory.overwrite, as it was created to solve pretty much the same problem - avoid dispatching an expensive change event through a pop/perform).

All 7 comments

When I try to create an area here: https://www.openstreetmap.org/#map=19/48.29083/11.57035
like this
crash
it is crashing every time.

Anyone?
This problem seems to be related to the highways. Can someone else confirm?

For me this crashes under Windows and Linux (both firefox tho).

Just tried on Firefox (65.0.1) WIN10 and I had no trouble creating an area with connections to highways in that exact locations.

Perhaps give us some more details – when does it crash – creating third point, when saving?

Cheers - Phil

From: famo [mailto:[email protected]]
Sent: Tuesday, 5 March 2019 8:20 PM
To: openstreetmap/iD
Cc: Subscribed
Subject: Re: [openstreetmap/iD] Cannot draw areas, leads to crash. Reproducible (#5996)

Anyone?
This problem seems to be related to the highways. Can someone else confirm?

For me this crashes under Windows and Linux (both firefox tho).

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/openstreetmap/iD/issues/5996#issuecomment-469603265 , or mute the thread https://github.com/notifications/unsubscribe-auth/AIXm4w0a_WYEkxIZvkuncwayrl7lJB3Hks5vTjatgaJpZM4bW9Sh . https://github.com/notifications/beacon/AIXm4weh19gpsVNHFC4_XfJA7yQfW9-6ks5vTjatgaJpZM4bW9Sh.gif

It crahes upon choosing the fourth point (see attached image), while still in drawing mode.
53635577-d82c2280-3c1d-11e9-8e9e-87e75e5b5ff1

Ok – it doesn’t crash but it doesn’t like it when ‘snapping to the existing node’ on the highway. Is that what you are experiencing? I then need to reset the browser (and not save changes) to get back in to use the editor.

Is that the same issue? Try without snapping to an existing node – does it then work. Looks like a bug of some sort.

Cheers - Phil

From: famo [mailto:[email protected]]
Sent: Tuesday, 5 March 2019 9:12 PM
To: openstreetmap/iD
Cc: Phil Wyatt; Comment
Subject: Re: [openstreetmap/iD] Cannot draw areas, leads to crash. Reproducible (#5996)

It crahes upon choosing the fourth point (see attached image), while still in drawing mode.
https://user-images.githubusercontent.com/692646/53797911-74646b00-3f37-11e9-8acb-781216017252.PNG 53635577-d82c2280-3c1d-11e9-8e9e-87e75e5b5ff1

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/openstreetmap/iD/issues/5996#issuecomment-469621960 , or mute the thread https://github.com/notifications/unsubscribe-auth/AIXm47gQ_Ih33shWBbL_aWHtzk7_xikQks5vTkL5gaJpZM4bW9Sh . https://github.com/notifications/beacon/AIXm45xDOORxOQ9qMS70J-iptnpjvEzIks5vTkL5gaJpZM4bW9Sh.gif

Ok – it doesn’t crash but it doesn’t like it when ‘snapping to the existing node’ on the highway. Is that what you are experiencing? I then need to reset the browser (and not save changes) to get back in to use the editor. Is that the same issue?

Yes, this is exactly the issue!
(By "crash" I meant that the iD editor is "crashing" - not the browser. Sorry, that wasn't formulated very clearly by me.)

Try without snapping to an existing node – does it then work.

Yes, then it works.

Looks like a bug of some sort.

My words...

I just fixed this! This was a fun bug.
Clicking on point 3 would change its parent way by adding a new vertex, then clicking on point 4 would crash. It only happens when you click on an empty spot along a way adjacent to a vertex with an intersection and then click on that intersection.

Root cause was this:
While drawing, we do some funny things to the graph - to pop off and replace temporary drawing objects with real ones. Every time the graph would change, it would dispatch a change event, which would trigger a redraw of some things. In this case, one of those things was the sidebar for point 4, which (because it was an intersection) redraw the restrictions editor, and because the graph was in a weird state, the restriction editor was not happy.

I solved it by adding some functions to iD.coreHistory to pause and resume the dispatching of change events. It's not the first time I've come across this issue, and we might use it other places in the code.

(I might get rid of coreHistory.overwrite, as it was created to solve pretty much the same problem - avoid dispatching an expensive change event through a pop/perform).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tordans picture tordans  Â·  3Comments

tordans picture tordans  Â·  3Comments

manfredbrandl picture manfredbrandl  Â·  3Comments

jidanni picture jidanni  Â·  3Comments

mvl22 picture mvl22  Â·  3Comments