mirror of
https://github.com/jqlang/jq.git
synced 2026-10-26 20:16:33 +00:00
df95871dd7415627bda6d70ce0569d0a4fbc22c6
A very large program can cause these leaks: ==758838== 7,820 (16 direct, 7,804 indirect) bytes in 2 blocks are definitely lost in loss record 17 of 28 ==758838== at 0x4848A23: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==758838== by 0x125D30: jv_mem_calloc (jv_alloc.c:153) ==758838== by 0x162ADE: compile (compile.c:1286) ==758838== by 0x162D4B: compile (compile.c:1304) ==758838== by 0x163697: block_compile (compile.c:1381) ==758838== by 0x11B5CA: jq_compile_args (execute.c:1245) ==758838== by 0x115E20: main (main.c:691) ==758838== ==758838== 1,674,694 (103,576 direct, 1,571,118 indirect) bytes in 1,177 blocks are definitely lost in loss record 28 of 28 ==758838== at 0x4843839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==758838== by 0x125CD0: jv_mem_alloc (jv_alloc.c:141) ==758838== by 0x162B19: compile (compile.c:1289) ==758838== by 0x163697: block_compile (compile.c:1381) ==758838== by 0x11B5CA: jq_compile_args (execute.c:1245) ==758838== by 0x115E20: main (main.c:691) This commit fixes that. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=61349
jq
jq is a lightweight and flexible command-line JSON processor akin tosed,awk,grep, and friends for JSON data. It's written in portable C and has zero runtime dependencies, allowing you to easily slice, filter, map, and transform structured data.
Documentation
- Official Documentation: jqlang.github.io/jq
- Try jq Online: jqplay.org
Installation
Prebuilt Binaries
Download the latest releases from the GitHub release page.
Docker Image
Pull the jq image to start quickly with Docker.
Building from source
Dependencies
- libtool
- make
- automake
- autoconf
Instructions
git submodule update --init # if building from git to get oniguruma
autoreconf -i # if building from git
./configure --with-oniguruma=builtin
make -j8
make check
sudo make install
Build a statically linked version:
make LDFLAGS=-all-static
If you're not using the latest git version but instead building a released tarball (available on the release page), skip the autoreconf step, and flex or bison won't be needed.
Cross-Compilation
For details on cross-compliation, check out the GitHub Actions file and the cross-compliation wiki page.
Community & Support
- Questions & Help: Stack Overflow (jq tag)
- Chat & Community: Join us on Discord
- Wiki & Advanced Topics: Explore the Wiki
License
jq is released under the MIT License.
Languages
C
78.7%
M4
6.4%
Shell
6.3%
Yacc
3.2%
jq
1.5%
Other
3.9%