Page MenuHome

Crash when going to Properties Editor object properties with Custom Property containing nested dictionary [named "asset_data"]
Closed, ResolvedPublicBUG

Description

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: rB8d3d4c884084
Worked: 2.90 seems to work fine.
Caused by rBb71eb3a105b8: Asset System: Data-block asset metadata storage, reading and API

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.

Event Timeline

Evan Wilson (EAW) changed the task status from Needs Triage to Confirmed.Dec 25 2020, 4:25 AM
Evan Wilson (EAW) edited projects, added Add-ons (Community); removed BF Blender.

I can confirm.

@Vilem Duha (pildanovak) Here is my stack trace:


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

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

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.

rBceba6b2c2161: Fix T78823: Slash in custom property name does not work

Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Bug".

Will check

Philipp Oeser (lichtwerk) renamed this task 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.Dec 27 2020, 12:38 PM
Philipp Oeser (lichtwerk) triaged this task as High priority.
Philipp Oeser (lichtwerk) updated the task description. (Show Details)

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

For some reason, I cannot reproduce from scratch using the script @Vilem Duha (pildanovak) 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 rBb71eb3a105b8)
  • 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.

@Julian Eisel (Severin), @Bastien Montagne (mont29) might know more already?

Philipp Oeser (lichtwerk) renamed this task 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"].Dec 27 2020, 1:16 PM

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.

In rBd1cedf53faaf @Campbell Barton (campbellbarton) reverted rBcbae82ba960a 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.

@Campbell Barton (campbellbarton), 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 @Philipp Oeser (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 @Philipp Oeser (lichtwerk) and @Vilem Duha (pildanovak)!

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