Skip to content

llpreviewscript: fix LLMutex assert crash when LSL compile fails#350

Open
Quinn-Elara wants to merge 1 commit into
AlchemyViewer:developfrom
Quinn-Elara:script-fixes-a
Open

llpreviewscript: fix LLMutex assert crash when LSL compile fails#350
Quinn-Elara wants to merge 1 commit into
AlchemyViewer:developfrom
Quinn-Elara:script-fixes-a

Conversation

@Quinn-Elara

Copy link
Copy Markdown
Contributor

Description

LLPreviewLSL::finishedLSLUpload and failedLSLUpload were being called directly on the upload coprocedure fiber, causing a crash when the downstream UI path (callbackLSLCompileFailed -> selectFirstError -> reflow -> LLMutex::lock) asserted LLCoros::on_main_coro(). Wrap both callbacks in postToMainCoro(), matching the fix already applied to LLLiveLSLEditor::finishLSLUpload.

Fixes a CTD when using the built-in script editor.

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

@coderabbitai

coderabbitai Bot commented Jul 11, 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: 80361f66-26fd-40d8-a33a-95cbee4fc0a5

📥 Commits

Reviewing files that changed from the base of the PR and between 90ea0f5 and ee00968.

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

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved LSL script upload/compilation handling by deferring UI-related updates to the main application flow for more reliable results.
    • Ensured compilation failures consistently return and report their outcomes even when the associated preview/editor window isn’t available.

Walkthrough

LSL upload completion and failure handlers now defer floater lookup, compile callbacks, and compile-result sending to the main coroutine. Failed uploads return true after scheduling the deferred work.

Changes

LSL upload callback dispatch

Layer / File(s) Summary
Main-coro callback dispatch
indra/newview/llpreviewscript.cpp
finishedLSLUpload and failedLSLUpload use postToMainCoro for UI-affecting work; failed uploads always return true after scheduling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • AlchemyViewer/Alchemy#341: Updates the same LSL upload completion and error handling to defer floater and compile-result work to the main coroutine.

Suggested reviewers: RyeMutt

Sequence Diagram(s)

sequenceDiagram
  participant UploadFiber
  participant LLAppViewer
  participant LLPreviewLSL
  UploadFiber->>LLAppViewer: postToMainCoro(upload result handling)
  LLAppViewer->>LLPreviewLSL: find floater and invoke compile callback
  LLPreviewLSL->>LLPreviewLSL: sendCompileResults
Loading

Poem

A bunny sees callbacks hop,
From upload threads to main-coro stop.
The floater waits, the results arrive,
Failed reports return true alive.
Safe UI hops make carrots thrive!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main fix: preventing an LLMutex assert crash when LSL compile fails.
Description check ✅ Passed The description covers the crash cause, the fix, and context, but the Related Issues section still has a placeholder issue link.
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.

LLPreviewLSL::finishedLSLUpload and failedLSLUpload were being called
directly on the upload coprocedure fiber, causing a crash when the
downstream UI path (callbackLSLCompileFailed -> selectFirstError ->
reflow -> LLMutex::lock) asserted LLCoros::on_main_coro(). Wrap both
callbacks in postToMainCoro(), matching the fix already applied to
LLLiveLSLEditor::finishLSLUpload.
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