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

assert if possible when undefined behavior occurs #315

Closed
shintaro-iwasaki opened this issue Mar 23, 2021 · 0 comments · Fixed by #335
Closed

assert if possible when undefined behavior occurs #315

shintaro-iwasaki opened this issue Mar 23, 2021 · 0 comments · Fixed by #335

Comments

@shintaro-iwasaki
Copy link
Collaborator

shintaro-iwasaki commented Mar 23, 2021

Argobots defines when undefined behaviors can happen, but this is not very user friendly. If possible, Argobots should warn users when a debug option is true so that user can easily find and fix the cause of undefined behavior. The idea is that, since the behavior is undefined in such a case, that behavior can be an assertion when a debug option is enabled. Undefined-behavior checks are expensive, so they will be removed for a non-debug configuration.

Examples of when undefined behaviors happen:

  • Passing NULL
  • Double-freeing an Argobots object (e.g., ABT_pool)
  • Double-joining a ULT
  • Explicitly freeing an automatic scheduler/pool
  • Explicitly freeing a pool of the primary execution stream.

Note that this detection is neither mandatory nor strict since it causes "undefined behavior". Argobots should do the best to show a useful error message rather than incur an error somewhere else, but the user should not expect assertion.

See this thread for related discussion: https://lists.argobots.org/pipermail/discuss/2021-March/000103.html

@shintaro-iwasaki shintaro-iwasaki changed the title assert if undefined behavior is detected assert if possible when undefined behavior occurs Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant