Issue 208654
Summary [compiler-rt][tysan] False positives with Boost static_vector
Labels
Assignees
Reporter onurcan-isler-oss
    # `boost::static_vector`
#### Flags: `-stdlib=libc++ -fsanitize=type -O0` or `-stdlib=libc++ -fsanitize=type -O1`
#### Compiler: x86-64 clang 22.1.0
#### Link: https://godbolt.org/z/jM4M41avM
#### Code: 
```.cpp
#include <boost/container/static_vector.hpp>

int main() {
 static boost::container::static_vector<long, 128> v;
 v.emplace_back(2);
    v.emplace_back(1);
}

```
#### Logs:
```
==1==ERROR: TypeSanitizer: type-aliasing-violation on address 0x580d0ac6af28 (pc 0x580d0a310053 bp 0x7ffeed94c620 sp 0x7ffeed94c5b0 tid 1)
WRITE of size 8 at 0x580d0ac6af28 with type long accesses an existing object of type boost::container::static_vector<long, 128ul, void>
    #0 0x580d0a310052  (/app/output.s+0x37052)

==1==ERROR: TypeSanitizer: type-aliasing-violation on address 0x580d0ac6af30 (pc 0x580d0a3100dd bp 0x7ffeed94c620 sp 0x7ffeed94c5b0 tid 1)
WRITE of size 8 at 0x580d0ac6af30 with type long accesses part of an existing object of type boost::container::static_vector<long, 128ul, void> that starts at offset -8
 #0 0x580d0a3100dc  (/app/output.s+0x370dc)
```
#### Explanation:

Global/Static STL containers used to cause false positives in 20.1.0: https://godbolt.org/z/q3TsrK5c4
But fixed in 22.1.0: https://godbolt.org/z/1qE3z6eea
So, global/static boost containers seems not yet fixed.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to