Page MenuHome

GreasePencil: Crash when changing to Vertex Color mode in Draw mode
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71

Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-11-18 22:29, hash: rB9d6d5b9bebd1
Worked: 2.90.1


Short description of error

Crash when changing to Vertex Color mode in Draw mode.
Occurs in Blender 2.92.0 Alpha and 2.91.0 Beta.


Exact steps for others to reproduce the error

OS Conditon: WIN 10 |Blender: 2.92.0 Alpha

  • Default scene.
  • Create a Grease Pencil Blank ,go into Draw mode and change to the Vertex Color mode, then make a stroke

Below is a simple file in which the default cube is deleted and having a blank Grease Pencil object in Draw mode:


Crash should be able to reproduced by turning on the Vertex Color mode.

Event Timeline

I cannot reproduce it using last source code.

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.EditedThu, Nov 19, 9:47 AM
Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Bug".

Can reproduce with rB8ec6b34b8eb2: VSE: Move split operator logic to module code.

You have to make a stroke after changing to Vertex Color mode

but->tip is NULL

1  __strchr_avx2                                             0x7ffff7945fcc 
2  ui_but_tip_len_only_first_line interface_query.c    466   0x466a3c6      
3  ui_apply_but_undo              interface_handlers.c 835   0x4629d01      
4  button_activate_exit           interface_handlers.c 8214  0x463e9c2      
5  ui_handle_button_event         interface_handlers.c 8951  0x464052a      
6  ui_region_handler              interface_handlers.c 10681 0x464470d      
7  wm_handler_ui_call             wm_event_system.c    639   0x386dec5      
8  wm_handlers_do_intern          wm_event_system.c    2764  0x38733bc      
9  wm_handlers_do                 wm_event_system.c    2872  0x38737b4      
10 wm_event_do_handlers           wm_event_system.c    3368  0x3874dca      
11 WM_main                        wm.c                 635   0x3869039      
12 main                           creator.c            522   0x32f3842

Will bisect.

@Philipp Oeser (lichtwerk) I see now. Is this related to GPencil? Looking at the callstack I see it looks related to UI code.

This should do the trick

1
2
3diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c
4index d0075ba8617..7be7ca7cad0 100644
5--- a/source/blender/editors/interface/interface_query.c
6+++ b/source/blender/editors/interface/interface_query.c
7@@ -463,6 +463,9 @@ size_t ui_but_drawstr_len_without_sep_char(const uiBut *but)
8
9 size_t ui_but_tip_len_only_first_line(const uiBut *but)
10 {
11+ if (but->tip == NULL) {
12+ return 0;
13+ }
14 const char *str_sep = strchr(but->tip, '\n');
15 if (str_sep != NULL) {
16 return (str_sep - but->tip);

This should do the trick

1
2
3diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c
4index d0075ba8617..7be7ca7cad0 100644
5--- a/source/blender/editors/interface/interface_query.c
6+++ b/source/blender/editors/interface/interface_query.c
7@@ -463,6 +463,9 @@ size_t ui_but_drawstr_len_without_sep_char(const uiBut *but)
8
9 size_t ui_but_tip_len_only_first_line(const uiBut *but)
10 {
11+ if (but->tip == NULL) {
12+ return 0;
13+ }
14 const char *str_sep = strchr(but->tip, '\n');
15 if (str_sep != NULL) {
16 return (str_sep - but->tip);

Small note, @炎臻 (PrettyFireNOI7) nice presentation of the bug report. Usually it is not encouraged to deviate from the template, but I actually like what you did here

Small note, @炎臻 (PrettyFireNOI7) nice presentation of the bug report. Usually it is not encouraged to deviate from the template, but I actually like what you did here

Thank you.