[Bf-blender-cvs] [3b4cc5dfed0] master: Cycles: Workaround cubic volume filtering crashing on Linux

Sergey Sharybin noreply at git.blender.org
Mon Apr 10 14:44:25 CEST 2017


Commit: 3b4cc5dfed03d5e1d79c756349f25b6c63103991
Author: Sergey Sharybin
Date:   Mon Apr 10 14:42:17 2017 +0200
Branches: master
https://developer.blender.org/rB3b4cc5dfed03d5e1d79c756349f25b6c63103991

Cycles: Workaround cubic volume filtering crashing on Linux

The issue was caused by recent change in inline policy.

There is some sort of memory corruption happening here, ASAN suggests
it's stack overflow issue. Not quite sure why it is happening tho and
was not able to solve anything here yet in the past hours.

Committing fix which works with a big TODO note.

The issue is visible on AVX2 machine when rendering cycles_reports_test.

===================================================================

M	intern/cycles/kernel/kernel_compat_cpu.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h
index 459f1a28f63..21da180bb8e 100644
--- a/intern/cycles/kernel/kernel_compat_cpu.h
+++ b/intern/cycles/kernel/kernel_compat_cpu.h
@@ -404,7 +404,18 @@ template<typename T> struct texture_image  {
 		return r;
 	}
 
-	ccl_never_inline float4 interp_3d_ex_tricubic(float x, float y, float z)
+	/* TODO(sergey): For some unspeakable reason both GCC-6 and Clang-3.9 are
+	 * causing stack overflow issue in this function unless it is inlined.
+	 *
+	 * Only happens for AVX2 kernel and global __KERNEL_SSE__ vectorization
+	 * enabled.
+	 */
+#ifdef __GNUC__
+	ccl_always_inline
+#else
+	ccl_never_inline
+#endif
+	float4 interp_3d_ex_tricubic(float x, float y, float z)
 	{
 		int ix, iy, iz;
 		int nix, niy, niz;




More information about the Bf-blender-cvs mailing list