BrotliWriteBits: Assertion `(bits >> n_bits) == 0' failed #186

Closed
opened 2026-01-29 20:39:28 +00:00 by claunia · 15 comments
Owner

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:

brotli: c/enc/././write_bits.h:54: BrotliWriteBits: Assertion `(bits >> n_bits) == 0' failed.
bash: line 3:  1092 Aborted                 brotli -Zk ${MY_FILE_PATH}

Using the previous commit resolves the issue.

Originally created by @buu700 on GitHub (Jul 27, 2017). After pulling https://github.com/google/brotli/commit/52441069ef31c3c02a4aecad727f2ec5a17ab68b, a bunch of JS and CSS files I have fail to compress with the following error: ``` brotli: c/enc/././write_bits.h:54: BrotliWriteBits: Assertion `(bits >> n_bits) == 0' failed. bash: line 3: 1092 Aborted brotli -Zk ${MY_FILE_PATH} ``` Using the previous commit resolves the issue.
Author
Owner

@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.

@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.
Author
Owner

@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:

Assertion failed: ((bits >> n_bits) == 0), function BrotliWriteBits, file c/enc/./write_bits.h, line 54.
Abort trap: 6
@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](https://github.com/google/brotli/files/1179163/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: ``` Assertion failed: ((bits >> n_bits) == 0), function BrotliWriteBits, file c/enc/./write_bits.h, line 54. Abort trap: 6 ```
Author
Owner

@eustas commented on GitHub (Jul 27, 2017):

Failed to reproduce on my Mac / linux workstation =(
Could you, please, attach results of cc -v and env for 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): Failed to reproduce on my Mac / linux workstation =( Could you, please, attach results of `cc -v` and `env` for mac / linux. I feel that something could go wrong about bitness / signedness, but without repro can't test it / fix it.
Author
Owner

@eustas commented on GitHub (Jul 27, 2017):

In fresh debian:sid in docker on mac all is clean:

root@974f56b46700:/clients/brotli# bin/brotli -Zfk balls.txt 
root@974f56b46700:/clients/brotli# env
HOSTNAME=974f56b46700
PWD=/clients/brotli
HOME=/root
no_proxy=*.local, 169.254/16
TERM=xterm
SHLVL=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
OLDPWD=/clients
root@974f56b46700:/clients/brotli# cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.4.0-2' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.4.0 20170724 (Debian 6.4.0-2) 
@eustas commented on GitHub (Jul 27, 2017): In fresh debian:sid in docker on mac all is clean: ``` root@974f56b46700:/clients/brotli# bin/brotli -Zfk balls.txt root@974f56b46700:/clients/brotli# env HOSTNAME=974f56b46700 PWD=/clients/brotli HOME=/root no_proxy=*.local, 169.254/16 TERM=xterm SHLVL=1 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin _=/usr/bin/env OLDPWD=/clients root@974f56b46700:/clients/brotli# cc -v Using built-in specs. COLLECT_GCC=cc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 6.4.0-2' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 6.4.0 20170724 (Debian 6.4.0-2) ```
Author
Owner

@buu700 commented on GitHub (Jul 27, 2017):

Hm, well, this is what I see in Debian in Docker:

gibson@98aabb46c082:~$ cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.4.0-1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.4.0 20170704 (Debian 6.4.0-1)
gibson@98aabb46c082:~$ env
HOSTNAME=98aabb46c082
OLDPWD=/cyph/commands
GPG_TTY=/dev/pts/0
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
GIT_EDITOR=vim
SSH_AUTH_SOCK=/tmp/ssh-svgIx14CgOzU/agent.20
GOPATH=/home/gibson/go
PWD=/home/gibson
HOME=/home/gibson
SSH_AGENT_PID=21
no_proxy=*.local, 169.254/16
TERM=xterm
EMSDK=/home/gibson/emsdk-portable
SHLVL=1
EMSCRIPTEN=/home/gibson/emsdk-portable/emscripten/1.37.16
PATH=/home/gibson/google-cloud-sdk/bin:/opt/local/bin:/opt/local/sbin:/usr/local/opt/go/libexec/bin:/home/gibson/go/bin:/home/gibson/emsdk-portable:/home/gibson/emsdk-portable/clang/e1.37.16_64bit:/home/gibson/emsdk-portable/emscripten/1.37.16:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/node_modules/.bin
BINARYEN_ROOT=/home/gibson/emsdk-portable/clang/e1.37.16_64bit/binaryen
EM_CONFIG=/home/gibson/.emscripten
BASH_FUNC_log%%=() {  echo -e "\n\n\n${*} ($(date))\n"
}
BASH_FUNC_checkfail%%=() {  if (( $? )); then
 fail "${*}";
 fi
}
BASH_FUNC_pass%%=() {  log 'PASS';
 exit 0
}
BASH_FUNC_fail%%=() {  if [ "${*}" ]; then
 log "${*}\n\nFAIL";
 else
 log 'FAIL';
 fi;
 exit 1
}
BASH_FUNC_unbindmount%%=() {  if [ ! "${circleCI}" ]; then
 sudo umount "${1}";
 fi;
 rm -rf "${1}"
}
BASH_FUNC_notify%%=() {  /node_modules/.bin/notify --text "${*}" > /dev/null;
 log "${*}"
}
BASH_FUNC_bindmount%%=() {  rm -rf "${2}" 2> /dev/null;
 if [ "${circleCI}" ]; then
 cp -a "${1}" "${2}";
 else
 mkdir "${2}" 2> /dev/null;
 sudo mount --bind "${1}" "${2}";
 fi
}
_=/usr/bin/env
@buu700 commented on GitHub (Jul 27, 2017): Hm, well, this is what I see in Debian in Docker: ``` gibson@98aabb46c082:~$ cc -v Using built-in specs. COLLECT_GCC=cc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 6.4.0-1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 6.4.0 20170704 (Debian 6.4.0-1) gibson@98aabb46c082:~$ env HOSTNAME=98aabb46c082 OLDPWD=/cyph/commands GPG_TTY=/dev/pts/0 JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 GIT_EDITOR=vim SSH_AUTH_SOCK=/tmp/ssh-svgIx14CgOzU/agent.20 GOPATH=/home/gibson/go PWD=/home/gibson HOME=/home/gibson SSH_AGENT_PID=21 no_proxy=*.local, 169.254/16 TERM=xterm EMSDK=/home/gibson/emsdk-portable SHLVL=1 EMSCRIPTEN=/home/gibson/emsdk-portable/emscripten/1.37.16 PATH=/home/gibson/google-cloud-sdk/bin:/opt/local/bin:/opt/local/sbin:/usr/local/opt/go/libexec/bin:/home/gibson/go/bin:/home/gibson/emsdk-portable:/home/gibson/emsdk-portable/clang/e1.37.16_64bit:/home/gibson/emsdk-portable/emscripten/1.37.16:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/node_modules/.bin BINARYEN_ROOT=/home/gibson/emsdk-portable/clang/e1.37.16_64bit/binaryen EM_CONFIG=/home/gibson/.emscripten BASH_FUNC_log%%=() { echo -e "\n\n\n${*} ($(date))\n" } BASH_FUNC_checkfail%%=() { if (( $? )); then fail "${*}"; fi } BASH_FUNC_pass%%=() { log 'PASS'; exit 0 } BASH_FUNC_fail%%=() { if [ "${*}" ]; then log "${*}\n\nFAIL"; else log 'FAIL'; fi; exit 1 } BASH_FUNC_unbindmount%%=() { if [ ! "${circleCI}" ]; then sudo umount "${1}"; fi; rm -rf "${1}" } BASH_FUNC_notify%%=() { /node_modules/.bin/notify --text "${*}" > /dev/null; log "${*}" } BASH_FUNC_bindmount%%=() { rm -rf "${2}" 2> /dev/null; if [ "${circleCI}" ]; then cp -a "${1}" "${2}"; else mkdir "${2}" 2> /dev/null; sudo mount --bind "${1}" "${2}"; fi } _=/usr/bin/env ```
Author
Owner

@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?

@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?
Author
Owner

@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 that commit), 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.

@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 that `commit`), 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.
Author
Owner

@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 (Jul 31, 2017): Instructions to recreate image would be nice. Hopefully, they would apply to Sierra 10.12.5.
Author
Owner

@eustas commented on GitHub (Aug 4, 2017):

Ping?

@eustas commented on GitHub (Aug 4, 2017): Ping?
Author
Owner

@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 ~/.cyph directory; ensuring that ~/.gnupg, ~/.ssh, and ~/.gitconfig exist; running make; 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 ~/.gnupg and ~/.ssh, and afterwards you can delete the generated ~/.cyphbackup.

@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 `~/.cyph` directory; ensuring that `~/.gnupg`, `~/.ssh`, and `~/.gitconfig` exist; running `make`; 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 `~/.gnupg` and `~/.ssh`, and afterwards you can delete the generated `~/.cyphbackup`.
Author
Owner

@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.txt
Mine is attached: bits.txt

@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.txt` Mine is attached: [bits.txt](https://github.com/google/brotli/files/1204861/bits.txt)
Author
Owner

@eustas commented on GitHub (Sep 19, 2017):

Any updates?

@eustas commented on GitHub (Sep 19, 2017): Any updates?
Author
Owner

@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 BrotliWriteBits assertion 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 a make clean before make 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.

@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 `BrotliWriteBits` assertion 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 a `make clean` before `make 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`.
Author
Owner

@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.

/brotli$make brotli
cc -v bin/obj/c/common/dictionary.o bin/obj/c/dec/bit_reader.o bin/obj/c/dec/decode.o bin/obj/c/dec/huffman.o bin/obj/c/dec/state.o bin/obj/c/enc/backward_references.o bin/obj/c/enc/backward_references_hq.o bin/obj/c/enc/bit_cost.o bin/obj/c/enc/block_splitter.o bin/obj/c/enc/brotli_bit_stream.o bin/obj/c/enc/cluster.o bin/obj/c/enc/compress_fragment.o bin/obj/c/enc/compress_fragment_two_pass.o bin/obj/c/enc/dictionary_hash.o bin/obj/c/enc/encode.o bin/obj/c/enc/entropy_encode.o bin/obj/c/enc/histogram.o bin/obj/c/enc/literal_cost.o bin/obj/c/enc/memory.o bin/obj/c/enc/metablock.o bin/obj/c/enc/static_dict.o bin/obj/c/enc/utf8_util.o bin/obj/c/tools/brotli.o -lm -o bin/brotli
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o bin/brotli bin/obj/c/common/dictionary.o bin/obj/c/dec/bit_reader.o bin/obj/c/dec/decode.o bin/obj/c/dec/huffman.o bin/obj/c/dec/state.o bin/obj/c/enc/backward_references.o bin/obj/c/enc/backward_references_hq.o bin/obj/c/enc/bit_cost.o bin/obj/c/enc/block_splitter.o bin/obj/c/enc/brotli_bit_stream.o bin/obj/c/enc/cluster.o bin/obj/c/enc/compress_fragment.o bin/obj/c/enc/compress_fragment_two_pass.o bin/obj/c/enc/dictionary_hash.o bin/obj/c/enc/encode.o bin/obj/c/enc/entropy_encode.o bin/obj/c/enc/histogram.o bin/obj/c/enc/literal_cost.o bin/obj/c/enc/memory.o bin/obj/c/enc/metablock.o bin/obj/c/enc/static_dict.o bin/obj/c/enc/utf8_util.o bin/obj/c/tools/brotli.o -lm -L/usr/local/lib -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
  "_BrotliDecoderSetCustomDictionary", referenced from:
      _main in brotli.o
  "_BrotliEncoderSetCustomDictionary", referenced from:
      _main in brotli.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [brotli] Error 1
@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. ``` /brotli$make brotli cc -v bin/obj/c/common/dictionary.o bin/obj/c/dec/bit_reader.o bin/obj/c/dec/decode.o bin/obj/c/dec/huffman.o bin/obj/c/dec/state.o bin/obj/c/enc/backward_references.o bin/obj/c/enc/backward_references_hq.o bin/obj/c/enc/bit_cost.o bin/obj/c/enc/block_splitter.o bin/obj/c/enc/brotli_bit_stream.o bin/obj/c/enc/cluster.o bin/obj/c/enc/compress_fragment.o bin/obj/c/enc/compress_fragment_two_pass.o bin/obj/c/enc/dictionary_hash.o bin/obj/c/enc/encode.o bin/obj/c/enc/entropy_encode.o bin/obj/c/enc/histogram.o bin/obj/c/enc/literal_cost.o bin/obj/c/enc/memory.o bin/obj/c/enc/metablock.o bin/obj/c/enc/static_dict.o bin/obj/c/enc/utf8_util.o bin/obj/c/tools/brotli.o -lm -o bin/brotli Apple LLVM version 9.1.0 (clang-902.0.39.2) Target: x86_64-apple-darwin17.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o bin/brotli bin/obj/c/common/dictionary.o bin/obj/c/dec/bit_reader.o bin/obj/c/dec/decode.o bin/obj/c/dec/huffman.o bin/obj/c/dec/state.o bin/obj/c/enc/backward_references.o bin/obj/c/enc/backward_references_hq.o bin/obj/c/enc/bit_cost.o bin/obj/c/enc/block_splitter.o bin/obj/c/enc/brotli_bit_stream.o bin/obj/c/enc/cluster.o bin/obj/c/enc/compress_fragment.o bin/obj/c/enc/compress_fragment_two_pass.o bin/obj/c/enc/dictionary_hash.o bin/obj/c/enc/encode.o bin/obj/c/enc/entropy_encode.o bin/obj/c/enc/histogram.o bin/obj/c/enc/literal_cost.o bin/obj/c/enc/memory.o bin/obj/c/enc/metablock.o bin/obj/c/enc/static_dict.o bin/obj/c/enc/utf8_util.o bin/obj/c/tools/brotli.o -lm -L/usr/local/lib -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a Undefined symbols for architecture x86_64: "_BrotliDecoderSetCustomDictionary", referenced from: _main in brotli.o "_BrotliEncoderSetCustomDictionary", referenced from: _main in brotli.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [brotli] Error 1 ```
Author
Owner

@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.

@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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#186