Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check to prevent panic #26

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Check to prevent panic #26

wants to merge 1 commit into from

Conversation

prathik
Copy link

@prathik prathik commented Dec 12, 2023

@tidwall I have added a check to prevent panics in the library, if I remove this check and you run the test, you can see the panic.

Do you have any recommendation on how we go about fixing this issue? If there are one set of coordinates with z coordinates and other without, they way the library handles it is to allocate the z coordinate values to the values that come first, instead of where the values actually should go.

I see few approaches:

  1. Arrange the coordinates in such a way that those have a z value would go to the right place, however this might see an issue with linear ring polygons that have some z values and others don't

  2. Assume a default z coordinate value if some have missing z values

  3. Refactor the way we store the ex.values array so that it also knows which particular entry should get the z coordinate.

@prathik
Copy link
Author

prathik commented Dec 12, 2023

@tidwall Just for context, we had inserted a polygon of this format in tile38 and on reading it - the panic caused the whole tile38 server to crash, so might be a good idea to fix this.

@prathik prathik marked this pull request as draft December 12, 2023 12:30
@tidwall
Copy link
Owner

tidwall commented Dec 12, 2023

Hi, I recommend filing an issue in Tile38 that includes the commands that caused the server to crash. That would make it easier for me to diagnose and fix.

@prathik
Copy link
Author

prathik commented Dec 18, 2023

@tidwall I've raised it here - tidwall/tile38#714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants