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

Fix RDP recursion bug #941

Closed
wants to merge 2 commits into from
Closed

Fix RDP recursion bug #941

wants to merge 2 commits into from

Conversation

urschrei
Copy link
Member

Fixes #940

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

@michaelkirk
Copy link
Member

LGTM - feel free to merge with or without the unit test.

I'll plan to include it in #937.

@frewsxcv
Copy link
Member

frewsxcv commented Nov 30, 2022

Thoughts on adding a debug_assert_ne!(farthest_index, 0) after line 85? To let the reader know we never expect it to be 0, and to prevent stack overflows from happening, and to indicate users to report a bug if this is encountered.

urschrei added a commit to urschrei/geo that referenced this pull request Dec 2, 2022
@urschrei
Copy link
Member Author

urschrei commented Dec 2, 2022

My debug assertion is now causing test failures. Sigh.

@frewsxcv
Copy link
Member

frewsxcv commented Dec 2, 2022

My debug assertion is now causing test failures. Sigh.

I was wondering if this would be the case 😅 Did you have time to look into why it's 0?

@urschrei
Copy link
Member Author

urschrei commented Dec 3, 2022

Not yet. Tomorrow!

michaelkirk pushed a commit that referenced this pull request Dec 6, 2022
@michaelkirk michaelkirk mentioned this pull request Dec 6, 2022
2 tasks
@michaelkirk
Copy link
Member

Did you have time to look into why it's 0?

I took a stab at this in #950

Seems like the issue was just the degenerate case when we recurse to simplify a two coordinate line segment.

bors bot added a commit that referenced this pull request Dec 6, 2022
950: Fix RDP recursion bug #2 r=urschrei a=michaelkirk

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/main/CODE_OF_CONDUCT.md).
- [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---

Supersedes #941

I rebased #940 against main to include #942 and added a guard to avoid the spurious assertion failure introduced in c61abfa



Co-authored-by: Stephan Hügel <[email protected]>
Co-authored-by: Michael Kirk <[email protected]>
@frewsxcv
Copy link
Member

frewsxcv commented Dec 7, 2022

Fixed in #950 Thank you @urschrei and @michaelkirk !

@frewsxcv frewsxcv closed this Dec 7, 2022
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.

BUG: Infinite recursion in compute_rdp with easy fix
3 participants