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 for failure to convert boundary_id_type #24950

Closed
roystgnr opened this issue Jul 11, 2023 · 0 comments · Fixed by #24951
Closed

Check for failure to convert boundary_id_type #24950

roystgnr opened this issue Jul 11, 2023 · 0 comments · Fixed by #24951
Assignees
Labels
T: task An enhancement to the software.

Comments

@roystgnr
Copy link
Contributor

Reason

For efficiency we still default boundary_id_type to 16-bit (signed, for some reason...), so users can easily manually specify a BoundaryName which is an integer (so we try to convert it to an id directly rather than treating it as a string name) but which fails to fit in boundary_id_type (so conversion via istream just gives us 2^15-1) ... and when this happens we don't test for failure afterward.

Design

Check the failbit on that istream, scream an informative error message and die if it's set.

Impact

It's possible for a user's input file to be fine with the current behavior, which would produce e.g. a boundary name of "40000" attached to a boundary id of 32767, which doesn't inherently break anything. But I suspect any users who have so narrowly avoided being bitten by this bug will be fine changing their files to accommodate its fix.

@roystgnr roystgnr added the T: task An enhancement to the software. label Jul 11, 2023
@roystgnr roystgnr self-assigned this Jul 11, 2023
roystgnr added a commit to roystgnr/moose that referenced this issue Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: task An enhancement to the software.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant