Crash on Drag Collection color over to Collections #81589

Closed
opened 2020-10-09 23:52:00 +02:00 by Paul Muns · 12 comments

System Information
Operating system: Darwin-19.6.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro Vega 48 OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.10.18

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-10-08 22:15, hash: 2d5e38d4ec
Worked: (newest version of Blender that worked as expected)

Short description of error
[Please fill out a short description of the error here]

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]

Inside Preferences / Themes / click on Collection Colors. Click and drag (I used Purple) over to a Collection under Scene Collection. Upon arriving at the boundary of the 3D Viewport, Blender will crash.
Obviously this is not the intended way to color each Collection with an individual color ... the intended method is not apparent since clicking on any of the colors seems to do nothing.Screen Shot 2020-10-09 at 2.30.50 PM.png

**System Information** Operating system: Darwin-19.6.0-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro Vega 48 OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.10.18 **Blender Version** Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-10-08 22:15, hash: `2d5e38d4ec` Worked: (newest version of Blender that worked as expected) **Short description of error** [Please fill out a short description of the error here] **Exact steps for others to reproduce the error** [Please describe the exact steps needed to reproduce the issue] [Based on the default startup or an attached .blend file (as simple as possible)] Inside Preferences / Themes / click on Collection Colors. Click and drag (I used Purple) over to a Collection under Scene Collection. Upon arriving at the boundary of the 3D Viewport, Blender will crash. Obviously this is not the intended way to color each Collection with an individual color ... the intended method is not apparent since clicking on any of the colors seems to do nothing.![Screen Shot 2020-10-09 at 2.30.50 PM.png](https://archive.blender.org/developer/F8972504/Screen_Shot_2020-10-09_at_2.30.50_PM.png)
Author

Added subscriber: @PaulM44

Added subscriber: @PaulM44

Added subscriber: @rjg

Added subscriber: @rjg

I can confirm this crash with the current master. This can be reproduced by attempting to drag any color over to the outliner, not just from the theme preferences.

@PaulM44 In case this wasn't clear, the theme settings only allow you to configure the preset colors. Assigning a color to a collection is done by right-clicking on a collection in the outliner and then picking one of the color tags.

datastack_drop_init(bContext * C, const wmEvent * event, StackDropData * drop_data) Line 715	C
datastack_drop_poll(bContext * C, wmDrag * drag, const wmEvent * event, const unsigned char * * r_tooltip) Line 859	C
dropbox_active(bContext * C, ListBase * handlers, wmDrag * drag, const wmEvent * event) Line 208	C
wm_dropbox_active(bContext * C, wmDrag * drag, const wmEvent * event) Line 238	C
wm_drop_operator_options(bContext * C, wmDrag * drag, const wmEvent * event) Line 264	C
wm_drags_check_ops(bContext * C, const wmEvent * event) Line 284	C
wm_event_do_handlers(bContext * C) Line 3365	C
WM_main(bContext * C) Line 486	C
main(int argc, const unsigned char * * UNUSED_argv_c) Line 523	C
I can confirm this crash with the current master. This can be reproduced by attempting to drag any color over to the outliner, not just from the theme preferences. @PaulM44 In case this wasn't clear, the theme settings only allow you to configure the preset colors. Assigning a color to a collection is done by right-clicking on a collection in the outliner and then picking one of the color tags. ``` datastack_drop_init(bContext * C, const wmEvent * event, StackDropData * drop_data) Line 715 C datastack_drop_poll(bContext * C, wmDrag * drag, const wmEvent * event, const unsigned char * * r_tooltip) Line 859 C dropbox_active(bContext * C, ListBase * handlers, wmDrag * drag, const wmEvent * event) Line 208 C wm_dropbox_active(bContext * C, wmDrag * drag, const wmEvent * event) Line 238 C wm_drop_operator_options(bContext * C, wmDrag * drag, const wmEvent * event) Line 264 C wm_drags_check_ops(bContext * C, const wmEvent * event) Line 284 C wm_event_do_handlers(bContext * C) Line 3365 C WM_main(bContext * C) Line 486 C main(int argc, const unsigned char * * UNUSED_argv_c) Line 523 C ```

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

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

Sorry Robert, now that I see how beautiful the menu is after RT-clicking the Collection, I feel kinda dumb. However, so many graphics programs allow this kind of drag'n'drop that it is like an atavistic action to try it. I hope it is easy to fix.

Sorry Robert, now that I see how beautiful the menu is after RT-clicking the Collection, I feel kinda dumb. However, so many graphics programs allow this kind of drag'n'drop that it is like an atavistic action to try it. I hope it is easy to fix.

It appears that datastack_drop_poll doesn't check that drag->type matches the expected type and always interprets the pointer in drag->poin as a pointer to StackDropData. This is obviously not correct in case the drag and drop is for e.g. color. Interpreting the memory it points to as pointer and attempting to dereference it in datastack_drop_init by using drop_data->drag_tselem->type results in the segmentation fault.

Adding the following check to datastack_drop_poll should avoid this issue:

if (drag->type != WM_DRAG_ID) {
   return false;
}

I will post a diff shortly.

It appears that `datastack_drop_poll` doesn't check that `drag->type` matches the expected type and always interprets the pointer in `drag->poin` as a pointer to `StackDropData`. This is obviously not correct in case the drag and drop is for e.g. color. Interpreting the memory it points to as pointer and attempting to dereference it in `datastack_drop_init` by using `drop_data->drag_tselem->type` results in the segmentation fault. Adding the following check to `datastack_drop_poll` should avoid this issue: ``` if (drag->type != WM_DRAG_ID) { return false; } ``` I will post a diff shortly.

This issue was referenced by 8427e02abc

This issue was referenced by 8427e02abc5e7963cee14e15bc9a1c78c95d28e6

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Robert Guetzkow self-assigned this 2020-10-13 01:19:47 +02:00
Author

Changed status from 'Resolved' to: 'Archived'

Changed status from 'Resolved' to: 'Archived'
Author

Screen Shot 2020-10-12 at 5.22.10 PM.png

Sorry but I just downloaded the latest version and tried it a couple of times with the same result. I fear that every item in Preferences might be susceptible to this problem. Then again, how many are stupid enough to try this? Maybe time better spent elsewhere for now?

![Screen Shot 2020-10-12 at 5.22.10 PM.png](https://archive.blender.org/developer/F8984336/Screen_Shot_2020-10-12_at_5.22.10_PM.png) Sorry but I just downloaded the latest version and tried it a couple of times with the same result. I fear that every item in Preferences might be susceptible to this problem. Then again, how many are stupid enough to try this? Maybe time better spent elsewhere for now?

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'

@PaulM44 I've committed the change to master on October 13 at 01:17 AM CEST, so the patch wasn't included in the last daily build. Check again tomorrow and it should be fixed. If you do find other cases that cause a crash with drag and drop, please create a new bug report.

@PaulM44 I've committed the change to master on October 13 at 01:17 AM CEST, so the patch wasn't included in the last daily build. Check again tomorrow and it should be fixed. If you do find other cases that cause a crash with drag and drop, please create a new bug report.
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
3 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#81589
No description provided.