Page MenuHome

crashes when putting particles Along a Curve Without Curve Guide
Closed, ResolvedPublic

Description

System Information
Operating system: windows 10
Graphics card: NVIDIA GeForce GTX 1050 Ti and also happens on Intel (R) UHD Graphics 630

Blender Version
Broken: 2.80 beta, 91a155833e59, blender2.8, 2019-01-07

Short description of error
Blender crashes when putting particles Along a Curve Without Curve Guide, using the EEVEE viewport as in this tutorial linked below.
There's relatively few particles so woudn't normally happen.

Crashes when animated on the timeline 1st, 2nd or 3rd time after less 60 seconds.

Exact steps for others to reproduce the error

Follow these steps as detailed in tutorial from youtube (also see attached file)
https://youtu.be/PYHOV3bVIG0?t=94

  1. Create a plane with particles say 500 particles.
  2. Put a force on a curve
  3. Force to be “force”
  4. In the force field panel: select Shape/curve

Event Timeline

Philipp Oeser (lichtwerk) triaged this task as Confirmed, Medium priority.

Confirmed, checking...

--threads 1 seems to solve, so looks like race condition (will also check with ASAN)

crashes here
BVHNode *root = tree->nodes[tree->totleaf];
(where tree is NULL)

1   BLI_bvhtree_find_nearest_ex                                                                            BLI_kdopbvh.c        1388 0x2ec4ea3 
2   BLI_bvhtree_find_nearest                                                                               BLI_kdopbvh.c        1431 0x2ec5066 
3   closest_point_on_surface                                                                               effect.c             571  0x2a8498c 
4   get_effector_data                                                                                      effect.c             611  0x2a84c36 
5   BKE_effectors_apply                                                                                    effect.c             1050 0x2a865e0 
6   basic_force_cb                                                                                         particle_system.c    2072 0x2b85cc6 
7   integrate_particle                                                                                     particle_system.c    1363 0x2b83361 
8   basic_integrate                                                                                        particle_system.c    2119 0x2b86068 
9   dynamics_step                                                                                          particle_system.c    3641 0x2b8b520 
10  system_step                                                                                            particle_system.c    4082 0x2b8cb6c 
11  particle_system_update                                                                                 particle_system.c    4376 0x2b8de31 
12  deformVerts                                                                                            MOD_particlesystem.c 205  0x2546166 
13  modwrap_deformVerts                                                                                    modifier.c           852  0x2b259f1 
14  mesh_calc_modifiers                                                                                    DerivedMesh.c        1247 0x29cacb3 
15  mesh_build_data                                                                                        DerivedMesh.c        2044 0x29cd865 
16  makeDerivedMesh                                                                                        DerivedMesh.c        2156 0x29cdbeb 
17  BKE_object_handle_data_update                                                                          object_update.c      207  0x2b61b02

note: to get it to crash easier, lower the number of particles to 100 in the file provided with this report.

This might be utter nonsense (or just a coincidence), but when adding a depsgraph relation to the geometry, it seems to save the corresponding BVHTree from being freed:

1
2
3diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
4index c8822df28e6..8014307a9f9 100644
5--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
6+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
7@@ -401,6 +401,14 @@ void DepsgraphRelationBuilder::add_forcefield_relations(
8 DEG_NODE_TYPE_GEOMETRY);
9 add_relation(eff_key, key, "Smoke Force Domain");
10 }
11+
12+ /* add a geometry relation to keep bvhtree alive?! see T60742*/
13+ if (relation->pd->forcefield == PFIELD_FORCE) {
14+ ComponentKey eff_key(&relation->ob->id,
15+ DEG_NODE_TYPE_GEOMETRY);
16+ add_relation(eff_key, key, "Force Field");
17+ }
18+
19 if (add_absorption && (relation->pd->flag & PFIELD_VISIBILITY)) {
20 add_collision_relations(key,
21 object,

@Sergey Sharybin (sergey): mind checking on this?