regression python crash modifying text block #54578

Closed
opened 2018-04-12 07:42:51 +02:00 by mathieu menuet · 7 comments

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
test crash.blend

crash log: test crash.crash.txt

**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 [test crash.blend](https://archive.blender.org/developer/F2666632/test_crash.blend) crash log: [test crash.crash.txt](https://archive.blender.org/developer/F2666648/test_crash.crash.txt)
Author

Added subscriber: @bliblubli

Added subscriber: @bliblubli
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member
caused by blender/blender@ad1ea9a427
Campbell Barton was assigned by Philipp Oeser 2018-04-12 10:39:55 +02:00
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

Similar to #54553 (py API doesnt set TextUndoBuf), similar thing as D3139 will fix the crash here, too:
P654: #54578 snippet

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

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

Similar to #54553 (py API doesnt set `TextUndoBuf`), similar thing as [D3139](https://archive.blender.org/developer/D3139) will fix the crash here, too: [P654: #54578 snippet](https://archive.blender.org/developer/P654.txt) ``` diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index c7588a4ed48..6ace5b97caf 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -531,7 +531,7 @@ void BKE_text_clear(Text *text, TextUndoBuf *utxt) /* called directly from rna * if (utxt) { oldstate = txt_get_undostate(); } - txt_set_undostate(utxt != NULL); + txt_set_undostate(utxt == NULL); txt_sel_all(text); txt_delete_sel(text, utxt); ``` Also not sure how exactly this is meant to work at first sight, @ideasman42: should I continue investigating (just throw back at me...)?
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

afaict, this is also fixed by blender/blender@fb3528d088, thx @ideasman42 !

afaict, this is also fixed by blender/blender@fb3528d088, thx @ideasman42 !
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#54578
No description provided.