Page MenuHome

Blender hangs when using masking, dilate-erode and soften node
Closed, ResolvedPublic


System Information
OSX 10.10.2, GTX970

Blender Version
Broken: 000dfc0
Worked: 2.74

Short description of error
This is a bit of a weird bug.
Blender hangs when combining the soften node and the dilate erode node together with masking. It only happens if soften and dilate are active, if one of them is muted blender works fine. I suspect the dilate/erode node is problematic in some way anyway, because if i set it to linear feathering, i get these issues in the console:
I guess the interesting line here is "BLI_assert failed: /Volumes/blender/source/blender/compositor/operations/COM_BlurBaseOperation.cpp:144, make_dist_fac_inverse(), at '0'"

Exact steps for others to reproduce the error
Open this file:

Press F12
Tweak the mask rapidly, maybe by moving its center point quickly in small steps around. At some point blender just hangs and has to be killed. No errors in the console, not even with --debug or even using lldp. It's superweird. And: i couldn't reproduce on linux.

Event Timeline

Sebastian Koenig (sebastian_k) raised the priority of this task from to Needs Triage by Developer.

I would try I build from build bot there were some threading issues that were fixed so it's worth a try

Meh, Indeed I can't reproduce issue on linux. I'm putting the file through valgrind but it's so sloooooow that I don't think it will be possible to find the issue easily.

Manged to redo the report, with address sanitizers thread checking, see: P228.

@Sergey Sharybin (sergey), you worked most here before heres a proposed fix P229 ...

Posting here incase theres good reason to resolve some other way.

Updated: managed to find another race condition, needs further investigation.

@Campbell Barton (campbellbarton), didn't see your comment before.. I've run into same report from hellgrind and your patch is correct. Please go ahead and commit it.

@Sebastian Koenig (sebastian_k), the assert failure you see is likely caused by the memory corruption. Did you manage to reproduce the hanging blender when running it from lldb? If so, having full threads backtrace will give some clues.

Checked this morning,

Found another race condition, 2 threads are using LOCK_DRAW_IMAGE at the same time (initImage and draw_image_main)

See stack trace: P230

note, when hanging there are 2 threads in BLI_lock_thread, one waiting on LOCK_VIEWER the other on LOCK_DRAW_IMAGE. however both threads lock LOCK_DRAW_IMAGE in their call-stack.

@Sergey Sharybin (sergey) I was able to reproduce with lldb, but that didn't seem to print anything. Are there any options or arguments I should run Blender with for threads backtrace?

@Sebastian Jansson (sebastian), you need to type in lldb after the crash: thread backtrace all.

@ sebastian: use "thread apply all bt"


Sergey Sharybin (sergey) lowered the priority of this task from Normal to Needs Information from User.Jun 9 2015, 8:34 PM
Sergey Sharybin (sergey) raised the priority of this task from Needs Information from User to Normal.Jun 9 2015, 9:06 PM

Sounds quite similar to what helgrind reports about locking order. Will check tomorrow.