Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.4.0] Bazel crashes with NPE #23484

Open
bazel-io opened this issue Aug 31, 2024 · 0 comments
Open

[7.4.0] Bazel crashes with NPE #23484

bazel-io opened this issue Aug 31, 2024 · 0 comments

Comments

@bazel-io
Copy link
Member

Forked from #23483

@bazel-io bazel-io added this to the 7.4.0 release blockers milestone Aug 31, 2024
github-merge-queue bot pushed a commit that referenced this issue Sep 3, 2024
A race condition can happen:

- Thread 1: `#writeProgressBar` is called due to
`LoadingPhaseStartedEvent`, expecting `buildStatus` to be
`TARGET_PATTERN_PARSING`
- Main thread: `LoadingPhaseCompleteEvent` arrives. **`buildStatus` is
set to `LOADING_COMPLETE`**. additionalMessage is not yet updated and is
still null.
- Thread 1: Seeing that `buildStatus` is now `LOADING_COMPLETE`, it
moves forward with that code path => NPE when `additionMessage` is
checked.

To fix this NPE, the CL made 2 changes:

1. Synchronize methods that touch `buildStatus`
2. Default `additionalMessage` to an empty string to make the code more
robust.

PiperOrigin-RevId: 640061798
Change-Id: I5034fe7692e0641559fb7666eec09cb554e09545

#23484
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant