-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Latest release (7.1.0) causes binskim errors #1966
Comments
@jk-jeon, do we actually need |
Not really, it's there just for the performance reason. But I have no idea why MSVC ever wants to put buffer overrun checks there. Dragonbox doesn't even use any pointers at all, except for the static cache array, which seems to be not the reason why MSVC thinks it is vulnerable; probably this is some bug related to intrinsics I guess. But well, I'm not a security expert, and if possible I hope someone who knows better than me about buffer overrun attacks could review the code. Security buffer check itself indeed does not cause any significant performance issue, but the real issue is that the feature seems to interfere with the inlining decision, thus can cause a pretty measurable performance drop. Again I guess this should be a bug, but well, there is nothing we can do with it so I disabled the (apparently, at least to me) needless checks. |
Would it make sense to use always inline instead? |
What I recall is that somehow the compiler sometimes rejected to inline a function marked with |
It turns out |
We're running binskim (https://github.com/microsoft/binskim) in our build process, which started to report errors with the latest fmt.lib release (7.1.0).
error BA2014: 'update.dll' is a C or C++ binary built with function(s) (fmt::v7::detail::dragonbox::to_decimal<float>;fmt::v7::detail::dragonbox::to_decimal<double>) that disable the stack protector. The stack protector (/GS) is a security feature of the compiler which makes it more difficult to exploit stack buffer overflow memory corruption vulnerabilities. Disabling the stack protector, even on a function-by-function basis, is disallowed by SDL policy. To resolve this issue, remove occurrences of __declspec(safebuffers) from your code. If the additional code inserted by the stack protector has been shown in profiling to cause a significant performance problem for your application, attempt to move stack buffer modifications out of the hot path of execution to allow the compiler to avoid inserting stack protector checks in these locations rather than disabling the stack protector altogether.
The text was updated successfully, but these errors were encountered: