https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81068
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- The difference in results isn't very relevant. I'm pretty sure the reason for the sanitizer errors is that libstdc++.so isn't instrumented by the sanitizers. If you build libstdc++.so with UBsan you wouldn't get the errors (although last time I tried, building libstdc++.so with UBsan isn't possible due to compiler bugs).