From 125e9ec86389f9e1da396190fcb79414e1e7afc8 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Mon, 9 Mar 2020 11:13:43 +0100 Subject: [PATCH] Do not redirect stderr to /dev/null to prevent rocm 3.1 from crashing on debian --- src/backend.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/backend.c b/src/backend.c index de6ce9c5d..7e7caee89 100644 --- a/src/backend.c +++ b/src/backend.c @@ -369,32 +369,7 @@ static bool opencl_test_instruction (hashcat_ctx_t *hashcat_ctx, cl_context cont OCL_PTR *ocl = (OCL_PTR *) backend_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 = fcntl(2, F_DUPFD_CLOEXEC); - int tmp = open ("/dev/null", O_WRONLY | O_CLOEXEC); - dup2 (tmp, 2); - close (tmp); - #endif - #endif - - int CL_rc = ocl->clBuildProgram (program, 1, &device, "-Werror", NULL, NULL); // do not use the wrapper to avoid the error message - - #ifndef DEBUG - #ifndef _WIN - fflush (stderr); - #ifndef __APPLE__ - dup3 (bak, 2, O_CLOEXEC); - #else - dup2 (bak, 2); - #endif - close (bak); - #endif - #endif + const int CL_rc = ocl->clBuildProgram (program, 1, &device, NULL, NULL, NULL); if (CL_rc != CL_SUCCESS) {