1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-02-02 02:41:35 +00:00

Disable stderr temporary since OpenCL runtime JiT (LLVM) prints directly to stderr when it should not

This commit is contained in:
jsteube 2019-04-08 14:23:02 +02:00
parent 28437b0ab0
commit dbd8181c15

View File

@ -344,8 +344,29 @@ static bool test_instruction (hashcat_ctx_t *hashcat_ctx, cl_context context, cl
OCL_PTR *ocl = opencl_ctx->ocl;
// LLVM seems to write an error message (if there's an error) directly to stderr
// and not (as supposted to) into buffer for later request using clGetProgramBuildInfo()
#ifndef DEBUG
#ifndef _WIN
fflush (stderr);
int bak = dup (2);
int tmp = open ("/dev/null", O_WRONLY);
dup2 (tmp, 2);
close (tmp);
#endif
#endif
CL_rc = ocl->clBuildProgram (program, 1, &device, "-cl-std=CL1.2 -Werror", NULL, NULL); // do not use the wrapper to avoid the error message
#ifndef DEBUG
#ifndef _WIN
fflush (stderr);
dup2 (bak, 2);
close (bak);
#endif
#endif
if (CL_rc != CL_SUCCESS)
{
#if defined (DEBUG)