Skip to content

Fix CTD on teleport#349

Open
Quinn-Elara wants to merge 2 commits into
AlchemyViewer:developfrom
Quinn-Elara:tp-fixes-a
Open

Fix CTD on teleport#349
Quinn-Elara wants to merge 2 commits into
AlchemyViewer:developfrom
Quinn-Elara:tp-fixes-a

Conversation

@Quinn-Elara

Copy link
Copy Markdown
Contributor

Description

Fix a CTD encountered upon teleport - region caps processing has been moved into the main thread to avoid an assert which could be encountered when teleporting.

Related Issues

  • Please link to a relevant GitHub issue for additional context.
    • Bug Fix: Link to an issue that includes reproduction steps and testing guidance.
    • Feature/Enhancement: Link to an issue with a write-up, rationale, and requirements.

Issue Link:


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

Fix a CTD encountered upon teleport.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3a4d8cc8-f142-4e1a-9066-7af44eaf9609

📥 Commits

Reviewing files that changed from the base of the PR and between 89a3b6f and c828a56.

📒 Files selected for processing (1)
  • indra/newview/llviewerregion.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • indra/newview/llviewerregion.cpp

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved how region capability data is finalized after connecting, ensuring server release notes are only shown when the region is still available.
    • Made region-related updates more reliable by deferring the finalization and release-notes display to the main application loop, preventing premature execution.

Walkthrough

In LLViewerRegionImpl::requestBaseCapabilitiesCoro, the capability-complete update and ServerReleaseNotes display are moved into a LLAppViewer::postToMainCoro callback that re-checks the region on the main loop before applying them.

Changes

Capabilities Update Deferral

Layer / File(s) Summary
Defer capabilities-received and release notes logic
indra/newview/llviewerregion.cpp
Replaces the inline setCapabilitiesReceived(true) path with a postToMainCoro callback that captures regionHandle, re-fetches the region on the main loop, aborts if it no longer exists, sets capabilities received, and conditionally calls showReleaseNotes().

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Coroutine as requestBaseCapabilitiesCoro
  participant AppViewer as LLAppViewer
  participant Region as LLViewerRegion

  Coroutine->>AppViewer: postToMainCoro(callback with regionHandle)
  AppViewer->>Region: getRegion(regionHandle)
  alt region exists
    AppViewer->>Region: setCapabilitiesReceived(true)
    alt ServerReleaseNotes available and requested
      AppViewer->>Region: showReleaseNotes()
    end
  else region no longer exists
    AppViewer-->>Coroutine: abort callback
  end
Loading

Poem

A bunny hops to the main-loop light,
Capabilities land at the proper site.
Release notes bloom, if the stars align,
In safer timing, the code feels fine. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main crash fix during teleport.
Description check ✅ Passed The description explains the fix and context, though the issue link and testing details are left blank or generic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@indra/newview/llviewerregion.cpp`:
- Around line 399-413: The deferred callback in
LLViewerRegion::setCapabilitiesReceived() dereferences LLWorld::getInstance()
after posting to the main coro, but LLWorld may already be torn down by then.
Update the lambda to first grab and null-check the LLWorld singleton before
calling getRegionFromHandle(regionHandle), and return early if it is
unavailable; keep the existing regionp checks and release-notes flow unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 99c12907-1cc5-417a-a99d-27a39e58d712

📥 Commits

Reviewing files that changed from the base of the PR and between 7c11d3f and 89a3b6f.

📒 Files selected for processing (1)
  • indra/newview/llviewerregion.cpp

Comment thread indra/newview/llviewerregion.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant