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

98 Serialization sanitizer support #101

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from
Draft

Conversation

lifflander
Copy link
Contributor

@lifflander lifflander commented May 14, 2020

Fixes #98

Initial implémentation of stack-based checker using the clang tooling generated checks from:

https://github.com/DARMA-tasking/serialization-sanitizer

Copy link
Member

@PhilMiller PhilMiller left a comment

Choose a reason for hiding this comment

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

As written, does whatever 'top-level' object that's rooting a serialization call get properly checked? I'm not quite sure on the interplay of the serializer, the dispatcher, and the push and pop calls.

@PhilMiller
Copy link
Member

Also, I looked over the corresponding bits in the clang tool, and they seem reasonable.

@PhilMiller
Copy link
Member

There's a potential corner case of objects with empty-base optimizations in play, but that's so obscure as to likely be irrelevant.

@PhilMiller
Copy link
Member

This side of things all looks good to me.

@codecov
Copy link

codecov bot commented Dec 3, 2020

Codecov Report

Merging #101 (df15e22) into develop (ead66d9) will decrease coverage by 0.77%.
The diff coverage is 49.09%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #101      +/-   ##
===========================================
- Coverage    93.76%   92.98%   -0.78%     
===========================================
  Files           94       97       +3     
  Lines         2854     2909      +55     
===========================================
+ Hits          2676     2705      +29     
- Misses         178      204      +26     
Impacted Files Coverage Δ
examples/checkpoint_traversal.cc 100.00% <ø> (ø)
src/checkpoint/serializers/base_serializer.h 91.66% <ø> (-8.34%) ⬇️
tests/unit/test_traversal.cc 100.00% <ø> (ø)
src/checkpoint/serializers/sanitizer.impl.h 30.76% <30.76%> (ø)
src/checkpoint/serializers/sanitizer.h 44.44% <44.44%> (ø)
src/checkpoint/dispatch/dispatch.impl.h 95.74% <100.00%> (+0.09%) ⬆️
.../checkpoint/dispatch/dispatch_serializer_nonbyte.h 100.00% <100.00%> (ø)
src/checkpoint/serializers/sanitizer.cc 100.00% <100.00%> (ø)
... and 3 more

@lifflander
Copy link
Contributor Author

@PhilMiller @cz4rs Can you guys take a look at this? I've done a major overhaul of this code. I'm splitting up the concerns between the type-specific traversal for sanitization and the sanitizer runtime logic.

Checkpoint will contain the typed overloads at all times. This means one may use a stock VT/Checkpoint and then enable the sanitizer later.

The sanitizer runtime itself (checkpoint::sanitizer::runtime) will be in the other repository: https://github.com/DARMA-tasking/serialization-sanitizer

@lifflander lifflander changed the title 98 serialize checks 98 Serialization sanitizer support Dec 4, 2020
@lifflander
Copy link
Contributor Author

This won't be merged until the runtime is complete in the other repo and I confirm this is the correct interface that we need for that work properly.

/// pimpl to runtime that contains runtime sanitizer logic
extern Runtime* rt();

/// function that informs sanitizer if its enabled
Copy link
Member

Choose a reason for hiding this comment

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

Typo "it's"


// A bit of a trick...recurse with a non-sanitizing-specific overload to
// resolve actual \c serialize methods without invoking the partial
// specialization
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment may need more elaboration. I think I kinda get what's going on, but would prefer a full explanation.


bool enabled() {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to have this be a member of the Runtime object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These have to be C functions because they are LD preloaded by the serializer runtime.

Copy link
Member

Choose a reason for hiding this comment

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

Could you point me at where you picked up that constraint? That doesn't sound right to me, since LD_PRELOAD should just be importing whatever symbols it finds in a foo.so library into the list that ld.so will resolve against. If those are C function names or C++ mangled names shouldn't matter.

That said, this isn't a big deal.

@PhilMiller
Copy link
Member

Broadly, I think this looks very good. I'll be happy to see this tidied up and merged.

}

// Declare this member as serialized
checkpoint_sanitizer_rt()->isSerialized(
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be preferable to do auto rt = checkpoint_sanitizer_tr() once here, and then just rt->method()

@PhilMiller
Copy link
Member

PhilMiller commented Jan 19, 2021

One important check - does this work if one doesn't include the LD_PRELOAD?

Otherwise, I think this is ready to move forward, modulo my remarks about some comments and style.

Copy link
Contributor

@cz4rs cz4rs left a comment

Choose a reason for hiding this comment

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

looks good overall, I agree with Phil on "trick" part needing more explanation

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.

Implement runtime API traversal for clang serializer checking
3 participants