From 0ba77fe7618ab48ddb2c0990baad918bb7cd2824 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Mon, 26 Apr 2021 09:51:50 +0200 Subject: [PATCH] Kernel Development: Kernel cache is disabled automatically in casehashcat is compiled with DEBUG=1 See https://github.com/hashcat/hashcat/issues/2750 --- docs/changes.txt | 1 + src/backend.c | 5 +++++ src/shared.c | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index c0b409d44..e7cc027c3 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -78,6 +78,7 @@ - Hash-Mode 13200 (AxCrypt): Changed the name to AxCrypt 1 to avoid confusion - Hash-Mode 13300 (AxCrypt in-memory SHA1): Changed the name to AxCrypt 1 in-memory SHA1 - Kernel Crypto Library: Removed unnecessary utf16 conversion functions which would apply on HMAC data portion +- Kernel Development: Kernel cache is disabled automatically in case hashcat is compiled with DEBUG=1 - OpenCL Runtime: Switched default OpenCL device type on macOS from GPU to CPU. Use -D 2 to enable GPU devices - Unit tests: Added Python 3 support for all of the Python code in our test framework - Unit tests: Fixed the packaging of test (-p) feature diff --git a/src/backend.c b/src/backend.c index a5e33c236..444796f10 100644 --- a/src/backend.c +++ b/src/backend.c @@ -8568,6 +8568,11 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) cache_disable = module_ctx->module_jit_cache_disable (hashconfig, user_options, user_options_extra, hashes, device_param); } + #if defined (DEBUG) + // https://github.com/hashcat/hashcat/issues/2750 + cache_disable = true; + #endif + /** * shared kernel with no hashconfig dependencies */ diff --git a/src/shared.c b/src/shared.c index 0150ea917..7acde3aef 100644 --- a/src/shared.c +++ b/src/shared.c @@ -522,7 +522,7 @@ void setup_environment_variables (const folder_config_t *folder_config) putenv ((char *) "DISPLAY=:0"); } - /* + #if defined (DEBUG) if (getenv ("OCL_CODE_CACHE_ENABLE") == NULL) putenv ((char *) "OCL_CODE_CACHE_ENABLE=0"); @@ -531,7 +531,7 @@ void setup_environment_variables (const folder_config_t *folder_config) if (getenv ("POCL_KERNEL_CACHE") == NULL) putenv ((char *) "POCL_KERNEL_CACHE=0"); - */ + #endif if (getenv ("TMPDIR") == NULL) { @@ -544,8 +544,10 @@ void setup_environment_variables (const folder_config_t *folder_config) // we can't free tmpdir at this point! } + /* if (getenv ("CL_CONFIG_USE_VECTORIZER") == NULL) putenv ((char *) "CL_CONFIG_USE_VECTORIZER=False"); + */ #if defined (__CYGWIN__) cygwin_internal (CW_SYNC_WINENV);