mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Brotli decompressor doesn't work on Visual C++ 2017 compiled with full optimizations #241
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jhudsoncedaron on GitHub (Jun 15, 2018).
I extracted the decoder (by copying whole files), wrapped the stuff into a .dll, and built it with Visual C++ 2017 targeting x64. The decoder doesn't copy anything into its output file if the .dll is compiled with full optimization, but works just fine if I disable optimization.
I don't even know how to begin tracking this down. It could easily be a bug in brotli (which I would be much more certain of if this were gcc) or in Visual Studio. I could bisect which compiler optimization option causes this but I really don't think that's going to help.
Current git hash of brotli is
09cd3e877f@eustas commented on GitHub (Jun 15, 2018):
Going to try to reproduce next week.
@eustas commented on GitHub (Jun 18, 2018):
Going to add VS2017 x64 debug and release builds to Appveyor matrix soon to see if it works.
@eustas commented on GitHub (Jun 18, 2018):
Seems to work: build / test log
Could you try to build dlls with CMake generated project?
What optimization options are used?
@jhudsoncedaron commented on GitHub (Jun 18, 2018):
I have bisected the triggering compiler option. The one that breaks it is /NODEFUALTLIB. This makes trying the CMake project pointless.
Turning off optimizations makes it go away, but turning on optimizations and still linking against MSVC*.dll results in a working binary as well. The fault is occurring where the compiler tries to inline memcpy.
The current optimizations are: /O2 /Ot /GL /GS- /Gy /sdl- /NODEFAULTLIB
@jhudsoncedaron commented on GitHub (Jun 18, 2018):
Nevermind. I messed up memcpy pretty bad. I'm shocked it worked with optimizations off.