mirror of
https://github.com/google/brotli.git
synced 2026-09-22 22:56:08 +00:00
BrotliWriteBits: Assertion `(bits >> n_bits) == 0' failed #186
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 @buu700 on GitHub (Jul 27, 2017).
After pulling
52441069ef, a bunch of JS and CSS files I have fail to compress with the following error:Using the previous commit resolves the issue.
@eustas commented on GitHub (Jul 27, 2017):
Thanks for the report, going to investigate it ASAP.
I would be grateful, if you attach an example of such file.
Also, target CPU model, compiler version and compilation options would help.
@buu700 commented on GitHub (Jul 27, 2017):
Cool, sounds good. I just tested, and it looks like it's consistently reproducible with this file:
balls.txt
On an up-to-date Debian Sid running in Docker on a MacBook Pro Retina (2.4 GHz Haswell Core i5) with a build generated using
make brotli, I get the above error. Outside of Docker (in OS X), the same command produces this error:@eustas commented on GitHub (Jul 27, 2017):
Failed to reproduce on my Mac / linux workstation =(
Could you, please, attach results of
cc -vandenvfor mac / linux.I feel that something could go wrong about bitness / signedness, but without repro can't test it / fix it.
@eustas commented on GitHub (Jul 27, 2017):
In fresh debian:sid in docker on mac all is clean:
@buu700 commented on GitHub (Jul 27, 2017):
Hm, well, this is what I see in Debian in Docker:
@eustas commented on GitHub (Jul 27, 2017):
It seems to be some derivative of debian:sid - there are Java, Python, Go, Node and Emscripten (my main suspect). Is there a public image that I could use to get the same environment?
@buu700 commented on GitHub (Jul 28, 2017):
Hmm, I had an image that I was going to upload, but I can't reproduce it there; the only image where it's reproducible has some manual changes applied via
docker commit(nothing directly relevant, just Google Cloud SDK authentication) and some local directories mounted (and locked in / required because of thatcommit), so it'd be a bit messy to try to share, although I can give a link and instructions for building the same image on your machine if needed.All that being the case, maybe this is just a macOS problem that somehow sort of poisons Docker for Mac in the above scenario? Not sure what else would be worth testing if you've already tried it on a Mac, though. Since I didn't mention originally, in case it helps, I'm currently running OS X El Capitan.
@eustas commented on GitHub (Jul 31, 2017):
Instructions to recreate image would be nice. Hopefully, they would apply to Sierra 10.12.5.
@eustas commented on GitHub (Aug 4, 2017):
Ping?
@buu700 commented on GitHub (Aug 7, 2017):
Sorry about the delay @eustas. You should be able to recreate the image by cloning https://github.com/cyph/cyph/tree/beta; ensuring that a recent version of Node.js is installed; making an empty
~/.cyphdirectory; ensuring that~/.gnupg,~/.ssh, and~/.gitconfigexist; runningmake; and skipping through some Google Cloud authentication prompts at the end.This should take about 30 - 60 minutes. You may also want to edit lines 91 and 92 of docker.js to point to directories other than your actual
~/.gnupgand~/.ssh, and afterwards you can delete the generated~/.cyphbackup.@eustas commented on GitHub (Aug 7, 2017):
Still no luck with repro =(
Could you attach the debug log (compile with
export CFLAGS="-DBIT_WRITER_DEBUG") for./bin/brotli -Zfk balls.txtMine is attached: bits.txt
@eustas commented on GitHub (Sep 19, 2017):
Any updates?
@buu700 commented on GitHub (Sep 23, 2017):
Sorry about the delay @eustas! Just had a chance to look into this, and figured out what the problem was.
I could still reproduce the
BrotliWriteBitsassertion failure even after building with debug mode as you suggested, but it turns out that debug and non-debug modes both work fine if I do amake cleanbeforemake brotli, so I guess this is just a minor build script issue.To get into the state that causes the above error (reproducible on a standard Linux system without Docker), you can run
git checkout 172a378debedec81eb19747c96c28a81d917d284 ; make clean ; make brotli ; git checkout 5b4769990dc14a2bd466d2599c946c5652cba4b2 ; make brotli.@eustas commented on GitHub (Oct 22, 2018):
Indeed, something is wrong with build script. On osx it does not build when aforementioned command sequence is executed.
@eustas commented on GitHub (Oct 22, 2018):
I believe "make" gets confused and does not recompile required sources. Invoking 'make clean' after checkout fixes the problem. Hopefully, automake / CMake / premake5 / Bazel does not have that kind of problem.