-
Notifications
You must be signed in to change notification settings - Fork 1k
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
False negative with stack slot reuse #590
Comments
Reported by - _Attachment: [lifetime.patch](https://storage.googleapis.com/google-code-attachments/memory-sanitizer/issue-87/comment-1/lifetime.patch)_ - _Attachment: [lifetime-cfe.patch](https://storage.googleapis.com/google-code-attachments/memory-sanitizer/issue-87/comment-1/lifetime-cfe.patch)_ |
@davidben FYI |
@eugenis: Any progress on this? |
No. |
Re-uploaded the patch for posterity. |
llvm-git-migration
pushed a commit
to llvm/llvm-project
that referenced
this issue
Apr 30, 2019
Summary: When a variable goes into scope several times within a single function or when two variables from different scopes share a stack slot it may be incorrect to poison such scoped locals at the beginning of the function. In the former case it may lead to false negatives (see google/sanitizers#590), in the latter - to incorrect reports (because only one origin remains on the stack). If Clang emits lifetime intrinsics for such scoped variables we insert code poisoning them after each call to llvm.lifetime.start(). If for a certain intrinsic we fail to find a corresponding alloca, we fall back to poisoning allocas for the whole function, as it's now impossible to tell which alloca was missed. The new instrumentation may slow down hot loops containing local variables with lifetime intrinsics, so we allow disabling it with -mllvm -msan-handle-lifetime-intrinsics=false. Reviewers: eugenis, pcc Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60617 llvm-svn: 359536
dtzWill
pushed a commit
to llvm-mirror/llvm
that referenced
this issue
Apr 30, 2019
Summary: When a variable goes into scope several times within a single function or when two variables from different scopes share a stack slot it may be incorrect to poison such scoped locals at the beginning of the function. In the former case it may lead to false negatives (see google/sanitizers#590), in the latter - to incorrect reports (because only one origin remains on the stack). If Clang emits lifetime intrinsics for such scoped variables we insert code poisoning them after each call to llvm.lifetime.start(). If for a certain intrinsic we fail to find a corresponding alloca, we fall back to poisoning allocas for the whole function, as it's now impossible to tell which alloca was missed. The new instrumentation may slow down hot loops containing local variables with lifetime intrinsics, so we allow disabling it with -mllvm -msan-handle-lifetime-intrinsics=false. Reviewers: eugenis, pcc Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60617 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359536 91177308-0d34-0410-b5e6-96231b3b80d8
This is fixed in https://reviews.llvm.org/D60617, but we also need to remove a check in shouldEmitLifetimeMarkers(). |
earl
pushed a commit
to earl/llvm-mirror
that referenced
this issue
Apr 30, 2019
Summary: When a variable goes into scope several times within a single function or when two variables from different scopes share a stack slot it may be incorrect to poison such scoped locals at the beginning of the function. In the former case it may lead to false negatives (see google/sanitizers#590), in the latter - to incorrect reports (because only one origin remains on the stack). If Clang emits lifetime intrinsics for such scoped variables we insert code poisoning them after each call to llvm.lifetime.start(). If for a certain intrinsic we fail to find a corresponding alloca, we fall back to poisoning allocas for the whole function, as it's now impossible to tell which alloca was missed. The new instrumentation may slow down hot loops containing local variables with lifetime intrinsics, so we allow disabling it with -mllvm -msan-handle-lifetime-intrinsics=false. Reviewers: eugenis, pcc Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60617 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359536 91177308-0d34-0410-b5e6-96231b3b80d8
dylanmckay
pushed a commit
to dylanmckay/llvm
that referenced
this issue
May 16, 2019
Summary: When a variable goes into scope several times within a single function or when two variables from different scopes share a stack slot it may be incorrect to poison such scoped locals at the beginning of the function. In the former case it may lead to false negatives (see google/sanitizers#590), in the latter - to incorrect reports (because only one origin remains on the stack). If Clang emits lifetime intrinsics for such scoped variables we insert code poisoning them after each call to llvm.lifetime.start(). If for a certain intrinsic we fail to find a corresponding alloca, we fall back to poisoning allocas for the whole function, as it's now impossible to tell which alloca was missed. The new instrumentation may slow down hot loops containing local variables with lifetime intrinsics, so we allow disabling it with -mllvm -msan-handle-lifetime-intrinsics=false. Reviewers: eugenis, pcc Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60617 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359536 91177308-0d34-0410-b5e6-96231b3b80d8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally reported on Google Code with ID 87
Reported by
eugenis@chromium.org
on 2015-03-02 11:46:01The text was updated successfully, but these errors were encountered: