Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saturating arithmetic errors in x86_64(due to avx2?) #2

Closed
kraiskil opened this issue Aug 23, 2013 · 10 comments
Closed

saturating arithmetic errors in x86_64(due to avx2?) #2

kraiskil opened this issue Aug 23, 2013 · 10 comments
Labels

Comments

@kraiskil
Copy link
Member

Tests 5 and 11 fail unexpectedly on one x86_64 Ubuntu 12.04 installation. The only difference to several working similar installations that I can think of is that this machine is a haswell, i.e. has avx2 instructions.
Tested with LLVM 3.3 only.
Marked as XFAIL in 2150cd1.

@pjaaskel
Copy link
Member

Can you try what I did when debugging https://bugs.launchpad.net/pocl/+bug/1179211
i.e. switch off the avx2 and see if it still breaks? Then it's easier to isolate and report a bug to LLVM.

@pjaaskel
Copy link
Member

pjaaskel commented Nov 7, 2013

Did you report this to LLVM? Perhaps testing with LLVM 3.4 should be done first to see if they have fixed it already.

@kraiskil
Copy link
Member Author

kraiskil commented Nov 7, 2013

I didn't take time to isolate this yet. I should, before 3.4 is frozen... And no, it is not fixed yet, as of last week at least.

@kraiskil
Copy link
Member Author

Just to save the intermediate result: seems the issue is with the select() function in (e.g.)

short16 convert_short16_sat(float16 x) {
short16 y = convert_short16(x);
y = select(y, (short16)SHRT_MIN, convert_short16(x < (float16)SHRT_MIN));
y = select(y, (short16)SHRT_MAX, convert_short16(x > (float16)SHRT_MAX));
return y; }

for an input of splatted -2.0f, the value of y in this function is:
y.x = fffffffe
y.x = ffff8000
y.x = 7fff
The first one is correct.

After the first line, y is correct, after the second, it is wrong.

@kraiskil
Copy link
Member Author

Isolated the issue further: https://gist.github.com/kraiskil/7431748
running the shell script:
£./run.sh core-avx-i
res1.x=a, res2.x=a
£./run.sh core-avx2
res1.x=b, res2.x=b

If the comparison in myselect is <= instead of < both targets return the same (correct) value.

@pjaaskel
Copy link
Member

OK, time for an LLVM bug report? Might get fixed before LLVM 3.4.

@kraiskil
Copy link
Member Author

kraiskil pushed a commit that referenced this issue Dec 16, 2013
@kraiskil
Copy link
Member Author

Strangely, the fix in 9e5b831 for issue #39 seems to fix both issues. Removed XFAILs in commit above.
Also, the OpenCL-C code above has implementation defined behaviour (issue #34), but the LLVM bug report seems still valid, though. I guess the reduction sidetracked and found a new bug?
Leaving this issue open until the LLVM bug is resolved.

@pjaaskel
Copy link
Member

Is this resolved?

@pjaaskel
Copy link
Member

Assuming fixed.

anbe42 added a commit to anbe42/pocl that referenced this issue Dec 1, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Dec 1, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Dec 1, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Dec 1, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Dec 1, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Dec 7, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Dec 16, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Dec 17, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Dec 17, 2021
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
anbe42 added a commit to anbe42/pocl that referenced this issue Jan 6, 2022
The segmentation fault can be observed with llvm-10, llvm-11 and llvm-12
and seems to be fixed in llvm-13. It happens on the architectures armhf
and armel (both 32-bit) always and on x86_64 sporadically.
The test segfaults only on the first run (i.e. the kernel is not yet in
pocl's kernel cache) while it passes on subsequent execution (with
something already in the kernel cache), emitting only some llvm
diagnostics:

inlinable function call in a function with debug info must have a !dbg location
  %11 = call i32 @_Z12get_local_idj(i32 0)
inlinable function call in a function with debug info must have a !dbg location
  %19 = call i32 @_Z12get_local_idj(i32 1)
inlinable function call in a function with debug info must have a !dbg location
  %27 = call i32 @_Z12get_local_idj(i32 2)

The backtrace of the segmentation fault as observed with llvm-10 and pocl 1.6:
 #0  getEmissionKind () at .../llvm/include/llvm/IR/DebugInfoMetadata.h:1244
 pocl#1  initialize () at .../llvm/lib/CodeGen/LexicalScopes.cpp:53
 pocl#2  0xb14102f0 in computeIntervals () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:979
 pocl#3  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:996
 pocl#4  runOnMachineFunction () at .../llvm/lib/CodeGen/LiveDebugVariables.cpp:1023
 pocl#5  0xb14856c8 in runOnFunction () at .../llvm/lib/CodeGen/MachineFunctionPass.cpp:73
 pocl#6  0xb12ff494 in runOnFunction () at .../llvm/lib/IR/LegacyPassManager.cpp:1481
 pocl#7  0xb12ff750 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1517
 pocl#8  0xb12ffba8 in runOnModule () at .../llvm/lib/IR/LegacyPassManager.cpp:1582
 pocl#9  run () at .../llvm/lib/IR/LegacyPassManager.cpp:1694
 pocl#10 0xb6e64c82 in pocl_llvm_codegen (Device=Device@entry=0xdb0010, Modp=0x1361838, Output=Output@entry=0xbefde86c, OutputSize=OutputSize@entry=0xbefde880) at ./lib/CL/pocl_llvm_wg.cc:624
 pocl#11 0xb6e291de in llvm_codegen (output=output@entry=0xdeb898 "...BMDHA/Sdot_kernel/0-0-0/Sdot_kernel.so", device_i=device_i@entry=0, kernel=kernel@entry=0xbefe0240,
     device=0xdb0010, command=command@entry=0xbefe0278, specialize=specialize@entry=0) at ./lib/CL/devices/common.c:158
 pocl#12 0xb6e2ae44 in pocl_check_kernel_disk_cache (command=command@entry=0xbefe0278, specialized=specialized@entry=0) at ./lib/CL/devices/common.c:958
 pocl#13 0xb6e2b262 in pocl_check_kernel_dlhandle_cache (command=0xbefe0278, initial_refcount=0, specialize=0) at ./lib/CL/devices/common.c:1081
 pocl#14 0xb6e033d4 in program_compile_dynamic_wg_binaries (program=program@entry=0xd8ab88) at ./lib/CL/pocl_build.c:179
 pocl#15 0xb6e13f20 in get_binary_sizes (sizes=0xbefe0384, program=0xd8ab88) at ./lib/CL/clGetProgramInfo.c:36
 pocl#16 POclGetProgramInfo (program=0xd8ab88, param_name=4453, param_value_size=128, param_value=0xbefe0384, param_value_size_ret=0xbefe0380) at ./lib/CL/clGetProgramInfo.c:115
 pocl#17 0x00473070 in main () at 975931.c:238

pocl#889
https://bugs.debian.org/975931
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants