Freeze when using Object.ray_cast in a driver script #85641

Open
opened 2021-02-15 02:57:18 +01:00 by Amelia · 4 comments

System Information
Operating system: Linux-5.10.15-1-MANJARO-x86_64-with-arch-Manjaro-Linux 64 Bits
Graphics card: Radeon RX 580 Series (POLARIS10, DRM 3.40.0, 5.10.15-1-MANJARO, LLVM 11.0.1) AMD 4.6 (Core Profile) Mesa 20.3.4

Blender Version
Broken: version: 2.91.2, branch: master, commit date: 2021-01-19 16:15, hash: 5be9ef4177, 8dc95f61f3
Worked: Unknown, fails on at least as old as 2.83.10.

Short description of error
Running a driver that includes a call to Object.ray_cast will freeze the interface entirely. Still exits normally when sent a SIGTERM. It does not create a crash.txt. Blender crashes with a segmentation fault in version 2.83.10 (hash: b439a155442b), and does create a crash.txt (see attached). Blender version 2.93.0 Alpha (hash: 7a608f88a713) also freezes in the same way as 2.91.2. Using the ray_cast function in a non-driver script appears to function as expected.

Exact steps for others to reproduce the error
In the attached blend file, run the text block TurretRayCasting.py, to put the script into the driver namespace. Next, click "update dependencies" in the driver panel. The application should freeze entirely. If return target.ray_cast(turretTargetSpace, direction)- [x] is commented out and replaced with return True, the application does not freeze.

driver_freeze2.blend

driver_freeze2.crash.txt

system-info-2.91.2.txt

**System Information** Operating system: Linux-5.10.15-1-MANJARO-x86_64-with-arch-Manjaro-Linux 64 Bits Graphics card: Radeon RX 580 Series (POLARIS10, DRM 3.40.0, 5.10.15-1-MANJARO, LLVM 11.0.1) AMD 4.6 (Core Profile) Mesa 20.3.4 **Blender Version** Broken: version: 2.91.2, branch: master, commit date: 2021-01-19 16:15, hash: `5be9ef4177`, 8dc95f61f3 Worked: Unknown, fails on at least as old as 2.83.10. **Short description of error** Running a driver that includes a call to Object.ray_cast will freeze the interface entirely. Still exits normally when sent a SIGTERM. It does not create a crash.txt. Blender crashes with a segmentation fault in version 2.83.10 (hash: `b439a155442b`), and does create a crash.txt (see attached). Blender version 2.93.0 Alpha (hash: `7a608f88a713`) also freezes in the same way as 2.91.2. Using the ray_cast function in a non-driver script appears to function as expected. **Exact steps for others to reproduce the error** In the attached blend file, run the text block `TurretRayCasting.py`, to put the script into the driver namespace. Next, click "update dependencies" in the driver panel. The application should freeze entirely. If `return target.ray_cast(turretTargetSpace, direction)- [x]` is commented out and replaced with `return True`, the application does not freeze. [driver_freeze2.blend](https://archive.blender.org/developer/F9802556/driver_freeze2.blend) [driver_freeze2.crash.txt](https://archive.blender.org/developer/F9802557/driver_freeze2.crash.txt) [system-info-2.91.2.txt](https://archive.blender.org/developer/F9802572/system-info-2.91.2.txt)
Author

Added subscriber: @StarshipRobo

Added subscriber: @StarshipRobo
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

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

Changed status from 'Needs Triage' to: 'Confirmed'
Member
- 0   in __psynch_cvwait ()
- 1   in _pthread_cond_wait ()
- 2   in PyCOND_TIMEDWAIT [inlined] at /python/src/external_python/Python/condvar.h:73
- 3   in take_gil at /python/src/external_python/Python/ceval_gil.h:247
- 4   in PyEval_RestoreThread at /python/src/external_python/Python/ceval.c:467
- 5   in PyGILState_Ensure at /python/src/external_python/Python/pystate.c:1378
- 6   in BPY_DECREF at source/blender/python/intern/bpy_interface.c:617
- 7   in fcurve_free_driver at source/blender/blenkernel/intern/fcurve_driver.c:930
- 8   in BKE_fcurve_free at source/blender/blenkernel/intern/fcurve.c:95
- 9   in BKE_fcurves_free at source/blender/blenkernel/intern/fcurve.c:118
- 10  in BKE_animdata_free at source/blender/blenkernel/intern/anim_data.c:256
- 11  in BKE_libblock_free_data at source/blender/blenkernel/intern/lib_id_delete.c:72
- 12  in blender::deg::deg_free_copy_on_write_datablock(ID*) at source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:1080
- 13  in blender::deg::deg_update_copy_on_write_datablock(blender::deg::Depsgraph const*, blender::deg::IDNode const*) at source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:958
- 14  in blender::deg::deg_evaluate_copy_on_write(Depsgraph*, blender::deg::IDNode const*) at source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:1094
- 15  in blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0::operator()(Depsgraph*) const at source/blender/depsgraph/intern/builder/deg_builder_nodes.cc:181
- 16  in decltype(std::__1::forward<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&>(fp)(std::__1::forward<Depsgraph*>(fp0))) std::__1::__invoke<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&, Depsgraph*>(blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&, Depsgraph*&&) at /usr/include/c++/v1/type_traits:3904
- 17  in void std::__1::__invoke_void_return_wrapper<void, true>::__call<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&, Depsgraph*>(blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&, Depsgraph*&&) at /usr/include/c++/v1/__functional_base:348
- 18  in std::__1::__function::__alloc_func<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0, std::__1::allocator<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0>, void (Depsgraph*)>::operator()(Depsgraph*&&) at /usr/include/c++/v1/functional:1561
- 19  in std::__1::__function::__func<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0, std::__1::allocator<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0>, void (Depsgraph*)>::operator()(Depsgraph*&&) at /usr/include/c++/v1/functional:1735
- 20  in std::__1::__function::__value_func<void (Depsgraph*)>::operator()(Depsgraph*&&) const at /usr/include/c++/v1/functional:1888
- 21  in std::__1::function<void (Depsgraph*)>::operator()(Depsgraph*) const at /usr/include/c++/v1/functional:2563
- 22  in blender::deg::(anonymous namespace)::evaluate_node(blender::deg::(anonymous namespace)::DepsgraphEvalState const*, blender::deg::OperationNode*) at source/blender/depsgraph/intern/eval/deg_eval.cc:113
- 23  in blender::deg::(anonymous namespace)::deg_task_run_func(TaskPool*, void*) at source/blender/depsgraph/intern/eval/deg_eval.cc:124
- 24  in Task::operator()() const::'lambda'()::operator()() const at source/blender/blenlib/intern/task_pool.cc:118
- 25  in tbb::interface7::internal::delegated_function<Task::operator()() const::'lambda'() const, void>::operator()() const at darwin/tbb/include/tbb/task_arena.h:96
- 26  in tbb::interface7::internal::isolate_within_arena(tbb::interface7::internal::delegate_base&, long) ()
- 27  in void tbb::interface7::internal::isolate_impl<void, Task::operator()() const::'lambda'() const>(Task::operator()() const::'lambda'() const&) at darwin/tbb/include/tbb/task_arena.h:216
- 28  in tbb::interface7::internal::return_type_or_void<Task::operator()() const::'lambda'()>::type tbb::interface7::this_task_arena::isolate<Task::operator()() const::'lambda'()>(Task::operator()() const::'lambda'() const&) at darwin/tbb/include/tbb/task_arena.h:472
- 29  in Task::operator()() const at source/blender/blenlib/intern/task_pool.cc:118
- 30  in tbb::internal::function_task<Task>::execute() at darwin/tbb/include/tbb/task.h:1059
- 31  in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) ()
- 32  in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) ()
- 33  in tbb::internal::task_group_base::wait() ()
- 34  in tbb_task_pool_work_and_wait(TaskPool*) at source/blender/blenlib/intern/task_pool.cc:253
- 35  in ::BLI_task_pool_work_and_wait(TaskPool *) at source/blender/blenlib/intern/task_pool.cc:502
- 36  in blender::deg::deg_evaluate_on_refresh(blender::deg::Depsgraph*) at source/blender/depsgraph/intern/eval/deg_eval.cc:397
- 37  in deg_flush_updates_and_refresh(blender::deg::Depsgraph*) at source/blender/depsgraph/intern/depsgraph_eval.cc:58
- 38  in ::DEG_evaluate_on_framechange(Depsgraph *, float) at source/blender/depsgraph/intern/depsgraph_eval.cc:82
- 39  in BKE_scene_graph_update_for_newframe_ex at source/blender/blenkernel/intern/scene.c:2738
- 40  in BKE_scene_graph_update_for_newframe at source/blender/blenkernel/intern/scene.c:2786
- 41  in ED_update_for_newframe at source/blender/editors/screen/screen_edit.c:1764
- 42  in wm_event_do_notifiers at source/blender/windowmanager/intern/wm_event_system.c:535
- 43  in WM_main at source/blender/windowmanager/intern/wm.c:650
- 44  in main at source/creator/creator.c:519
- 45  in start ()
#46  in start ()

It's stuck at

```lines=15 - 0 in __psynch_cvwait () - 1 in _pthread_cond_wait () - 2 in PyCOND_TIMEDWAIT [inlined] at /python/src/external_python/Python/condvar.h:73 - 3 in take_gil at /python/src/external_python/Python/ceval_gil.h:247 - 4 in PyEval_RestoreThread at /python/src/external_python/Python/ceval.c:467 - 5 in PyGILState_Ensure at /python/src/external_python/Python/pystate.c:1378 - 6 in BPY_DECREF at source/blender/python/intern/bpy_interface.c:617 - 7 in fcurve_free_driver at source/blender/blenkernel/intern/fcurve_driver.c:930 - 8 in BKE_fcurve_free at source/blender/blenkernel/intern/fcurve.c:95 - 9 in BKE_fcurves_free at source/blender/blenkernel/intern/fcurve.c:118 - 10 in BKE_animdata_free at source/blender/blenkernel/intern/anim_data.c:256 - 11 in BKE_libblock_free_data at source/blender/blenkernel/intern/lib_id_delete.c:72 - 12 in blender::deg::deg_free_copy_on_write_datablock(ID*) at source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:1080 - 13 in blender::deg::deg_update_copy_on_write_datablock(blender::deg::Depsgraph const*, blender::deg::IDNode const*) at source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:958 - 14 in blender::deg::deg_evaluate_copy_on_write(Depsgraph*, blender::deg::IDNode const*) at source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:1094 - 15 in blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0::operator()(Depsgraph*) const at source/blender/depsgraph/intern/builder/deg_builder_nodes.cc:181 - 16 in decltype(std::__1::forward<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&>(fp)(std::__1::forward<Depsgraph*>(fp0))) std::__1::__invoke<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&, Depsgraph*>(blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&, Depsgraph*&&) at /usr/include/c++/v1/type_traits:3904 - 17 in void std::__1::__invoke_void_return_wrapper<void, true>::__call<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&, Depsgraph*>(blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0&, Depsgraph*&&) at /usr/include/c++/v1/__functional_base:348 - 18 in std::__1::__function::__alloc_func<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0, std::__1::allocator<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0>, void (Depsgraph*)>::operator()(Depsgraph*&&) at /usr/include/c++/v1/functional:1561 - 19 in std::__1::__function::__func<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0, std::__1::allocator<blender::deg::DepsgraphNodeBuilder::add_id_node(ID*)::$_0>, void (Depsgraph*)>::operator()(Depsgraph*&&) at /usr/include/c++/v1/functional:1735 - 20 in std::__1::__function::__value_func<void (Depsgraph*)>::operator()(Depsgraph*&&) const at /usr/include/c++/v1/functional:1888 - 21 in std::__1::function<void (Depsgraph*)>::operator()(Depsgraph*) const at /usr/include/c++/v1/functional:2563 - 22 in blender::deg::(anonymous namespace)::evaluate_node(blender::deg::(anonymous namespace)::DepsgraphEvalState const*, blender::deg::OperationNode*) at source/blender/depsgraph/intern/eval/deg_eval.cc:113 - 23 in blender::deg::(anonymous namespace)::deg_task_run_func(TaskPool*, void*) at source/blender/depsgraph/intern/eval/deg_eval.cc:124 - 24 in Task::operator()() const::'lambda'()::operator()() const at source/blender/blenlib/intern/task_pool.cc:118 - 25 in tbb::interface7::internal::delegated_function<Task::operator()() const::'lambda'() const, void>::operator()() const at darwin/tbb/include/tbb/task_arena.h:96 - 26 in tbb::interface7::internal::isolate_within_arena(tbb::interface7::internal::delegate_base&, long) () - 27 in void tbb::interface7::internal::isolate_impl<void, Task::operator()() const::'lambda'() const>(Task::operator()() const::'lambda'() const&) at darwin/tbb/include/tbb/task_arena.h:216 - 28 in tbb::interface7::internal::return_type_or_void<Task::operator()() const::'lambda'()>::type tbb::interface7::this_task_arena::isolate<Task::operator()() const::'lambda'()>(Task::operator()() const::'lambda'() const&) at darwin/tbb/include/tbb/task_arena.h:472 - 29 in Task::operator()() const at source/blender/blenlib/intern/task_pool.cc:118 - 30 in tbb::internal::function_task<Task>::execute() at darwin/tbb/include/tbb/task.h:1059 - 31 in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) () - 32 in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) () - 33 in tbb::internal::task_group_base::wait() () - 34 in tbb_task_pool_work_and_wait(TaskPool*) at source/blender/blenlib/intern/task_pool.cc:253 - 35 in ::BLI_task_pool_work_and_wait(TaskPool *) at source/blender/blenlib/intern/task_pool.cc:502 - 36 in blender::deg::deg_evaluate_on_refresh(blender::deg::Depsgraph*) at source/blender/depsgraph/intern/eval/deg_eval.cc:397 - 37 in deg_flush_updates_and_refresh(blender::deg::Depsgraph*) at source/blender/depsgraph/intern/depsgraph_eval.cc:58 - 38 in ::DEG_evaluate_on_framechange(Depsgraph *, float) at source/blender/depsgraph/intern/depsgraph_eval.cc:82 - 39 in BKE_scene_graph_update_for_newframe_ex at source/blender/blenkernel/intern/scene.c:2738 - 40 in BKE_scene_graph_update_for_newframe at source/blender/blenkernel/intern/scene.c:2786 - 41 in ED_update_for_newframe at source/blender/editors/screen/screen_edit.c:1764 - 42 in wm_event_do_notifiers at source/blender/windowmanager/intern/wm_event_system.c:535 - 43 in WM_main at source/blender/windowmanager/intern/wm.c:650 - 44 in main at source/creator/creator.c:519 - 45 in start () #46 in start () ``` It's stuck at
Philipp Oeser removed the
Interest
Python API
label 2023-02-10 09:04:40 +01:00
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
2 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#85641
No description provided.