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

Compilation bug in >= 1.76 from detail::overlay::collinear::handle_as_equal #1139

Closed
kb0n opened this issue Apr 21, 2023 · 3 comments · Fixed by #1142
Closed

Compilation bug in >= 1.76 from detail::overlay::collinear::handle_as_equal #1139

kb0n opened this issue Apr 21, 2023 · 3 comments · Fixed by #1142
Assignees
Labels

Comments

@kb0n
Copy link

kb0n commented Apr 21, 2023

I experience some problems when adapting Lanelet2 library to boost v1.78.0 , one of which is caused by a bug introduced with release v1.76.0 and has not been fixed yet.

When was this introduced

Introduced with 84d3a8d, specifically this line: 84d3a8d#diff-21d011ddccb292362e430e14bebe3673bfa5e10f432ee3a85ede067fe8f140c6R993 which is still existing in the latest boost version as well.

Identified issue

You're using a conditional operator, but range_q and range_p can be of a different type.

In my case, they were Eigen::Matrix<double, 2, 1> and Eigen::Matrix<double, 2, 1, 2>, i.e. aligned and non-aligned 2D Eigen-vectors.

Proposed fix

The fix is quite simple. This would be a proposal for the current version, but applicable to all other releases as well

-        auto const dm = fun::distance_measure(info.intersections[1],
-                arrival_p == 1 ? range_q.at(1) : range_p.at(1));
+        auto const dm = arrival_p == 1
+               ? fun::distance_measure(info.intersections[1], range_q.at(1))
+               : fun::distance_measure(info.intersections[1], range_p.at(1));

It would be nice if this could be backported to all affected revisions as well with a patch-release. I personally would be happy if this was provided "only" from v1.78.0 onward.

@kb0n
Copy link
Author

kb0n commented Apr 21, 2023

Of course this is only what I have perceived so far.

I'll re-trigger this error for a more precise error-message.

@barendgehrels
Copy link
Collaborator

Hi, I cannot reproduce that. Can you verify it still occurs in 1.82?
However, I have no problems applying your fix and will do.
But we won't backport it, because we cannot update previous versions of the whole Boost library because of this bug.

@barendgehrels barendgehrels self-assigned this Apr 23, 2023
@barendgehrels
Copy link
Collaborator

Now I can reproduce it, if coordinate type is also different. But get more (similar) problems. Will be fixed.

barendgehrels added a commit to barendgehrels/geometry that referenced this issue Apr 23, 2023
This fixes boostorg#1139 , and more required code changes.

Including unit test.
barendgehrels added a commit to barendgehrels/geometry that referenced this issue Apr 29, 2023
This fixes boostorg#1139 , and more required code changes.

Including unit test.
barendgehrels added a commit to barendgehrels/geometry that referenced this issue May 8, 2023
This fixes boostorg#1139 , and more required code changes.

Including unit test.
barendgehrels added a commit that referenced this issue May 8, 2023
This fixes #1139 , and more required code changes.

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

Successfully merging a pull request may close this issue.

2 participants