bazelbuild / bazelbuild/bazel

Line of 'nul' characters in build_events json

Open
#23,358 1 comment 0 reactions 0 assignees View on GitHub
team-Core type: bug untriaged
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:

![image](https://github.com/user-attachments/assets/93274d39-3647-48d0-abfb-9c501f4798ce)

![image](https://github.com/user-attachments/assets/0815a5e5-2ff4-4ec1-ac2b-b467abcd73d9)

![image](https://github.com/user-attachments/assets/aee70f75-2536-47bb-8591-7f2d12a8065f)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.