Maniphest T100203

Freeze using `override_hierarchy_create` with Object level property with custom getter function
Closed, ResolvedBUG

Assigned To
Bastien Montagne (mont29)
Authored By
Yann Lanthony (yann-lty)
Aug 4 2022, 4:20 PM
Tags
  • BF Blender
  • Core
  • Overrides
Subscribers
Bastien Montagne (mont29)
Falk David (filedescriptor)
Richard Antalik (ISS)
Yann Lanthony (yann-lty)

Description

System Information
Operating system: Windows 10

Blender Version
Broken: 3.0 up to 3.4.0 Alpha (branch: master, commit date: 2022-08-03 23:20, hash: rB2083b9ae5431)
Worked: ?

Short description of error
If a property with a custom getter function is registered at Object type level in Python, linking an external collection and making library hierarchy overrides ends up freezing Blender.
This issue does not occur if the property does not have a getter function.

Exact steps for others to reproduce the error

  • Download the two attached blend files in the same folder.
  • Open main.blend.
  • Run the embedded script it opens on (override_freeze.py).
  • Blender should freeze.

A few extra test cases are available in the script to show other conditions under which the same code works.

Revisions and Commits

rB Blender
Abandoned

Related Objects

Mentioned In
T101618: Freeze when reloading a library while having an Object property with a custom getter function defined in Python
rBfd57f520acb1: Py API doc: Add warning that py-defined property accessor callbacks may be…

Event Timeline

Yann Lanthony (yann-lty) created this task.Aug 4 2022, 4:20 PM
Yann Lanthony (yann-lty) updated the task description.Aug 4 2022, 4:25 PM
Falk David (filedescriptor) added a subscriber: Falk David (filedescriptor).Aug 4 2022, 4:26 PM

I can confirm this on my system as well (with Blender 3.2.2):

System Information
Operating system: Linux-5.15.0-10041-tuxedo-x86_64-with-glibc2.35 64 Bits
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.141.03

Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Aug 4 2022, 7:02 PM
Richard Antalik (ISS) added projects: Core, Overrides.
Richard Antalik (ISS) added a subscriber: Richard Antalik (ISS).

Thread hangs on:

 	python310_d.dll!_PyCOND_WAIT_MS(_PyCOND_T * cv, _RTL_CRITICAL_SECTION * cs, unsigned long ms) Řádek 171	C
 	[Vložený rámec] python310_d.dll!PyCOND_TIMEDWAIT(_PyCOND_T *) Řádek 201	C
 	python310_d.dll!take_gil(_ts * tstate) Řádek 255	C
 	python310_d.dll!PyEval_RestoreThread(_ts * tstate) Řádek 549	C
 	python310_d.dll!PyGILState_Ensure() Řádek 1527	C
>	blender.exe!bpy_prop_boolean_get_fn(PointerRNA * ptr, PropertyRNA * prop) Řádek 602	C
 	blender.exe!RNA_property_boolean_get(PointerRNA * ptr, PropertyRNA * prop) Řádek 2169	C
 	blender.exe!rna_property_override_diff_default(Main * bmain, PropertyRNAOrID * prop_a, PropertyRNAOrID * prop_b, const int mode, IDOverrideLibrary * override, const unsigned char * rna_path, const unsigned __int64 rna_path_len, const int flags, bool * r_override_changed) Řádek 1663	C
 	blender.exe!rna_property_override_diff(Main * bmain, PropertyRNAOrID * prop_a, PropertyRNAOrID * prop_b, const unsigned char * rna_path, const unsigned __int64 rna_path_len, eRNACompareMode mode, IDOverrideLibrary * override, const eRNAOverrideMatch flags, eRNAOverrideMatchResult * r_report_flags) Řádek 422	C
 	blender.exe!RNA_struct_override_matches(Main * bmain, PointerRNA * ptr_local, PointerRNA * ptr_reference, const unsigned char * root_path, const unsigned __int64 root_path_len, IDOverrideLibrary * override, const eRNAOverrideMatch flags, eRNAOverrideMatchResult * r_report_flags) Řádek 793	C
 	blender.exe!BKE_lib_override_library_operations_create(Main * bmain, ID * local) Řádek 3256	C++
 	blender.exe!lib_override_library_operations_create_cb(TaskPool * pool, void * taskdata) Řádek 3284	C++
 	blender.exe!Task::operator()() Řádek 165	C++
 	blender.exe!tbb::internal::function_task<Task>::execute() Řádek 1060	C++
Bastien Montagne (mont29) moved this task from Backlog to Blender 3.3 on the Overrides board.Aug 5 2022, 10:26 AM
Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".
Bastien Montagne (mont29) added a subscriber: Bastien Montagne (mont29).

Uhu... well yes, python code can only be executed in main thread... :(

I guess we'll have no choice but to exclude those IDs from threaded override diff processing. There will be a cost on performances.

Bastien Montagne (mont29) moved this task from Backlog to Bugs on the Core board.Aug 8 2022, 10:54 AM
Bastien Montagne (mont29) closed this task as Resolved by committing rB62eb21e3ce87: Fix T100203: Freeze using `override_hierarchy_create` with Object level….Aug 12 2022, 4:23 PM
Bastien Montagne (mont29) claimed this task.
Bastien Montagne (mont29) added a commit: rB62eb21e3ce87: Fix T100203: Freeze using `override_hierarchy_create` with Object level….
Bastien Montagne (mont29) mentioned this in rBfd57f520acb1: Py API doc: Add warning that py-defined property accessor callbacks may be….