Segfault printing depsgraph items #70481

Closed
opened 2019-10-03 16:39:00 +02:00 by Paul Melis · 11 comments

System Information
Operating system: Arch Linux
Graphics card: GTX Titan

Blender Version
Broken: 2.81.13 (a6ad80d9e8)

Short description of error

Segfault:

# Blender 2.81 (sub 13), Commit date: 2019-10-03 13:36, Hash a6ad80d9e852

# backtrace
/home/paulm/software/blender-debug-git/blender(BLI_system_backtrace+0x35) [0x56414497511c]
/home/paulm/software/blender-debug-git/blender(+0x27711c3) [0x5641445cc1c3]
/home/paulm/software/blender-debug-git/blender(+0x27713c2) [0x5641445cc3c2]
/usr/lib/libc.so.6(+0x3a7e0) [0x7f8196c037e0]
/usr/lib/libc.so.6(+0x15ec87) [0x7f8196d27c87]
/usr/lib/libpython3.7m.so.1.0(PyUnicode_FromString+0xa) [0x7f819f3b95da]
/home/paulm/software/blender-debug-git/blender(+0x2bd8dc7) [0x564144a33dc7]
/usr/lib/libpython3.7m.so.1.0(PyObject_Repr+0x506) [0x7f819f3e5796]
/usr/lib/libpython3.7m.so.1.0(+0x16a009) [0x7f819f41f009]
/usr/lib/libpython3.7m.so.1.0(PyObject_Str+0x70) [0x7f819f3e5bd0]
/usr/lib/libpython3.7m.so.1.0(PyFile_WriteObject+0x3f) [0x7f819f46ebff]
/usr/lib/libpython3.7m.so.1.0(+0x1d229e) [0x7f819f48729e]
/usr/lib/libpython3.7m.so.1.0(_PyMethodDef_RawFastCallKeywords+0xf8) [0x7f819f3bb478]
/usr/lib/libpython3.7m.so.1.0(_PyCFunction_FastCallKeywords+0x24) [0x7f819f3bb714]
/usr/lib/libpython3.7m.so.1.0(+0x1382ec) [0x7f819f3ed2ec]
/usr/lib/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xaa7) [0x7f819f422ed7]
/usr/lib/libpython3.7m.so.1.0(_PyEval_EvalCodeWithName+0x2f8) [0x7f819f3db768]
/usr/lib/libpython3.7m.so.1.0(PyEval_EvalCodeEx+0x3a) [0x7f819f3dc52a]
/usr/lib/libpython3.7m.so.1.0(PyEval_EvalCode+0x1c) [0x7f819f46c09c]
/usr/lib/libpython3.7m.so.1.0(+0x1fb815) [0x7f819f4b0815]
/usr/lib/libpython3.7m.so.1.0(PyRun_StringFlags+0x80) [0x7f819f4b08c0]
/home/paulm/software/blender-debug-git/blender(BPY_execute_string_ex+0x15f) [0x564144a31228]
/home/paulm/software/blender-debug-git/blender(+0x276f8e8) [0x5641445ca8e8]
/home/paulm/software/blender-debug-git/blender(BLI_argsParse+0xf1) [0x5641449022cb]
/home/paulm/software/blender-debug-git/blender(main_args_setup_post+0x2f) [0x5641445cc0fd]
/home/paulm/software/blender-debug-git/blender(main+0x431) [0x5641445c7896]
/usr/lib/libc.so.6(__libc_start_main+0xf3) [0x7f8196befee3]
/home/paulm/software/blender-debug-git/blender(_start+0x2e) [0x5641445c72ee]

Exact steps for others to reproduce the error

blender -b --python-expr 'import bpy; d=bpy.context.evaluated_depsgraph_get(); print(len(d.ids)); l=list(d.ids); print(l)'

Without the final print() all is well.

**System Information** Operating system: Arch Linux Graphics card: GTX Titan **Blender Version** Broken: 2.81.13 (a6ad80d9e852) **Short description of error** Segfault: ``` # Blender 2.81 (sub 13), Commit date: 2019-10-03 13:36, Hash a6ad80d9e852 # backtrace /home/paulm/software/blender-debug-git/blender(BLI_system_backtrace+0x35) [0x56414497511c] /home/paulm/software/blender-debug-git/blender(+0x27711c3) [0x5641445cc1c3] /home/paulm/software/blender-debug-git/blender(+0x27713c2) [0x5641445cc3c2] /usr/lib/libc.so.6(+0x3a7e0) [0x7f8196c037e0] /usr/lib/libc.so.6(+0x15ec87) [0x7f8196d27c87] /usr/lib/libpython3.7m.so.1.0(PyUnicode_FromString+0xa) [0x7f819f3b95da] /home/paulm/software/blender-debug-git/blender(+0x2bd8dc7) [0x564144a33dc7] /usr/lib/libpython3.7m.so.1.0(PyObject_Repr+0x506) [0x7f819f3e5796] /usr/lib/libpython3.7m.so.1.0(+0x16a009) [0x7f819f41f009] /usr/lib/libpython3.7m.so.1.0(PyObject_Str+0x70) [0x7f819f3e5bd0] /usr/lib/libpython3.7m.so.1.0(PyFile_WriteObject+0x3f) [0x7f819f46ebff] /usr/lib/libpython3.7m.so.1.0(+0x1d229e) [0x7f819f48729e] /usr/lib/libpython3.7m.so.1.0(_PyMethodDef_RawFastCallKeywords+0xf8) [0x7f819f3bb478] /usr/lib/libpython3.7m.so.1.0(_PyCFunction_FastCallKeywords+0x24) [0x7f819f3bb714] /usr/lib/libpython3.7m.so.1.0(+0x1382ec) [0x7f819f3ed2ec] /usr/lib/libpython3.7m.so.1.0(_PyEval_EvalFrameDefault+0xaa7) [0x7f819f422ed7] /usr/lib/libpython3.7m.so.1.0(_PyEval_EvalCodeWithName+0x2f8) [0x7f819f3db768] /usr/lib/libpython3.7m.so.1.0(PyEval_EvalCodeEx+0x3a) [0x7f819f3dc52a] /usr/lib/libpython3.7m.so.1.0(PyEval_EvalCode+0x1c) [0x7f819f46c09c] /usr/lib/libpython3.7m.so.1.0(+0x1fb815) [0x7f819f4b0815] /usr/lib/libpython3.7m.so.1.0(PyRun_StringFlags+0x80) [0x7f819f4b08c0] /home/paulm/software/blender-debug-git/blender(BPY_execute_string_ex+0x15f) [0x564144a31228] /home/paulm/software/blender-debug-git/blender(+0x276f8e8) [0x5641445ca8e8] /home/paulm/software/blender-debug-git/blender(BLI_argsParse+0xf1) [0x5641449022cb] /home/paulm/software/blender-debug-git/blender(main_args_setup_post+0x2f) [0x5641445cc0fd] /home/paulm/software/blender-debug-git/blender(main+0x431) [0x5641445c7896] /usr/lib/libc.so.6(__libc_start_main+0xf3) [0x7f8196befee3] /home/paulm/software/blender-debug-git/blender(_start+0x2e) [0x5641445c72ee] ``` **Exact steps for others to reproduce the error** ``` blender -b --python-expr 'import bpy; d=bpy.context.evaluated_depsgraph_get(); print(len(d.ids)); l=list(d.ids); print(l)' ``` Without the final `print()` all is well.
Author

Added subscriber: @PaulMelis

Added subscriber: @PaulMelis
Author

Hmmm, https://docs.blender.org/api/blender2.8/bpy.types.Depsgraph.html#bpy.types.Depsgraph.object_instances shows a warning for depsgraph.object_instances to "only use this as an iterator, never as a sequence, and do not keep any references to its items", but that warning is missing for depsgraph.ids. I guess the same applies?

The segfault is still nasty, though.

Hmmm, https://docs.blender.org/api/blender2.8/bpy.types.Depsgraph.html#bpy.types.Depsgraph.object_instances shows a warning for `depsgraph.object_instances` to "only use this as an iterator, never as a sequence, and do not keep any references to its items", but that warning is missing for `depsgraph.ids`. I guess the same applies? The segfault is still nasty, though.

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2019-10-03 20:43:17 +02:00

Look like you found the answer by yourself reading the doc… Segfault is impossible to avoid here, not without a tremendous impact on performances.

Look like you found the answer by yourself reading the doc… Segfault is impossible to avoid here, not without a tremendous impact on performances.

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'

Hrmmmm… Read your comment too quickly actually.

Don’t think this should crash, object_instances is a specific case, the other iterators should point to some (very slightly) more permanent memory. So you should not store them for any 'long' time, but keeping them in a list should be possible, until the next DEG update is run.

Tried here on linux with a debug build with ASAN enabled, and got no crash nor any error reported, it works just fine.

Does that command also crash for you?

blender -t 1 -b --python-expr 'import bpy; d=bpy.context.evaluated_depsgraph_get(); print(len(d.ids)); l=list(d.ids); print(l)'
Hrmmmm… Read your comment too quickly actually. Don’t think this should crash, `object_instances` is a specific case, the other iterators should point to some (very slightly) more permanent memory. So you should not store them for any 'long' time, but keeping them in a list should be possible, until the next DEG update is run. Tried here on linux with a debug build with ASAN enabled, and got no crash nor any error reported, it works just fine. Does that command also crash for you? ``` blender -t 1 -b --python-expr 'import bpy; d=bpy.context.evaluated_depsgraph_get(); print(len(d.ids)); l=list(d.ids); print(l)'

Should go to bed… was trying with 2.80 release, not my debug build of master… xD

Should go to bed… was trying with 2.80 release, not my debug build of master… xD

Crash happen when trying to display the evaluated version of the master collection, the 9th item of the list. This works fine for me:

blender -b --python-expr 'import bpy; d=bpy.context.evaluated_depsgraph_get(); print(len(d.ids)); l=list(d.ids); print(l[:8], l[9:])'
Crash happen when trying to display the evaluated version of the master collection, the 9th item of the list. This works fine for me: ``` blender -b --python-expr 'import bpy; d=bpy.context.evaluated_depsgraph_get(); print(len(d.ids)); l=list(d.ids); print(l[:8], l[9:])'

This issue was referenced by 19b0f69009

This issue was referenced by 19b0f69009501df8b153d33ffcf6977019d53291

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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#70481
No description provided.