-
Notifications
You must be signed in to change notification settings - Fork 120
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
Mute an UBSan check error for SCOPED_LOCK macro #283
Merged
lihuiba
merged 1 commit into
alibaba:release/0.7
from
beef9999:beef9999/fix-scope-lock-UBSan-check
Dec 5, 2023
Merged
Mute an UBSan check error for SCOPED_LOCK macro #283
lihuiba
merged 1 commit into
alibaba:release/0.7
from
beef9999:beef9999/fix-scope-lock-UBSan-check
Dec 5, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -72,8 +72,6 @@ inline int posix_memalign(void** memptr, size_t alignment, size_t size) { | |||
by target vcpu in resume_thread(), when its runq becomes empty; | |||
*/ | |||
|
|||
#define SCOPED_MEMBER_LOCK(x) SCOPED_LOCK(&(x)->lock, ((bool)x) * 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when x is null, it doesn't actually do the locking.
lihuiba
approved these changes
Dec 5, 2023
beef9999
added a commit
that referenced
this pull request
Dec 5, 2023
lihuiba
pushed a commit
that referenced
this pull request
Dec 6, 2023
* Mute an UBSan check error for SCOPED_LOCK macro (#283) * io: support reset photon at fork (#282) In photon context, event engine based module need reset after fork, if exec will not be called after fork. This is implicitly done by pthread_atfork hook. Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> --------- Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> Co-authored-by: Bob Chen <beef9999@qq.com> Co-authored-by: yuchen0cc <91253032+yuchen0cc@users.noreply.github.com>
lihuiba
pushed a commit
that referenced
this pull request
Dec 12, 2023
* Mute an UBSan check error for SCOPED_LOCK macro (#283) * io: support reset photon at fork (#282) In photon context, event engine based module need reset after fork, if exec will not be called after fork. This is implicitly done by pthread_atfork hook. Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> * RPC support graceful shutdown --------- Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> Co-authored-by: Bob Chen <beef9999@qq.com> Co-authored-by: yuchen0cc <91253032+yuchen0cc@users.noreply.github.com>
lihuiba
added a commit
that referenced
this pull request
Dec 16, 2023
* Mute an UBSan check error for SCOPED_LOCK macro (#283) * io: support reset photon at fork (#282) In photon context, event engine based module need reset after fork, if exec will not be called after fork. This is implicitly done by pthread_atfork hook. Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> * RPC support graceful shutdown * fs: support xattr for extfs and subfs (#298) Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> * Sequential mutex (#294) seq_mutex * exit(0) requires stdlib.h (#303) * fix e2fs include dir name (#301) Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> * [feat] http client with cert Signed-off-by: zhuangbowei.zbw <zhuangbowei.zbw@alibaba-inc.com> --------- Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> Signed-off-by: zhuangbowei.zbw <zhuangbowei.zbw@alibaba-inc.com> Co-authored-by: Bob Chen <beef9999@qq.com> Co-authored-by: yuchen0cc <91253032+yuchen0cc@users.noreply.github.com> Co-authored-by: Huiba Li <lihuiba@gmail.com> Co-authored-by: zhuangbowei.zbw <zhuangbowei.zbw@alibaba-inc.com> Co-authored-by: Lanzheng Liu <lanzheng.liulz@alibaba-inc.com>
lihuiba
added a commit
that referenced
this pull request
Dec 18, 2023
* Mute an UBSan check error for SCOPED_LOCK macro (#283) * io: support reset photon at fork (#282) In photon context, event engine based module need reset after fork, if exec will not be called after fork. This is implicitly done by pthread_atfork hook. Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> * RPC support graceful shutdown * fs: support xattr for extfs and subfs (#298) Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> * Sequential mutex (#294) seq_mutex * exit(0) requires stdlib.h (#303) * fix e2fs include dir name (#301) Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> * [feat] http client with cert Signed-off-by: zhuangbowei.zbw <zhuangbowei.zbw@alibaba-inc.com> * minor fix for std-compat (#307) * minor fix for std-compat * rpc::string add empty method * set io_uring eventfd non-blocking --------- Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com> Signed-off-by: zhuangbowei.zbw <zhuangbowei.zbw@alibaba-inc.com> Co-authored-by: Bob Chen <beef9999@qq.com> Co-authored-by: yuchen0cc <91253032+yuchen0cc@users.noreply.github.com> Co-authored-by: Huiba Li <lihuiba@gmail.com> Co-authored-by: zhuangbowei.zbw <zhuangbowei.zbw@alibaba-inc.com> Co-authored-by: Lanzheng Liu <lanzheng.liulz@alibaba-inc.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous SCOPED_MEMBER_LOCK will visit member address even if the object itself is nullptr.
This behavior will cause an runtime error in the UndefinedBehaviorSanitizer check (https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html), although the compiler didn't regard it as a warning.
Removed SCOPED_MEMBER_LOCK, luckily this is the only usage in the whole project.