Skip to content

Fix mouselook CTD and RelWithDebInfo CTDs#341

Merged
RyeMutt merged 1 commit into
AlchemyViewer:developfrom
Quinn-Elara:develop
Jul 5, 2026
Merged

Fix mouselook CTD and RelWithDebInfo CTDs#341
RyeMutt merged 1 commit into
AlchemyViewer:developfrom
Quinn-Elara:develop

Conversation

@Quinn-Elara

Copy link
Copy Markdown
Contributor

Description

Fixes a CTD encountered when entering mouselook, as well as a couple of CTDs present on RelWithDebInfo builds.

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

Fixes a CTD encountered when entering mouselook, as well as a couple of CTDs present on RelWithDebInfo builds.
@coderabbitai

coderabbitai Bot commented Jul 4, 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: f63b9f65-b05b-4258-8c2a-50a34b86c119

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0c919 and 14aeb9e.

📒 Files selected for processing (2)
  • indra/newview/llpreviewscript.cpp
  • indra/newview/llviewerwindow.cpp

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved script upload handling so success and failure updates are applied safely on the main thread, reducing UI-related issues during compile results.
    • Fixed a null-pointer crash risk in the viewer’s intersection handling when debugging raycast results, making cursor picking more stable.

Walkthrough

This PR makes two independent changes: LLLiveLSLEditor::finishLSLUpload now schedules its floater lookup and compile callback logic to run on the main coroutine via postToMainCoro, and LLViewerWindow::cursorIntersect adds a null-pointer check before dereferencing intersection.

Changes

LSL Upload Threading Fix

Layer / File(s) Summary
Defer LSL compile callbacks to main coroutine
indra/newview/llpreviewscript.cpp
finishLSLUpload wraps floater lookup, asset ID updates, compile success/failure callback dispatch, is_running assignment, and sendCompileResults in a lambda passed to LLAppViewer::instance()->postToMainCoro(...).

Cursor Intersection Null Guard

Layer / File(s) Summary
Guard debug raycast intersection assignment
indra/newview/llviewerwindow.cpp
cursorIntersect now checks intersection is non-null in addition to found and !pick_transparent before assigning gDebugRaycastIntersection.

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

Sequence Diagram(s)

sequenceDiagram
    participant UploadCoroutine
    participant MainCoro as LLAppViewer::postToMainCoro
    participant Floater as LLLiveLSLEditor
    participant Server

    UploadCoroutine->>MainCoro: schedule floater update lambda
    MainCoro->>Floater: find floater instance
    MainCoro->>Floater: update asset IDs
    alt compiled succeeded
        MainCoro->>Floater: callbackLSLCompileSucceeded
    else compiled failed
        MainCoro->>Floater: callbackLSLCompileFailed
    end
    MainCoro->>Floater: set is_running
    MainCoro->>Server: sendCompileResults
Loading

Poem

A bunny hops through coroutines deep,
Moving callbacks where threads safely sleep. 🐇
A null-check guard, so raycast won't crash,
No dangling pointer, no debug-mode gash.
Two tiny fixes, tucked in with care—
Hop hop, all safe, no bugs anywhere! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the bug fix, but the required issue link is missing and the checklist is only partially completed. Add a concrete issue reference in Related Issues and complete the applicable checklist items, especially testing details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: fixing CTDs related to mouselook and RelWithDebInfo builds.
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.

@RyeMutt RyeMutt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@RyeMutt RyeMutt merged commit 7295b41 into AlchemyViewer:develop Jul 5, 2026
15 checks passed
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.

2 participants