crash when viewport rendering point density texture #50094

Closed
opened 2016-11-22 22:45:25 +01:00 by Joel Meyer · 14 comments

System Information
Windows 10 x64, GTX 1070

Blender Version
Broken: 2.78a (e8299c8), also tested daily build bd8cbf5
Worked: (optional)

Short description of error
When using a point density texture node in a cycles material, blender crashes after changing the resolution value.

Exact steps for others to reproduce the error

  • Render engine: Cycles (GPU or CPU rendering)
  • any material (must be visible in the 3d viewport, i. e. not on a hidden layer), use nodes
  • add a texture->point density node (node editor or properties panel). It must affect the material (e. g. color input of default diffuse).
  • switch 3d viewport to rendered mode
  • change the "Resolution" value of the node. Blender crashes.

Bug seems to appear only when changing the value immediately after switching to rendered viewport and changing the "Resolution" value with click-and-drag (not clicking or typing in directly)

**System Information** Windows 10 x64, GTX 1070 **Blender Version** Broken: 2.78a (e8299c8), also tested daily build bd8cbf5 Worked: (optional) **Short description of error** When using a point density texture node in a cycles material, blender crashes after changing the resolution value. **Exact steps for others to reproduce the error** - Render engine: Cycles (GPU or CPU rendering) - any material (must be visible in the 3d viewport, i. e. not on a hidden layer), use nodes - add a texture->point density node (node editor or properties panel). It must affect the material (e. g. color input of default diffuse). - switch 3d viewport to rendered mode - change the "Resolution" value of the node. Blender crashes. Bug seems to appear only when changing the value immediately after switching to rendered viewport and changing the "Resolution" value with click-and-drag (not clicking or typing in directly)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @sirjofri

Added subscriber: @sirjofri

Added subscriber: @newbs

Added subscriber: @newbs

Joel Meyer, Can you upload a blend file please? Thank you.

Joel Meyer, Can you upload a blend file please? Thank you.
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

This one was easy to repro, point_density.blend

just switch to rendered view, and click the up or down button on the resolution a few times (doesn't happen all the time but after a few tries blender crashes) probably a race condition somewhere.

This one was easy to repro, [point_density.blend](https://archive.blender.org/developer/F406854/point_density.blend) just switch to rendered view, and click the up or down button on the resolution a few times (doesn't happen all the time but after a few tries blender crashes) probably a race condition somewhere.
Ray molenkamp self-assigned this 2016-11-28 03:49:27 +01:00
Member

Added subscriber: @Sergey

Added subscriber: @Sergey
Member

race condition, in between the time ImageManager allocates ram for the texture and the time it gets sampled the ui managed to get in a change to the resolution. causing things to overflow in point_density_sample_func. Not quite sure how to stop that from happening. @Sergey any hints/tips?

race condition, in between the time ImageManager allocates ram for the texture and the time it gets sampled the ui managed to get in a change to the resolution. causing things to overflow in point_density_sample_func. Not quite sure how to stop that from happening. @Sergey any hints/tips?

Not sure what would be best here, can in theory use similar technique as initial sync is doing: have a main thread locked while sampling point density (see WM_job_main_thread_lock_acquire). This is annoying tho, because it introduces interface locks which we hate and must avoid.

Probably better approach for until we've got proper data separation would be to re-set viewport render from RNA update callback for PD resolution. We had that for some properties already (can't find them atm tho). Nice point of research is ED_render_engine_area_exit() and see it's users and such.

Not sure what would be best here, can in theory use similar technique as initial sync is doing: have a main thread locked while sampling point density (see `WM_job_main_thread_lock_acquire`). This is annoying tho, because it introduces interface locks which we hate and must avoid. Probably better approach for until we've got proper data separation would be to re-set viewport render from RNA update callback for PD resolution. We had that for some properties already (can't find them atm tho). Nice point of research is `ED_render_engine_area_exit()` and see it's users and such.
Member

Ideally i'd like to extend builtin_image_float_pixels_cb and builtin_image_pixels_cb to include the buffer dimensions (passing a pointer to a buffer, without telling the callee what size it is, just seems bad faith to me, and inviting issues like these) however that in turn causes a change to rna_ShaderNodePointDensity_density_calc (to include the buffer dimensions there as well) but that might be a breaking api change, not sure if that's ok? (doesn't look like any python is calling it though, so it just be a c/c++ code change)

Ideally i'd like to extend builtin_image_float_pixels_cb and builtin_image_pixels_cb to include the buffer dimensions (passing a pointer to a buffer, without telling the callee what size it is, just seems bad faith to me, and inviting issues like these) however that in turn causes a change to rna_ShaderNodePointDensity_density_calc (to include the buffer dimensions there as well) but that might be a breaking api change, not sure if that's ok? (doesn't look like any python is calling it though, so it just be a c/c++ code change)

Not sure that will solve anything. You can still change PD settings while builtin_image_float_pixels_cb() is sampling the PD causing threading conflicts.

Not sure that will solve anything. You can still change PD settings while `builtin_image_float_pixels_cb()` is sampling the PD causing threading conflicts.
Member

It would, BlenderSession::builtin_image_info would query the PD settings once, to get the resolution, and beyond that the buffer dimensions would be passed down, so there's no need for rna_ShaderNodePointDensity_density_calc to query the PD Settings and get a potentially different answer.

It would, BlenderSession::builtin_image_info would query the PD settings once, to get the resolution, and beyond that the buffer dimensions would be passed down, so there's no need for rna_ShaderNodePointDensity_density_calc to query the PD Settings and get a potentially different answer.

This issue was referenced by 1ec5edcc96

This issue was referenced by 1ec5edcc9669f46b1f0fd29c765a326ea525e7f3

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
5 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#50094
No description provided.