-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
<algorithm>
: minmax family are returning wrong match index and may crash
#4731
Labels
wontfix
This will not be worked on
Comments
AlexGuteniev
changed the title
<lagorithms>:
Jun 18, 2024
minmax
/ minmax_elemet
are returning wrong match index<algorithm>
: minmax
/ minmax_elemet
are returning wrong match index
AlexGuteniev
changed the title
Jun 18, 2024
<algorithm>
: minmax
/ minmax_elemet
are returning wrong match index<algorithm>
: minmax faimly are returning wrong match index
AlexGuteniev
changed the title
Jun 18, 2024
<algorithm>
: minmax faimly are returning wrong match index<algorithm>
: minmax faimly are returning wrong match index and may crash
AlexGuteniev
changed the title
Jun 18, 2024
<algorithm>
: minmax faimly are returning wrong match index and may crash<algorithm>
: minmax family are returning wrong match index and may crash
We talked about this at the weekly maintainer meeting and decided that the cases of all-nans or all-nans-except-one-plain-value aren't worth worrying about, and the Standard is vague on whether they're UB. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Vectorized minmax family functions return wrong index / value when input contains NaNs.
Generally when input contains NaN, the behavior is undefined, because f strict weak ordering violation.
However, if the input contains only NaN value elements or NaN value elements and only one non-NaN value elements, the behavior appears to be defined: the comparisons is all false, so the strict weak ordering is met.
The below modification of test case fails though.
Command-line test case
Expected behavior
The above test pass. The algorithm returns the result as per standard.
UB cases still may fail, any expectation are only about apparently valid cases.
STL version
18c09c4
Additional context
Originally reported in #3928 (comment)
The text was updated successfully, but these errors were encountered: