Cast float->int leads to segmentation fault in compile-time
Submitted by pav..@..il.com
Assigned to ruiling
Description
Ok, I spent a lot of time to isolate the problem as much as possible. All components (loop, condition, casting and modification of i
) are required to reproduce the bug.
Steps to Reproduce:
-
Write kernel: kernel void evaluate(void) { float *stack[10]; int i = 1;
while (i) if ((int)(*stack[i])) --i; }
-
Try to build the program
Actual Results:
A segmentation fault occurs when trying to build program (clBuildProgram(program, 0, NULL, NULL, NULL, NULL)
)
Expected Results: The program should be successfully compiled. Or, at least, should not sigfault.
Additional Information:
dmesg
after couple runs:
[72307.125321] ocl-bf[9586]: segfault at 7ff300000018 ip 00007ff3d25fac10 sp 00007fff77f05dd8 error 4 in libgbe.so[7ff3d21f0000+1a3c000]
[72308.493759] ocl-bf[9601]: segfault at 0 ip 00007f7ea7850b14 sp 00007ffdb72e4fc0 error 4 in libgbe.so[7f7ea7442000+1a3c000]
[72326.034834] ocl-bf[9635]: segfault at 7ffc101d2ff8 ip 00007fa682413ac4 sp 00007ffc101d3000 error 6 in libgbe.so[7fa682005000+1a3c000]
OS: Arch linux, 4.2.5-1, x86_64 Device: Intel HD 4400/Haswell i5 Beignet: 1.1.1-4 (AUR: https://aur.archlinux.org/packages/beignet/)