Skip to content
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

-fno-rtti causes read of zero page address #122

Open
melg8 opened this issue Dec 14, 2024 · 0 comments
Open

-fno-rtti causes read of zero page address #122

melg8 opened this issue Dec 14, 2024 · 0 comments

Comments

@melg8
Copy link

melg8 commented Dec 14, 2024

If you build first example from readme with flags:

-std=c++20 -fsanitize=address -fno-rtti

And run bench test. You will get report from sanitizer about READ on zero page address.

Caused by this source line:

os.imbue(std::locale(os.getloc(), new NumSep(',')));

Seems that std::locale call under -fno-rtti is triggering this problem. I found simmilar issue on stack overflow c-locale-without-rtti

Reproducible on https://godbolt.org/z/qYfMbsjG3

I didn't found in documentation that nanobench requires rtti to be running properly. And it would be nice not to get ub when rtti is disabled.

As workaround rtti can be just enabled for bench tests alone, but this can in theory affect results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant