Skip to content

Prevent infinite recursion reporting a problem#8031

Open
StephenMcConnel wants to merge 1 commit into
masterfrom
PreventInfiniteRecursionReportingError
Open

Prevent infinite recursion reporting a problem#8031
StephenMcConnel wants to merge 1 commit into
masterfrom
PreventInfiniteRecursionReportingError

Conversation

@StephenMcConnel

@StephenMcConnel StephenMcConnel commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Devin review


This change is Reviewable

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a per-thread boolean flag (s_isReporting) to break a mutual-recursion cycle where ShowToast triggers a network/reporting operation that eventually calls back into NonFatalProblem.Report, causing a StackOverflowException.

  • The [ThreadStatic] attribute is the right tool here: the recursion is synchronous and same-thread, so per-thread isolation correctly blocks the cycle without affecting unrelated threads.
  • The finally block in the new code guarantees the flag is reset even if ShowToast throws, and the guard is placed precisely at the passive/toast code path that produces the cycle.

Important Files Changed

Filename Overview
src/BloomExe/NonFatalProblem.cs Adds a [ThreadStatic] reentrancy guard around ShowToast to break the Report → ShowToast → SendBundle → ReportConnectionError → Report recursion cycle; implementation is correct.

Reviews (1): Last reviewed commit: "Prevent infinite recursion reporting a p..." | Re-trigger Greptile

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

Successfully merging this pull request may close these issues.

2 participants