EnumProperty with ENUM_FLAG causes a crash #84889
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#84889
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows 8.1 x64
Graphics card: Intel HD Graphics 520
Blender Version
Broken: Blender 2.91.0, Commit date: 2020-11-18 18:54, Hash
ad58999b0d
Worked: 2.90 (and below).
Additional files
blender.crash.txt is attached to this report.
Short description of error
Blender crashes when you click on the cells of an
bpy.props.EnumProperty
created with theENUM_FLAG
flag.Exact steps for others to reproduce the error
On a Text Editor view, create a new text datablock, paste the following script and run it.
It will create an EnumProperty and draw it on the 3D View header.
Clicking on any of its cells crashes Blender.
{F9588970}
Added subscriber: @RNavega
blender.crash.txt:
blender.crash.txt
Added subscriber: @lichtwerk
No crash here
Added subscriber: @rjg
Changed status from 'Needs Triage' to: 'Archived'
The
EnumProperty
is a bit more complicated to use. You are required to keep a reference to the values returned by the callback assigned toitems
. This is documented in the manual:This means you have to modify your script, so that each call to
myCustomEnumItems
stores the resulting value in a variable, thus keeping a reference. For a similar issue see blender/blender-addons#83360 and the fix blender/blender-addons@cef282cc9a.@rjg Hi, can you advise on how to apply the fix to that example script above? Below you can find a modified version that keeps a reference, but it still crashes in the same way. The change is in
myCustomEnumItems
:Crash file:
blender.crash.txt
Okay, this is interesting, since the crash is happening with a Windows build and as @lichtwerk said they couldn't reproduce the crash, I'm thinking this might be a Windows-only issue since the stacktrace has the crash happening with function
strchr
ofVCRUNTIME140.dll
.For completeness, I also did another test with a static list defined as a global variable so it's never lost, but the problem persists, check it out:
@RNavega I will take another look at this shortly.
Changed status from 'Archived' to: 'Resolved'
The issue you're having should be fixed by
256e77c987
. You aren't using the official release version of 2.91.0 from November 25 that contains the fix, please install the official release.You still need to keep a reference to the
items
though as I've said in my initial comment.@rjg it's working great on 2.91 from November 25 and up. And I will keep a reference to the dynamic EnumProperty items as recommended.
Thank you very much for your time!