Skip to content

#5945 cacheOptimize crash handling#5947

Merged
akleshchev merged 1 commit into
developfrom
andreyk/viewer_5945
Jun 23, 2026
Merged

#5945 cacheOptimize crash handling#5947
akleshchev merged 1 commit into
developfrom
andreyk/viewer_5945

Conversation

@akleshchev

Copy link
Copy Markdown
Contributor

Data validation for cacheOptimize.

Copilot AI 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.

Pull request overview

This PR adds additional validation and defensive handling around mesh face unpacking and cacheOptimize() to reduce crash risk from malformed mesh data (notably tangent generation), and improves thread out-of-memory reporting.

Changes:

  • Add guard rails in LLVolume::unpackVolumeFacesInternal() for zero/oversized vertex counts and position-buffer validation.
  • Add upfront validation in LLVolumeFace::cacheOptimize() before generating MikkTSpace tangents (pointer/count checks, triangulation, index bounds, normalized-scale sanity).
  • Include the thread name in the main-thread fatal log for std::bad_alloc in LLThread::tryRun().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
indra/llmath/llvolume.cpp Adds validation and early-outs while unpacking mesh face data and before tangent generation during cache optimization.
indra/llcommon/llthread.cpp Adjusts OOM handling to log the originating thread name in the main-thread fatal path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp Outdated
Comment thread indra/llcommon/llthread.cpp

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 8 comments.

Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp Outdated
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
@akleshchev akleshchev force-pushed the andreyk/viewer_5945 branch from fd0ea11 to 9cbb646 Compare June 23, 2026 12:37

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
@akleshchev akleshchev merged commit 134bdc8 into develop Jun 23, 2026
16 checks passed
@akleshchev akleshchev deleted the andreyk/viewer_5945 branch June 23, 2026 15:43
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants