Maniphest T54578

regression python crash modifying text block
Closed, Resolved

Assigned To
Campbell Barton (campbellbarton)
Authored By
mathieu menuet (bliblubli)
Apr 12 2018, 7:42 AM
Tags
  • BF Blender
  • BF Blender: Regressions
  • Add-ons (BF-Blender)
Subscribers
Campbell Barton (campbellbarton)
mathieu menuet (bliblubli)
Philipp Oeser (lichtwerk)

Description

System Information
ArchLinux x64

Blender Version
Broken: f55adabb3e5
Worked: d59c2d12b12

Short description of error
Files with a script that tries to modify a text block crash latest master. It didn't happen some days ago.

Exact steps for others to reproduce the error
install https://github.com/JacquesLucke/animation_nodes/releases/download/v2.1_testbuilds_2/animation_nodes_v2_1_linux_py36.zip
Open attached file in f55adabb3e5, it works
Open attached file in f55adabb3e5, it crashes

crash log:

Related Objects

Mentioned In
T54593: Rigify crashes Blender when Generate the rig
Mentioned Here
rBfb3528d08870: Fix T54593: Py text edits crash (undo regression)
T54553: Blender crash on write to text data-block
D3139: Fix for T54553
P654 T54578 snippet
rBad1ea9a427e3: Undo: split text undo steps out of the data-block

Event Timeline

mathieu menuet (bliblubli) created this task.Apr 12 2018, 7:42 AM
Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to 50.Apr 12 2018, 9:48 AM
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

caused by rBad1ea9a427e3543a43ca2589f87f0c94b9be03ca

Philipp Oeser (lichtwerk) added a project: BF Blender: Regressions.Apr 12 2018, 9:49 AM
Philipp Oeser (lichtwerk) assigned this task to Campbell Barton (campbellbarton).Apr 12 2018, 10:39 AM
Philipp Oeser (lichtwerk) added a subscriber: Campbell Barton (campbellbarton).

Similar to T54553 (py API doesnt set TextUndoBuf), similar thing as D3139 will fix the crash here, too:

1diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
2index c7588a4ed48..6ace5b97caf 100644
3--- a/source/blender/blenkernel/intern/text.c
4+++ b/source/blender/blenkernel/intern/text.c
5@@ -531,7 +531,7 @@ void BKE_text_clear(Text *text, TextUndoBuf *utxt) /* called directly from rna *
6 if (utxt) {
7 oldstate = txt_get_undostate();
8 }
9- txt_set_undostate(utxt != NULL);
10+ txt_set_undostate(utxt == NULL);
11
12 txt_sel_all(text);
13 txt_delete_sel(text, utxt);

Also not sure how exactly this is meant to work at first sight, @Campbell Barton (campbellbarton): should I continue investigating (just throw back at me...)?

Philipp Oeser (lichtwerk) added a project: Add-ons (BF-Blender).Apr 12 2018, 10:40 AM
Philipp Oeser (lichtwerk) changed the task status from Unknown Status to Resolved.Apr 16 2018, 10:55 AM

afaict, this is also fixed by rBfb3528d08870, thx @Campbell Barton (campbellbarton) !