crash in ui_def_but_rna #54458

Closed
opened 2018-03-29 02:31:20 +02:00 by Ray molenkamp · 9 comments
Member

System Information
Windows x64.

Blender Version
Broken: latest master.
Worked: 2.79

Short description of error
strlen is called on what looks to be freed memory (ASAN will probably have a thing or two to say about this)

Exact steps for others to reproduce the error
Open up .blend, click 'run script'

For repro on windows you need the debug heap enabled, on linux ASAN should be able to catch it.

ui_crash.blend

>	blender.exe!strlen() Line 70	Unknown

 	blender.exe!ui_def_but(uiBlock * block, int type, int retval, const unsigned char * str, int x, int y, short width, short height, void * poin, float min, float max, float a1, float a2, const unsigned char * tip) Line 3182	C
 	blender.exe!ui_def_but_rna(uiBlock * block, int type, int retval, const unsigned char * str, int x, int y, short width, short height, PointerRNA * ptr, PropertyRNA * prop, int index, float min, float max, float a1, float a2, const unsigned char * tip) Line 3575	C
 	blender.exe!uiDefButR_prop(uiBlock * block, int type, int retval, const unsigned char * str, int x, int y, short width, short height, PointerRNA * ptr, PropertyRNA * prop, int index, float min, float max, float a1, float a2, const unsigned char * tip) Line 3831	C
 	blender.exe!uiDefAutoButR(uiBlock * block, PointerRNA * ptr, PropertyRNA * prop, int index, const unsigned char * name, int icon, int x1, int y1, int x2, int y2) Line 112	C
 	blender.exe!ui_item_with_label(uiLayout * layout, uiBlock * block, const unsigned char * name, int icon, PointerRNA * ptr, PropertyRNA * prop, int index, int x, int y, int w, int h, int flag) Line 722	C
 	blender.exe!uiItemFullR(uiLayout * layout, PointerRNA * ptr, PropertyRNA * prop, int index, int value, int flag, const unsigned char * name, int icon) Line 1468	C
 	blender.exe!rna_uiItemR(uiLayout * layout, PointerRNA * ptr, const unsigned char * propname, const unsigned char * name, const unsigned char * text_ctxt, int translate, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index, int icon_value) Line 126	C
 	blender.exe!UILayout_prop_call(bContext * C, ReportList * reports, PointerRNA * _ptr, ParameterList * _parms) Line 1428	C
 	blender.exe!RNA_function_call(bContext * C, ReportList * reports, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 6474	C
 	blender.exe!pyrna_func_call(BPy_FunctionRNA * self, _object * args, _object * kw) Line 5673	C
 	python36_d.dll!_PyObject_FastCallDict(_object * func, _object * * args, __int64 nargs, _object * kwargs) Line 2316	C
 	python36_d.dll!_PyObject_FastCallKeywords(_object * func, _object * * stack, __int64 nargs, _object * kwnames) Line 2481	C
 	python36_d.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4836	C
 	python36_d.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3312	C
 	python36_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, __int64 argcount, _object * * kwnames, _object * * kwargs, __int64 kwcount, int kwstep, _object * * defs, __int64 defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4139	C
 	python36_d.dll!PyEval_EvalCodeEx(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure) Line 4166	C
 	python36_d.dll!function_call(_object * func, _object * arg, _object * kw) Line 604	C
 	python36_d.dll!PyObject_Call(_object * func, _object * args, _object * kwargs) Line 2246	C
 	blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 7757	C
 	blender.exe!panel_draw(const bContext * C, Panel * pnl) Line 148	C
 	blender.exe!ED_region_panels(const bContext * C, ARegion * ar, const unsigned char * context, int contextnr, const bool vertical) Line 1920	C
 	blender.exe!buttons_main_region_draw(const bContext * C, ARegion * ar) Line 147	C
 	blender.exe!ED_region_do_draw(bContext * C, ARegion * ar) Line 522	C
 	blender.exe!wm_method_draw_triple(bContext * C, wmWindow * win) Line 610	C
 	blender.exe!wm_draw_update(bContext * C) Line 1000	C
 	blender.exe!WM_main(bContext * C) Line 523	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 529	C
 	[External Code]	
**System Information** Windows x64. **Blender Version** Broken: latest master. Worked: 2.79 **Short description of error** strlen is called on what looks to be freed memory (ASAN will probably have a thing or two to say about this) **Exact steps for others to reproduce the error** Open up .blend, click 'run script' For repro on windows you need the debug heap enabled, on linux ASAN should be able to catch it. [ui_crash.blend](https://archive.blender.org/developer/F2532213/ui_crash.blend) ``` > blender.exe!strlen() Line 70 Unknown blender.exe!ui_def_but(uiBlock * block, int type, int retval, const unsigned char * str, int x, int y, short width, short height, void * poin, float min, float max, float a1, float a2, const unsigned char * tip) Line 3182 C blender.exe!ui_def_but_rna(uiBlock * block, int type, int retval, const unsigned char * str, int x, int y, short width, short height, PointerRNA * ptr, PropertyRNA * prop, int index, float min, float max, float a1, float a2, const unsigned char * tip) Line 3575 C blender.exe!uiDefButR_prop(uiBlock * block, int type, int retval, const unsigned char * str, int x, int y, short width, short height, PointerRNA * ptr, PropertyRNA * prop, int index, float min, float max, float a1, float a2, const unsigned char * tip) Line 3831 C blender.exe!uiDefAutoButR(uiBlock * block, PointerRNA * ptr, PropertyRNA * prop, int index, const unsigned char * name, int icon, int x1, int y1, int x2, int y2) Line 112 C blender.exe!ui_item_with_label(uiLayout * layout, uiBlock * block, const unsigned char * name, int icon, PointerRNA * ptr, PropertyRNA * prop, int index, int x, int y, int w, int h, int flag) Line 722 C blender.exe!uiItemFullR(uiLayout * layout, PointerRNA * ptr, PropertyRNA * prop, int index, int value, int flag, const unsigned char * name, int icon) Line 1468 C blender.exe!rna_uiItemR(uiLayout * layout, PointerRNA * ptr, const unsigned char * propname, const unsigned char * name, const unsigned char * text_ctxt, int translate, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index, int icon_value) Line 126 C blender.exe!UILayout_prop_call(bContext * C, ReportList * reports, PointerRNA * _ptr, ParameterList * _parms) Line 1428 C blender.exe!RNA_function_call(bContext * C, ReportList * reports, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 6474 C blender.exe!pyrna_func_call(BPy_FunctionRNA * self, _object * args, _object * kw) Line 5673 C python36_d.dll!_PyObject_FastCallDict(_object * func, _object * * args, __int64 nargs, _object * kwargs) Line 2316 C python36_d.dll!_PyObject_FastCallKeywords(_object * func, _object * * stack, __int64 nargs, _object * kwnames) Line 2481 C python36_d.dll!call_function(_object * * * pp_stack, __int64 oparg, _object * kwnames) Line 4836 C python36_d.dll!_PyEval_EvalFrameDefault(_frame * f, int throwflag) Line 3312 C python36_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, __int64 argcount, _object * * kwnames, _object * * kwargs, __int64 kwcount, int kwstep, _object * * defs, __int64 defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4139 C python36_d.dll!PyEval_EvalCodeEx(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure) Line 4166 C python36_d.dll!function_call(_object * func, _object * arg, _object * kw) Line 604 C python36_d.dll!PyObject_Call(_object * func, _object * args, _object * kwargs) Line 2246 C blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 7757 C blender.exe!panel_draw(const bContext * C, Panel * pnl) Line 148 C blender.exe!ED_region_panels(const bContext * C, ARegion * ar, const unsigned char * context, int contextnr, const bool vertical) Line 1920 C blender.exe!buttons_main_region_draw(const bContext * C, ARegion * ar) Line 147 C blender.exe!ED_region_do_draw(bContext * C, ARegion * ar) Line 522 C blender.exe!wm_method_draw_triple(bContext * C, wmWindow * win) Line 610 C blender.exe!wm_draw_update(bContext * C) Line 1000 C blender.exe!WM_main(bContext * C) Line 523 C blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 529 C [External Code] ```
Author
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Author
Member

Added subscriber: @VukGardasevic

Added subscriber: @VukGardasevic
Author
Member

script is by @VukGardasevic for testing D2918

script is by @VukGardasevic for testing [D2918](https://archive.blender.org/developer/D2918)

Added subscriber: @brecht

Added subscriber: @brecht

I didn't check if it's the same issue, but there is a documented bug that sounds similar:
https://docs.blender.org/api/2.79/bpy.props.html#bpy.props.EnumProperty

I didn't check if it's the same issue, but there is a documented bug that sounds similar: https://docs.blender.org/api/2.79/bpy.props.html#bpy.props.EnumProperty

Added subscriber: @ideasman42

Added subscriber: @ideasman42

@brecht yes, thats the bug. We could workaround this by over allocating the return value of enum_items_from_py, storing the string data at the end.

While this would backfire if Blender ever tries to copy the enum, I don't think we do this at the moment.

Another option could be to allocate or intern strings and have a flag in each EnumPropertyItem to mark is as different.

@brecht yes, thats the bug. We could workaround this by over allocating the return value of `enum_items_from_py`, storing the string data at the end. While this would backfire if Blender ever tries to copy the enum, I don't think we do this at the moment. Another option could be to allocate or intern strings and have a flag in each `EnumPropertyItem` to mark is as different.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2018-03-29 09:00:03 +02:00

Archiving since this is a known issue.

Archiving since this is a known issue.
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#54458
No description provided.