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

Accessor boundary check #178

Merged
merged 1 commit into from
Jun 21, 2023
Merged

Accessor boundary check #178

merged 1 commit into from
Jun 21, 2023

Conversation

facuMH
Copy link
Contributor

@facuMH facuMH commented Apr 25, 2023

This PR depends on #173

This check has proven quite useful when debugging, hence adding only for debug builds since it can also have a non negligible impact on performance, after all it happens for all accessor subscriptor operators.

Not sure if just reporting it as a CELERITY_ERROR is enough or if it would also be expected for it to exit and report it as a fatal error or similar.

@facuMH facuMH requested review from psalz and fknorr April 25, 2023 11:18
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

include/accessor.h Outdated Show resolved Hide resolved
include/accessor.h Outdated Show resolved Hide resolved
@facuMH facuMH force-pushed the acc_bound_check branch from 8345698 to f2e4d9c Compare May 3, 2023 13:09
github-actions[bot]

This comment was marked as outdated.

@facuMH facuMH force-pushed the acc_bound_check branch from 5009be5 to e3aa503 Compare June 5, 2023 11:38
github-actions[bot]

This comment was marked as outdated.

@facuMH facuMH force-pushed the acc_bound_check branch from e3aa503 to cc51408 Compare June 5, 2023 12:05
@facuMH facuMH requested a review from PeterTh June 5, 2023 12:23
github-actions[bot]

This comment was marked as outdated.

@facuMH facuMH marked this pull request as ready for review June 6, 2023 12:28
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

include/accessor.h Outdated Show resolved Hide resolved
Copy link
Member

@psalz psalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this will make life a lot easier! I've added some (mostly minor) notes; I think my biggest concern would be that the current implementation only checks against the backing buffer size, not what the user declared they plan on accessing (so whether or not the OOB check gets triggered could be dependent on scheduling decisions).

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
include/accessor.h Outdated Show resolved Hide resolved
include/host_object.h Outdated Show resolved Hide resolved
src/worker_job.cc Outdated Show resolved Hide resolved
src/worker_job.cc Outdated Show resolved Hide resolved
include/accessor.h Outdated Show resolved Hide resolved
include/accessor.h Outdated Show resolved Hide resolved
include/worker_job.h Outdated Show resolved Hide resolved
include/worker_job.h Outdated Show resolved Hide resolved
@psalz psalz added this to the 0.4.0 milestone Jun 13, 2023
@facuMH facuMH force-pushed the acc_bound_check branch from 1e4351c to 8e061cc Compare June 15, 2023 08:51
include/accessor.h Outdated Show resolved Hide resolved
test/accessor_tests.cc Outdated Show resolved Hide resolved
test/accessor_tests.cc Outdated Show resolved Hide resolved
test/accessor_tests.cc Outdated Show resolved Hide resolved
src/worker_job.cc Outdated Show resolved Hide resolved
src/worker_job.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@PeterTh PeterTh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a huge fan of this PR. Only some minor comments on top of what psalz mentioned.

include/accessor.h Outdated Show resolved Hide resolved
include/closure_hydrator.h Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/worker_job.cc Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

test/accessor_tests.cc Outdated Show resolved Hide resolved
@facuMH facuMH force-pushed the acc_bound_check branch from e2f76a3 to 2725eb1 Compare June 21, 2023 13:15
This adds a new CMake option and preprocessor macro
`CELERITY_ACCESSOR_BOUNDARY_CHECK` to enable out-of-bounds checking
inside accessors. The option is enabled by default in debug builds.
@psalz psalz force-pushed the acc_bound_check branch from 2725eb1 to a681b38 Compare June 21, 2023 17:09
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

test/accessor_tests.cc Show resolved Hide resolved
@psalz psalz merged commit 2c738c8 into master Jun 21, 2023
@psalz psalz deleted the acc_bound_check branch June 21, 2023 22:38
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.

3 participants