Page MenuHome

Regression: Gpencil Lineart crashes Blender when undoing creation of linked copy
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce MX330/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.91

Blender Version
Broken: version: 3.3.0 Alpha, branch: master, commit date: 2022-05-19 07:06, hash: rB2e06c223cc1f
Worked: 3.1.2

Caused by rBe8dc82311d1a: Fix T96145: GPencil eval data not updated correctly

Short description of error
Ctrl + Z right after (accidentally, as there is no logical intention behind doing this) creating an Alt + D linked duplicate of Gpencil Lineart consistently crashes Blender.

Exact steps for others to reproduce the error
Open Blender
Add Scene lineart to default cube scene
Alt + D duplicate and confirm the Gpencil Lineart object
Ctrl + Z produces crash

See video (last action before closing that you cannot see iz ctrl + Z)

Event Timeline

I can reproduce this. I'll take a look later.

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.May 19 2022, 3:22 PM
Philipp Oeser (lichtwerk) triaged this task as High priority.
Philipp Oeser (lichtwerk) updated the task description. (Show Details)

We couldn't identify anything that would point to the issue being in that part of the code. The data pointer of the object is NULL so it crashes there. It feels like our changes just revealed a previously hidden bug. We'll have to look more closely.

@Antonio Vazquez (antoniov) I don't think this is related to the undo system. Right now it looks like for some reason ob->runtime.gpd_eval and ob->data point to the same thing after a copy-on-write. That's weird and shouldn't happen. We're trying to figure it out.

Ok so we now believe that the issue is here in /source/blender/blenkernel/intern/object_update.c:135:

/* Assign evaluated version. */
if ((ob->type == OB_GPENCIL) && (ob->runtime.gpd_eval != NULL)) {
  ob->data = ob->runtime.gpd_eval;
}

When commenting out these lines, that fixes the crash. We don't really understand these lines and why it just overwrites the ob->data pointer. @Antonio Vazquez (antoniov) Do you have any ideas?

NO idea now....maybe it was something old that it was in the code by error. If you can do transformations and modifiers are working without these lines, I guess must be safe to remove it.

I have tested and don't see any problem removing these lines.

Ok yes this should no longer be necessary. If the transform updates are working, then we should remove this.

Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".