Crash after removing a "target" from any search button [e.g.UVMap node] and clicking again on the same button #75325

Closed
opened 2020-04-02 23:36:23 +02:00 by TheRedWaxPolice · 15 comments

System Information
Win 10

Blender Version
Broken: blender-2.83-a9963669f9d2-windows64
Worked: Not sure...

Short description of error
On nodes that have that "target" field (like the UVMap node etc), when you choose something from the list and then remove it by clicking on the (X) sign, if you don't move the mouse and click again on the same spot, blender crashes..

Exact steps for others to reproduce the error
In the shader editor, add a UVMap node, choose the uvmap in the "target" list, then remove it by clicking on (X). And without moving your mouse (or at least dont move it outside the button), click again on the same spot. Crash.
Double click on the (X) does the same thing..

See:

Untitled.mp4

**System Information** Win 10 **Blender Version** Broken: blender-2.83-a9963669f9d2-windows64 Worked: Not sure... **Short description of error** On nodes that have that "target" field (like the UVMap node etc), when you choose something from the list and then remove it by clicking on the (X) sign, if you don't move the mouse and click again on the same spot, blender crashes.. **Exact steps for others to reproduce the error** In the shader editor, add a UVMap node, choose the uvmap in the "target" list, then remove it by clicking on (X). And without moving your mouse (or at least dont move it outside the button), click again on the same spot. Crash. Double click on the (X) does the same thing.. See: [Untitled.mp4](https://archive.blender.org/developer/F8444875/Untitled.mp4)

Added subscriber: @TheRedWaxPolice

Added subscriber: @TheRedWaxPolice

#75345 was marked as duplicate of this issue

#75345 was marked as duplicate of this issue
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Philipp Oeser self-assigned this 2020-04-03 10:25:41 +02:00
Member

Confirmed, checking...

Confirmed, checking...
Philipp Oeser removed their assignment 2020-04-03 14:11:39 +02:00
Member

Added subscribers: @JulianEisel, @ideasman42

Added subscribers: @JulianEisel, @ideasman42
Member

Caused by c46dcdf887

Since above commit, ui_apply_but_funcs_after will free the buttons search_arg
Then back and forth between restoring search_arg while drawing UI_but_func_search_set() and freeing again ui_apply_but_func()
Not really sure how to reliably ensure UI_but_func_search_set is called last...

So here, but->search_arg is NULL

1  ui_rna_collection_search_cb interface_utils.c         399   0x1617183 
2  ui_searchbox_update         interface_region_search.c 379   0x15fa734 
3  ui_textedit_begin           interface_handlers.c      3368  0x15b9759 
4  button_activate_state       interface_handlers.c      7850  0x15c69c8 
5  ui_do_but_TEX               interface_handlers.c      4393  0x15bbf37 
6  ui_do_but_SEARCH_UNLINK     interface_handlers.c      4421  0x15bc04d 
7  ui_do_button                interface_handlers.c      7553  0x15c5eec 
8  ui_handle_button_event      interface_handlers.c      8702  0x15c8941 
9  ui_region_handler           interface_handlers.c      10623 0x15cd137 
10 wm_handler_ui_call          wm_event_system.c         617   0xab73e0  
11 wm_handlers_do_intern       wm_event_system.c         2724  0xabca1c  
12 wm_handlers_do              wm_event_system.c         2835  0xabce41  
13 wm_event_do_handlers        wm_event_system.c         3304  0xabe40f  
14 WM_main                     wm.c                      447   0xab27fe  
15 main                        creator.c                 524   0x672a39  

Crash could of course be prevented like so
P1321: #75325 bandaid



diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index a69837e9b51..c178fd5507b 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -396,6 +396,12 @@ void ui_rna_collection_search_cb(const struct bContext *C,
 {
   uiRNACollectionSearch *data = arg;
   char *name;
+
+  if (data == NULL) {
+    printf("%s: called with invalid but->search_arg\n", __func__);
+    return;
+  }
+
   int i = 0, iconid = 0, flag = RNA_property_flag(data->target_prop);
   ListBase *items_list = MEM_callocN(sizeof(ListBase), "items_list");
   CollItemSearch *cis;

But I guess there are better ways to solve this, @ideasman42, @JulianEisel?
Will set to Hig priority since it is a crash and it affects all search menus...

Caused by c46dcdf887 Since above commit, `ui_apply_but_funcs_after` will free the buttons `search_arg` Then back and forth between restoring `search_arg` while drawing `UI_but_func_search_set()` and freeing again `ui_apply_but_func()` Not really sure how to reliably ensure `UI_but_func_search_set` is called last... So here, `but->search_arg` is NULL ``` 1 ui_rna_collection_search_cb interface_utils.c 399 0x1617183 2 ui_searchbox_update interface_region_search.c 379 0x15fa734 3 ui_textedit_begin interface_handlers.c 3368 0x15b9759 4 button_activate_state interface_handlers.c 7850 0x15c69c8 5 ui_do_but_TEX interface_handlers.c 4393 0x15bbf37 6 ui_do_but_SEARCH_UNLINK interface_handlers.c 4421 0x15bc04d 7 ui_do_button interface_handlers.c 7553 0x15c5eec 8 ui_handle_button_event interface_handlers.c 8702 0x15c8941 9 ui_region_handler interface_handlers.c 10623 0x15cd137 10 wm_handler_ui_call wm_event_system.c 617 0xab73e0 11 wm_handlers_do_intern wm_event_system.c 2724 0xabca1c 12 wm_handlers_do wm_event_system.c 2835 0xabce41 13 wm_event_do_handlers wm_event_system.c 3304 0xabe40f 14 WM_main wm.c 447 0xab27fe 15 main creator.c 524 0x672a39 ``` Crash could of course be prevented like so [P1321: #75325 bandaid](https://archive.blender.org/developer/P1321.txt) ``` diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index a69837e9b51..c178fd5507b 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -396,6 +396,12 @@ void ui_rna_collection_search_cb(const struct bContext *C, { uiRNACollectionSearch *data = arg; char *name; + + if (data == NULL) { + printf("%s: called with invalid but->search_arg\n", __func__); + return; + } + int i = 0, iconid = 0, flag = RNA_property_flag(data->target_prop); ListBase *items_list = MEM_callocN(sizeof(ListBase), "items_list"); CollItemSearch *cis; ``` But I guess there are better ways to solve this, @ideasman42, @JulianEisel? Will set to Hig priority since it is a crash and it affects all search menus...
Philipp Oeser changed title from Crash after removing a "target" from a node and clicking again on the same spot to Crash after removing a "target" from any search button [e.g.UVMap node] and clicking again on the same button 2020-04-03 14:13:22 +02:00
Member

Added subscriber: @Raulus

Added subscriber: @Raulus

Added subscriber: @unwave

Added subscriber: @unwave

Does not crash:
2.83 (sub 6), branch: master, commit date: 2020-03-09 13:47, hash: 598ab525da
2.82 (sub 7), branch: master, commit date: 2020-03-12 05:06, hash: 375c7dc4ca

Crash:
2.83 (sub 11), branch: master, commit date: 2020-04-03 21:41, hash: 7c0e285948

Does not crash: 2.83 (sub 6), branch: master, commit date: 2020-03-09 13:47, hash: `598ab525da` 2.82 (sub 7), branch: master, commit date: 2020-03-12 05:06, hash: `375c7dc4ca` Crash: 2.83 (sub 11), branch: master, commit date: 2020-04-03 21:41, hash: `7c0e285948`
Member

thx investigating, we already know the commit that causes the issue (see above)

thx investigating, we already know the commit that causes the issue (see above)

Added subscriber: @NelsonNAS

Added subscriber: @NelsonNAS

Ah, so that's the reason blender is crashing a lot lately.
Any news on a fix for this?

Ah, so that's the reason blender is crashing a lot lately. Any news on a fix for this?
Member

@ideasman42 : mind checking?

@ideasman42 : mind checking?
Member

Closed as duplicate of #75203

Closed as duplicate of #75203
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 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#75325
No description provided.