Page MenuHome

Fix T78285: Invalid thread safety in shrinkwrap modifier code.
ClosedPublic

Authored by Bastien Montagne (mont29) on Jul 29 2020, 11:01 AM.

Details

Summary

This uses mesh's runtime mutex for both BKE_mesh_runtime_looptri_ensure (was using its own global RW mutex before), and BKE_mesh_wrapper_ensure_mdata (was not protected at all before).

This is more like a band-aid than a proper fix, as mentioned in the report proper fix would be for the modifier to request those data (the relevant BVHTree, which would implicitely also call the tow others) through flags, just like it does for regular CDData layers. But this is a much bigger refactor to be done outside of bugfix scope.

Diff Detail

Repository
rB Blender

Event Timeline

Sergey Sharybin (sergey) requested changes to this revision.Jul 29 2020, 2:46 PM

Generally fine, but see the inline comment.

source/blender/blenkernel/intern/mesh_runtime.c
169–174

This is some weird residue of the double-checked-lock patter.
Either follow the pattern ,or remove its reidue.

This revision now requires changes to proceed.Jul 29 2020, 2:46 PM
  • Fix for comments in review.
Bastien Montagne (mont29) marked an inline comment as done.Jul 29 2020, 3:32 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 29 2020, 4:11 PM
This revision was automatically updated to reflect the committed changes.
This revision is now accepted and ready to land.Jul 29 2020, 4:42 PM