From 55dcd2f8fdbbf70c5457d75de9e9bbf97f866943 Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 23 Nov 2015 11:13:25 -0500 Subject: [PATCH] P4 to Git Change 1213734 by yaxunl@yaxunl_stg_win50 on 2015/11/23 11:02:59 SWDEV-82054 - [CQE OCL][QR][LNX] RQ Conformance "Integer_Ops" test is crashing on CPU; Faulty CL#1206023. In llvm32 by default llvm::DisablePrettyStackTrace is off, which causes a trap handler installed by default and interferes with the trap handler in runtime, causing unhandled SIGFPE exceptions when executing conformance/integer_ops on certain cpu. To fix this, put stack trace duping under an env var AMD_DUMP_STACK_TRACE and set llvm::DisablePrettyStackTrace=true by default. Here env var is used because there is still no elf binary at this stage to pass the compiler option to if_aclCompilerInit. Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/common/v0_8/if_acl.cpp#8 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#86 edit [ROCm/clr commit: ccc2b4ce7995abb26447bf9f42cbaef3242993db] --- .../rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/clr/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp b/projects/clr/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp index 9dd7d6e8ab..bbe5aae1e3 100644 --- a/projects/clr/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp +++ b/projects/clr/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp @@ -96,10 +96,11 @@ if_aclCompilerInit(aclCompiler *cl, aclBinary *bin, #endif )); } -#ifndef NDEBUG - llvm::EnablePrettyStackTrace(); - llvm::sys::PrintStackTraceOnErrorSignal(); -#endif + static const char *DumpStackTrace = getenv("AMD_DUMP_STACK_TRACE"); + if (DumpStackTrace) { + llvm::EnablePrettyStackTrace(); + llvm::sys::PrintStackTraceOnErrorSignal(); + } // Initialize targets first. llvm::InitializeAllTargets();