Page MenuHome

Trying to create hair with particles makes Blender crash
Closed, ResolvedPublic

Description

System Information
Operating system and graphics card

OSX 10.11/Windows 10, iMac w/ Nvidia GTX 680MX 2gb and PC w/ 4x Nvidia GTX970 4gb

Blender Version
Broken: 2.75a official (c27589e) and 2.76 rc3 (fb78f6d) from BF
Worked: none, as far as I tested

Short description of error

On a scene used for production projects, I tried to create a punk hair style on a head. I created a subdivided plan (3x3), added a shrinwrap modifier to make it follow the head shape and added hair particles (6 particles w/ 50 children). Then I duplicated the plan to create the hair (around 10 plans in total). Then on one plan, I wanted to use the Random parameter from the Particles>Velocity menu and Blender crashes

I tested it 4 times and it crashed on each. 2 times with the 2.76 rc3 and 2 times with the 2.75a. Now, the blend file won't open on each version (Mac or PC). I saved it just before trying the crash tough.

I can provide the blend file, if you can open it (zip file is around 200mb). And because I can't open the file again, I cannot provide a lighter file or even make some cleaning to isolate the bug. Also it contains meshes and rigs I don't want to share it to anyone.

I tried to reproduce the bug on a lighter scene, but this time the Random parameter worked well.

Exact steps for others to reproduce the error
The same as explained above.

Event Timeline

Kagi (kagi) raised the priority of this task from to 90.
Kagi (kagi) updated the task description. (Show Details)
Kagi (kagi) added a project: BF Blender.
Kagi (kagi) edited a custom field.
Kagi (kagi) added a subscriber: Kagi (kagi).

Ok, finally I can provide a blend file for testing. Appending worked fine with the head mesh and one plan.

So here it is: http://ovh.to/ZLrs78b

All you have to do is to select one of the plan with hair, and try to change the Random setting from Particle>Velocity. It crashes on my side.

ubuntu 14.04 64 bits hash 90b925f
I managed to isolate a problem.

When hair particle settings are linked to 2 different objects and Clump Curve is enabled for children; changing a setting by a mouse sliding will crash blender.

In this file, you can change particles amount or hair length by clicking, by directly entering a value. But blender crashes if you try to click and slide value.

Problem seems absent from buildbot linux build or linux 2.76rc3

Yes it works better that way on Win10, but not on OSX 10.11. Even entering manually the values make Blender crash on OSX. Mouse sliding make Blender crash on both OS.

And yes, on my scene, if each plan w/ hair has its own particles setting, all works fine.

Campbell Barton (campbellbarton) lowered the priority of this task from 90 to 50.Oct 6 2015, 11:32 AM

Confirmed, this is an issue with threading, if you start blender with the command line argument blender -t 1 the crash doesn't occur.

All the threads are initializing the same curve table, heres a stack trace:

1freed by thread T4 here:
2 #0 0x7f653688450a in __interceptor_free ../../../../gcc/libsanitizer/asan/asan_malloc_linux.cc:28
3 #1 0x429fb92 in MEM_lockfree_freeN /src/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:169
4 #2 0x2cea218 in curvemap_make_table /src/blender/source/blender/blenkernel/intern/colortools.c:571
5 #3 0x2cef3cf in curvemapping_changed /src/blender/source/blender/blenkernel/intern/colortools.c:765
6 #4 0x2cef597 in curvemapping_changed_all /src/blender/source/blender/blenkernel/intern/colortools.c:775
7 #5 0x31d5e76 in psys_thread_context_init_path /src/blender/source/blender/blenkernel/intern/particle.c:2056
8 #6 0x31db9a3 in psys_cache_child_paths /src/blender/source/blender/blenkernel/intern/particle.c:2357
9 #7 0x323befc in psys_update_path_cache /src/blender/source/blender/blenkernel/intern/particle_system.c:2955
10 #8 0x3240f6a in hair_step /src/blender/source/blender/blenkernel/intern/particle_system.c:3223
11 #9 0x324edac in particle_system_update /src/blender/source/blender/blenkernel/intern/particle_system.c:4131
12 #10 0x2391bac in deformVerts /src/blender/source/blender/modifiers/intern/MOD_particlesystem.c:163
13 #11 0x30c9eb4 in modwrap_deformVerts /src/blender/source/blender/blenkernel/intern/modifier.c:775
14 #12 0x2bc314c in mesh_calc_modifiers /src/blender/source/blender/blenkernel/intern/DerivedMesh.c:1816
15 #13 0x2bca74d in mesh_build_data /src/blender/source/blender/blenkernel/intern/DerivedMesh.c:2577
16 #14 0x2bcb721 in makeDerivedMesh /src/blender/source/blender/blenkernel/intern/DerivedMesh.c:2674
17 #15 0x31993fa in BKE_object_handle_data_update /src/blender/source/blender/blenkernel/intern/object_update.c:201
18 #16 0x3172fbc in BKE_object_handle_update_ex /src/blender/source/blender/blenkernel/intern/object.c:3135
19 #17 0x32e1df1 in scene_update_object_func /src/blender/source/blender/blenkernel/intern/scene.c:1456
20 #18 0x40fc234 in task_scheduler_thread_run /src/blender/source/blender/blenlib/intern/task.c:161
21 #19 0x7f653474e4a3 in start_thread (/usr/lib/libpthread.so.0+0x74a3)