<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82500>82500</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
How to disable a rule on std lib?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tony-go
</td>
</tr>
</table>
<pre>
Hi Everyone 👋🏼
I experience this error with UBSAN:
```
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/hash.h:107:40: runtime error: left shift of 7308895138221481827 by 48 places cannot be represented in type 'unsigned long'
```
So, I'd like to exclude the shift rule for this specific (as I don't have control over it).
So, as the documentation mention, I tried to pass a suppression file as `UBSAN_OPTIONS`:
```
shift-base:hash.h
shift-exponent:hash.h
```
It did not exclude the error, my first attempt was:
```
shift:hash.h
```
Then the compiler spits an error:
```
UndefinedBehaviorSanitizer: failed to parse suppressions
```
I probably should have noticed something. It's probably the path, tho.
---
Full log:
```
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/hash.h:107:40: runtime error: left shift of 7308895138221481827 by 48 places cannot be represented in type 'unsigned long'
#0 0x104d94f5c in std::__1::__murmur2_or_cityhash<unsigned long, 64ul>::__rotate_by_at_least_1(unsigned long, int) hash.h:107
#1 0x104d93094 in std::__1::__murmur2_or_cityhash<unsigned long, 64ul>::__hash_len_0_to_16(char const*, unsigned long) hash.h:132
#2 0x104d91cf0 in std::__1::__murmur2_or_cityhash<unsigned long, 64ul>::operator()(void const*, unsigned long) hash.h:226
#3 0x104d91c50 in unsigned long std::__1::__do_string_hash[abi:v15006]<char const*>(char const*, char const*) char_traits.h:920
#4 0x104d903f0 in std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const string:4565
#5 0x104d9ac9c in std::__1::__hash_const_iterator<std::__1::__hash_node<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, void*>*> std::__1::__hash_table<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const __hash_table:2333
#6 0x104d9aac8 in unsigned long std::__1::__hash_table<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::__count_unique<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const __hash_table:2515
#7 0x104d9a93c in std::__1::unordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::count[abi:v15006](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const unordered_set:798
#8 0x104d1973c in testing::internal::(anonymous namespace)::UnitTestFilter::MatchesName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const gtest.cc:781
#9 0x104d6cac4 in testing::internal::UnitTestImpl::GetTestSuite(char const*, char const*, void (*)(), void (*)()) gtest.cc:5766
#10 0x104d37dc0 in testing::internal::UnitTestImpl::AddTestInfo(void (*)(), void (*)(), testing::TestInfo*) gtest-internal-inl.h:690
#11 0x104d37810 in testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*) gtest.cc:2771
#12 0x104cd8e90 in __cxx_global_var_init engine_binding_test.cc:32
#13 0x104cd9dc8 in _GLOBAL__sub_I_engine_binding_test.cc engine_binding_test.cc
#14 0x18157c1d4 (<unknown module>)
#15 0x1815bde90 (<unknown module>)
#16 0x1815b11a0 (<unknown module>)
#17 0x18155c2d4 (<unknown module>)
#18 0x1815b01c8 (<unknown module>)
#19 0x1815bd954 (<unknown module>)
#20 0x181578858 (<unknown module>)
#21 0x181578c0c (<unknown module>)
#22 0x18157c260 (<unknown module>)
#23 0x181578d8c (<unknown module>)
#24 0x18159c980 (<unknown module>)
#25 0x1815612cc (<unknown module>)
#26 0x18155fe14 (<unknown module>)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__functional/hash.h:107:40 in
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWVFv2zgS_jX0C2FDpCxLevCD4tS7wW3axaYF9p4EihxZvNKkVqSc-H79gbLkWKmTOofiksUVMByZ5Mx8880MoyGZtXKjAZYoukLR9YS1rjLN0hm9n27MpDBiv_xV4g87aPZGA0brAKVrlBKUXPXPyRpdrTAKrlGQHb5vMDzU0EjQHLCrpMXQNKbB99JV-MvVXfYRhdmpAFoE_efwk66zulaSMyeNtoiu_-RGwIzVNaLrldEOtPPD17ADZWpoEF3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