Crash when going to Properties Editor object properties with Custom Property containing nested dictionary [named "asset_data"] #84091

Closed
opened 2020-12-24 00:36:39 +01:00 by CarlG · 17 comments

System Information
Operating system: Linux-4.15.0-126-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: Radeon RX Vega (VEGA10, DRM 3.23.0, 4.15.0-126-generic, LLVM 10.0.0) X.Org 4.6 (Core Profile) Mesa 20.0.8

Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-22 20:58, hash: 8d3d4c8840
Worked: 2.90 seems to work fine.
Caused by b71eb3a105

Short description of error
Crash when selecting object properties tab. This started happening when I added (as append) some assets from BlenderKit. I have no idea which BlenderKit asset broke the file. I was just messing around testing some stuff.

Exact steps for others to reproduce the error
Open the file with UI. Select object properties. Crash.
See attached file, I think I was able to delete all nonsense like textures or my custom library stuff from it.
CrashFile2.blend

**System Information** Operating system: Linux-4.15.0-126-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: Radeon RX Vega (VEGA10, DRM 3.23.0, 4.15.0-126-generic, LLVM 10.0.0) X.Org 4.6 (Core Profile) Mesa 20.0.8 **Blender Version** Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-22 20:58, hash: `8d3d4c8840` Worked: 2.90 seems to work fine. Caused by b71eb3a105 **Short description of error** Crash when selecting object properties tab. This started happening when I added (as append) some assets from BlenderKit. I have no idea which BlenderKit asset broke the file. I was just messing around testing some stuff. **Exact steps for others to reproduce the error** Open the file with UI. Select object properties. Crash. See attached file, I think I was able to delete all nonsense like textures or my custom library stuff from it. [CrashFile2.blend](https://archive.blender.org/developer/F9527413/CrashFile2.blend)
Author

Added subscriber: @CarlG

Added subscriber: @CarlG
Member

Added subscribers: @VilemDuha, @EAW

Added subscribers: @VilemDuha, @EAW
Member

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

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

I can confirm.

@VilemDuha Here is my stack trace: CrashFile2.crash.txt


Tested using: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-24 19:11, hash: af316d2761, type: Release
build date: 2020-12-24, 22:31:17
OS: Windows-10-10.0.19041.630-SP0 64 Bits
GPU: GeForce GTX 470/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 391.35
CPU: i7-950 @3.07 GHz SSE2 SSE3 SSE41
RAM: 8.00 GB

I can confirm. @VilemDuha Here is my stack trace: [CrashFile2.crash.txt](https://archive.blender.org/developer/F9529229/CrashFile2.crash.txt) --- Tested using: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-24 19:11, hash: af316d276144, type: Release build date: 2020-12-24, 22:31:17 OS: Windows-10-10.0.19041.630-SP0 64 Bits GPU: GeForce GTX 470/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 391.35 CPU: i7-950 @3.07 GHz SSE2 SSE3 SSE41 RAM: 8.00 GB
Member

Confirmed also here, I did investigate. Not really caused by the addon, but by a nested dictionary in a custom property - a thing that is working fine in previous versions.

Crash your blender instantly with running this with an object selected and then switching to object properties:

import bpy

data = {
    "test_lvl1":"Hi",
    "author": {
        "name": "Joe",
        "surname": "De la Mancha"
    }
}

bpy.context.active_object['asset_data'] = data

The reason why object properties is probably very clear too, that's where blender displays custom properties in a panel

Confirmed also here, I did investigate. Not really caused by the addon, but by a nested dictionary in a custom property - a thing that is working fine in previous versions. Crash your blender instantly with running this with an object selected and then switching to object properties: ``` import bpy data = { "test_lvl1":"Hi", "author": { "name": "Joe", "surname": "De la Mancha" } } bpy.context.active_object['asset_data'] = data ``` The reason why object properties is probably very clear too, that's where blender displays custom properties in a panel
Member

Just a guess: removing the ability for custom properties to contain quotes from Blender’s python API seems like a likely candidate as the cause of this issue.

ceba6b2c21

Just a guess: removing the ability for custom properties to contain quotes from Blender’s python API seems like a likely candidate as the cause of this issue. ceba6b2c21
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Will check

Will check
Philipp Oeser changed title from Crash when going to object properties with BlenderKit asset. to Crash when going to Properties Editor object properties with Custom Property containing nested dictionary 2020-12-27 12:38:13 +01:00
Member

Setting to High prio since it is a crash regression and we have bisected to the culprit commit.

Setting to High prio since it is a crash regression and we have bisected to the culprit commit.
Member

Added subscribers: @JulianEisel, @mont29

Added subscribers: @JulianEisel, @mont29
Member

For some reason, I cannot reproduce from scratch using the script @VilemDuha provided.

Anyways, opening that file, I assume blender gets confused with the Custom Property asset_data:

  • in rna_idp_path, RNA_struct_find_property will find a property matching "asset_data" (but it is not the Custom Property, but the new one introduced in b71eb3a105)
  • blender will then continue to go that route with ID_asset_data_get, but of course that will return bogus (because we are not actually dealing with the expected "internal" asset_data, but a Custom Property...)
1   RNA_struct_iterator_property          rna_access.c     772  0x3950f98 
2   RNA_struct_find_property              rna_access.c     879  0x39511cd 
3   rna_idp_path                          rna_access.c     5713 0x395d7d5 
4   rna_idp_path                          rna_access.c     5718 0x395d83c 
5   RNA_path_from_struct_to_idproperty    rna_access.c     5766 0x395d9f1 
6   rna_path_from_ID_to_idpgroup          rna_access.c     5784 0x395da68 
7   RNA_path_from_ID_to_struct            rna_access.c     5885 0x395dd5b 
8   RNA_path_from_ID_to_property_index    rna_access.c     5962 0x395e056 
9   RNA_path_from_ID_to_property          rna_access.c     6006 0x395e205 
10  BKE_animdata_driver_path_hack         anim_data.c      737  0x313f04d 
11  BKE_fcurve_find_by_rna_context_ui     fcurve.c         425  0x31c47dd 
12  ui_but_get_fcurve                     interface_anim.c 65   0x40c3cb9 
13  ui_but_anim_flag                      interface_anim.c 84   0x40c3d16 
14  UI_block_end_ex                       interface.c      1877 0x40b6085 
15  UI_block_end                          interface.c      1941 0x40b62e5 
16  ed_panel_draw                         area.c           2730 0x3bc7626 
17  ED_region_panels_layout_ex            area.c           2913 0x3bc7e3f 
18  buttons_main_region_layout_properties space_buttons.c  313  0x960c84e 
19  buttons_main_region_layout            space_buttons.c  507  0x960d328 

I havent checked code further, it would be kind of surprising if Custom Properties are as fragile as not being allowed to be named equally to existing datablock properties.

@JulianEisel, @mont29 might know more already?

For some reason, I cannot reproduce from scratch using the script @VilemDuha provided. Anyways, opening that file, I assume blender gets confused with the Custom Property `asset_data`: - in `rna_idp_path`, `RNA_struct_find_property` will find a property matching "asset_data" (but it is not the Custom Property, but the new one introduced in b71eb3a105) - blender will then continue to go that route with `ID_asset_data_get`, but of course that will return bogus (because we are not actually dealing with the expected "internal" asset_data, but a Custom Property...) ``` 1 RNA_struct_iterator_property rna_access.c 772 0x3950f98 2 RNA_struct_find_property rna_access.c 879 0x39511cd 3 rna_idp_path rna_access.c 5713 0x395d7d5 4 rna_idp_path rna_access.c 5718 0x395d83c 5 RNA_path_from_struct_to_idproperty rna_access.c 5766 0x395d9f1 6 rna_path_from_ID_to_idpgroup rna_access.c 5784 0x395da68 7 RNA_path_from_ID_to_struct rna_access.c 5885 0x395dd5b 8 RNA_path_from_ID_to_property_index rna_access.c 5962 0x395e056 9 RNA_path_from_ID_to_property rna_access.c 6006 0x395e205 10 BKE_animdata_driver_path_hack anim_data.c 737 0x313f04d 11 BKE_fcurve_find_by_rna_context_ui fcurve.c 425 0x31c47dd 12 ui_but_get_fcurve interface_anim.c 65 0x40c3cb9 13 ui_but_anim_flag interface_anim.c 84 0x40c3d16 14 UI_block_end_ex interface.c 1877 0x40b6085 15 UI_block_end interface.c 1941 0x40b62e5 16 ed_panel_draw area.c 2730 0x3bc7626 17 ED_region_panels_layout_ex area.c 2913 0x3bc7e3f 18 buttons_main_region_layout_properties space_buttons.c 313 0x960c84e 19 buttons_main_region_layout space_buttons.c 507 0x960d328 ``` I havent checked code further, it would be kind of surprising if Custom Properties are as fragile as not being allowed to be named equally to existing datablock properties. @JulianEisel, @mont29 might know more already?
Philipp Oeser changed title from Crash when going to Properties Editor object properties with Custom Property containing nested dictionary to Crash when going to Properties Editor object properties with Custom Property containing nested dictionary [named "asset_data"] 2020-12-27 13:16:52 +01:00
Member

Didn't think it could be the name. Did one more test - when I assign as 'asset_data' I get a crash.
However, when I first assign the same dict as a different property name ('test'), go to object properties (where it correctly draws) I can actually afterward assign also 'asset_data' without a crash.
This works only when I first go to object properties between the assignments. If I assign both props one after another I get the crash.

Didn't think it could be the name. Did one more test - when I assign as 'asset_data' I get a crash. However, when I first assign the same dict as a different property name ('test'), go to object properties (where it correctly draws) I can actually afterward assign also 'asset_data' without a crash. This works only when I first go to object properties between the assignments. If I assign both props one after another I get the crash.
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

In d1cedf53fa @ideasman42 reverted cbae82ba96 giving the following reasons:

This change introduced the following problems:

  • We could no longer reliably duplicate or use an existing custom property names.
  • We could no longer assume a bone or ID name can be used in a custom-property.
    
  • Importers that support custom properties (such as FBX) could fail with an exception creating custom properties.
    

@ideasman42, given the above list and the 8 commits on Dec 9-10 to rnaaccess.c, I figure you might best know more about why this issue is occurring and how to answer @lichtwerk's question statement above:

I haven't checked code further, it would be kind of surprising if Custom Properties are as fragile as not being allowed to be named equally to existing datablock properties.


For some reason, I cannot reproduce from scratch using the script @Vilem Duha (pildanovak) provided.

I had the same issue, thanks for the clarifications @lichtwerk and @VilemDuha!

In d1cedf53fa @ideasman42 reverted cbae82ba96 giving the following reasons: >This change introduced the following problems: >- We could no longer reliably duplicate or use an existing custom property names. >- We could no longer assume a bone or ID name can be used in a custom-property. >- Importers that support custom properties (such as FBX) could fail with an exception creating custom properties. @ideasman42, given the above list and the [8 commits on Dec 9-10](https:*developer.blender.org/diffusion/B/history/master/source/blender/makesrna/intern/rna_access.c) to [rnaaccess.c](https:*developer.blender.org/diffusion/B/browse/master/source/blender/makesrna/intern/rna_access.c), I figure you might best know more about why this issue is occurring and how to answer @lichtwerk's ~~question~~ statement above: >I haven't checked code further, it would be kind of surprising if Custom Properties are as fragile as not being allowed to be named equally to existing datablock properties. --- >For some reason, I cannot reproduce from scratch using the script @Vilem Duha (pildanovak) provided. I had the same issue, thanks for the clarifications @lichtwerk and @VilemDuha!

This issue was referenced by ad63d2f60e

This issue was referenced by ad63d2f60e240af9710492f0c1a3b008ce0bf8e6

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Bastien Montagne self-assigned this 2020-12-28 17:40:36 +01:00
Author

Oh, cool, and thanks. Seems to have been fixed in 2020-12-28 21:34 version (Linux).

Oh, cool, and thanks. Seems to have been fixed in 2020-12-28 21:34 version (Linux).
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#84091
No description provided.