Fix: Use after free in geometry node group logger

The name of the node group in the geometry nodes logger is created
in `GeoModifierLog::get_local_tree_logger`, where it references the
compute context. However, the compute context is a local variable
that doesn't live as long as the log. Therefore the log needs to own
the node group name.

Removing the ownership from `NodeGroupComputeContext` may be
possible as well, but seems less obviously correct. This can be a
temporary solution until we can completely avoid storing strings
in the logger (see D15775).

Fixes T101599
This commit is contained in:
Hans Goudey 2022-10-06 11:48:05 -05:00
parent 26df25caef
commit 46c40d7fa1
Notes: blender-bot 2023-02-14 09:33:11 +01:00
Referenced by issue #101599, Node group timings aren't displayed for node groups
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ using TimePoint = Clock::time_point;
class GeoTreeLogger {
public:
std::optional<ComputeContextHash> parent_hash;
std::optional<StringRefNull> group_node_name;
std::optional<std::string> group_node_name;
Vector<ComputeContextHash> children_hashes;
LinearAllocator<> *allocator = nullptr;