Line of 'nul' characters in build_events json
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 75
Description
### Description of the bug:
I am hitting jq parsing errors and it turns out that bazel is generating build_events.json files with long lines of nul characters (e.g. 1.4MB of nuls). Here are three separate build_events.json files from the last hour, generated by bazel 7.3.0 and 7.3.1:



The command line used is:
--build_events_json_file=build_events.json
### Which category does this issue belong to?
Core
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Large monorepo, will be hard to generate reproducer
### Which operating system are you running Bazel on?
Windows
### What is the output of `bazel info release`?
release 7.3.1 (also tried 7.3.0)
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
_No response_
### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start with the --build_events_json_file=build_events.json entry point on Windows using Bazel 7.3.0 and 7.3.1, then inspect the generated files for the source of the nul characters. Reproduce the jq parsing failure or obtain a minimal case; done means the build events output is valid JSON without the long nul lines.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100