Metaball particle sources jumping around #71163

Closed
opened 2019-10-28 17:13:30 +01:00 by Lime_Flavored_Dragon · 8 comments

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.86

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: f6cb5f5449
I tried reproducing the bug the 2.81 beta and 2.82 alpha builds on Oct 28, 2019. The bug was observed there as well.
Worked: N/A (I only recently started working with metaballs)

Short description of error
When running a particle simulation with multiple metaball object particles, the original objects appear to jump around and scale based on the particle scaling settings. However, when transforming the originals, the file seems to use the correct position for the transformation. Sometimes, but not always, Blender will crash. The exact behavior is extremely inconsistent. I have attached a video demonstrating one possible result of the bug. The video has force fields but they are not necessary to reproduce the bug. I have removed them in the .blend file.

Exact steps for others to reproduce the error
In the attached .blend file, I have two objects with particle systems using metaballs. Simply scrub through the animation frames and the source objects will jump around.

glitchyfire.blend
glitchyfire.mp4

**System Information** Operating system: Windows-10-10.0.18362 64 Bits Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.86 **Blender Version** Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: f6cb5f5449 I tried reproducing the bug the 2.81 beta and 2.82 alpha builds on Oct 28, 2019. The bug was observed there as well. Worked: N/A (I only recently started working with metaballs) **Short description of error** When running a particle simulation with multiple metaball object particles, the original objects appear to jump around and scale based on the particle scaling settings. However, when transforming the originals, the file seems to use the correct position for the transformation. Sometimes, but not always, Blender will crash. The exact behavior is extremely inconsistent. I have attached a video demonstrating one possible result of the bug. The video has force fields but they are not necessary to reproduce the bug. I have removed them in the .blend file. **Exact steps for others to reproduce the error** In the attached .blend file, I have two objects with particle systems using metaballs. Simply scrub through the animation frames and the source objects will jump around. [glitchyfire.blend](https://archive.blender.org/developer/F7865835/glitchyfire.blend) [glitchyfire.mp4](https://archive.blender.org/developer/F7865833/glitchyfire.mp4)

Added subscriber: @Lime_Flavored_Dragon

Added subscriber: @Lime_Flavored_Dragon

Added subscriber: @grosgood

Added subscriber: @grosgood

Sometimes, but not always, Blender will crash

Similar to #69578 in many ways. Not convinced yet, but interested to see if I can produce trace backs for both bug reports.

>Sometimes, but not always, Blender will crash Similar to #69578 in many ways. Not convinced yet, but interested to see if I can produce trace backs for both bug reports.

Here, I consistently find that AddressSanitizer reports a use of heap memory after it has been freed. Specifically, one thread uses a region of heap that another thread has freed. Details in address_sanitizer_T71163.txt
address_sanitizer_T71163.txt
The failure point is consistently at particle.c:1282 within psys_interpolate_face()

1278 v1 = mvert[mface->v1].co;
1279 v2 = mvert[mface->v2].co;
1280 v3 = mvert[mface->v3].co;
1281
1282--> normal_short_to_float_v3(n1, mvert[mface->v1].no);
1283 normal_short_to_float_v3(n2, mvert[mface->v2].no);
1284 normal_short_to_float_v3(n3, mvert[mface->v3].no);


To arrive at this point, I modify @Lime_Flavored_Dragon procedure just a little bit. Instead of scrubbing through the time line, I just run the animation in the viewport. AddressSanitizer never reports this heap-use-after-free issue until the cache has been fully built and the animation is running off of cached data. The time of failure is variable, suggesting a race condition where the Good Guys (almost) always win. When they lose, it is always at this point.

OK - Maybe related to #69578 in that multiple simultaneous metaball-based particle systems have heap issues. There is smoke here, but haven't confirmed the location of the fire (the broad issue of thread race is not specific enough). Nor am I assured that it is the same fire as in #69578.

Here, I consistently find that AddressSanitizer reports a use of heap memory after it has been freed. Specifically, one thread uses a region of heap that another thread has freed. Details in **address_sanitizer_T71163.txt** [address_sanitizer_T71163.txt](https://archive.blender.org/developer/F7869138/address_sanitizer_T71163.txt) The failure point is consistently at [particle.c:1282](https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/particle.c$1282) within psys_interpolate_face() 1278 v1 = mvert[mface->v1].co; 1279 v2 = mvert[mface->v2].co; 1280 v3 = mvert[mface->v3].co; 1281 1282--> normal_short_to_float_v3(n1, mvert[mface->v1].no); 1283 normal_short_to_float_v3(n2, mvert[mface->v2].no); 1284 normal_short_to_float_v3(n3, mvert[mface->v3].no); ``` ``` To arrive at this point, I modify @Lime_Flavored_Dragon procedure just a little bit. Instead of scrubbing through the time line, I just run the animation in the viewport. AddressSanitizer never reports this heap-use-after-free issue until the cache has been fully built and the animation is running off of cached data. The time of failure is variable, suggesting a race condition where the Good Guys (almost) always win. When they lose, it is always at this point. OK - Maybe related to #69578 in that multiple simultaneous metaball-based particle systems have heap issues. There is smoke here, but haven't confirmed the location of the fire (the broad issue of thread race is not specific enough). Nor am I assured that it is the same fire as in #69578.

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Sergey Sharybin was assigned by Germano Cavalcante 2019-10-30 14:47:46 +01:00

This involves depsgraph (which works multithreaded).
Within BKE_mball_polygonize we have the init_meta which peforms a loop with the BKE_scene_base_iter_next function.
The problem is that BKE_scene_base_iter_next "temporarily" copies the matrix of the dupli object and this does not work well with multithreading.

This involves depsgraph (which works multithreaded). Within `BKE_mball_polygonize` we have the `init_meta` which peforms a loop with the `BKE_scene_base_iter_next` function. The problem is that `BKE_scene_base_iter_next` "temporarily" copies the matrix of the dupli object and this does not work well with multithreading.

For until #62311 is addressed such configuration can not work reliable.

For until #62311 is addressed such configuration can not work reliable.

Closed as duplicate of #62311

Closed as duplicate of #62311
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
4 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#71163
No description provided.