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
BugReport.handleCrash in updateThread hangs on currentThread().join() #22051
Labels
help wanted
Someone outside the Bazel team could own this
P2
We'll consider working on this in future. (Assignee optional)
team-CLI
Console UI
type: bug
Comments
It sounds like we could fix this by checking whether we're joining with the current thread. Could you send a PR? |
I certainly can. Hopefully there's no chance that we're stopUpdateThread-ing when in the updateThread where we aren't handling a FATAL, otherwise I don't know if it will shut down... |
werkt
added a commit
to werkt/bazel
that referenced
this issue
Apr 25, 2024
If the cli-update-thread is crashing, it may attempt to interrupt and join on itself. Hopefully no updateThread could be in stopUpdateThread without going through handleCrash() -> Event.FATAL sequence through BlazeRuntime. Fixes bazelbuild#22051
meisterT
added
P2
We'll consider working on this in future. (Assignee optional)
help wanted
Someone outside the Bazel team could own this
and removed
untriaged
labels
May 14, 2024
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this issue
May 14, 2024
If the cli-update-thread is crashing, it may attempt to interrupt and join on itself. Hopefully no updateThread could be in stopUpdateThread without going through handleCrash() -> Event.FATAL sequence through BlazeRuntime. Fixes bazelbuild#22051 Closes bazelbuild#22122. PiperOrigin-RevId: 633653817 Change-Id: Iaef5df56358d74bd7210ad8cb3562b452de9eb6a
github-merge-queue bot
pushed a commit
that referenced
this issue
May 14, 2024
If the cli-update-thread is crashing, it may attempt to interrupt and join on itself. Hopefully no updateThread could be in stopUpdateThread without going through handleCrash() -> Event.FATAL sequence through BlazeRuntime. Fixes #22051 Closes #22122. PiperOrigin-RevId: 633653817 Change-Id: Iaef5df56358d74bd7210ad8cb3562b452de9eb6a Commit 6306240 Co-authored-by: George Gensure <werkt0@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
help wanted
Someone outside the Bazel team could own this
P2
We'll consider working on this in future. (Assignee optional)
team-CLI
Console UI
type: bug
Description of the bug:
UiEventHandler's updateThread will attempt to uninterruptiblyJoin() itself when an uncaught exception occurs in conjunction with BlazeRuntime's BugReport handler. The guava join util has no detection of the deadlock that occurs when a thread joins itself.
The trace is from 6.2.0, but the lines are updated here to reflect their master position, where this is still possible:
bazel/src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java
Line 982 in 076494c
Where
threadToWaitFor == Thread.currentThread()
bazel/src/main/java/com/google/devtools/build/lib/runtime/UiEventHandler.java
Line 468 in 076494c
Line matches
bazel/src/main/java/com/google/devtools/build/lib/bugreport/BugReport.java
Line 297 in 076494c
Note that the deadlock detection above this has not triggered
bazel/src/main/java/com/google/devtools/build/lib/bugreport/BugReport.java
Line 245 in 076494c
bazel/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
Line 1228 in 076494c
bazel/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
Line 1238 in 076494c
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Throw an uncaught exception in the updateThread "cli-update-thread" with the Thread.setDefaultUncaughtExceptionHandler -> BugReport.handleCrash sequence established in BlazeRuntime.java
Which operating system are you running Bazel on?
linux
What is the output of
bazel info release
?6.2.0
If
bazel info release
returnsdevelopment 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
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
Original trace:
The text was updated successfully, but these errors were encountered: