Testing: Workaround some AMD OpenCL runtime segmentation faults

pull/1656/head
jsteube 6 years ago
parent 103fdf04a1
commit dad05d9f69

@ -110,7 +110,7 @@ DECLSPEC void md4_init (md4_ctx_t *ctx)
DECLSPEC void md4_update_64 (md4_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -696,7 +696,7 @@ DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, const __global u32
DECLSPEC void md4_final (md4_ctx_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos);
@ -1230,7 +1230,7 @@ DECLSPEC void md4_init_vector_from_scalar (md4_ctx_vector_t *ctx, md4_ctx_t *ctx
DECLSPEC void md4_update_vector_64 (md4_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -1560,7 +1560,7 @@ DECLSPEC void md4_update_vector_utf16le_swap (md4_ctx_vector_t *ctx, const u32x
DECLSPEC void md4_final_vector (md4_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos);

@ -146,7 +146,7 @@ DECLSPEC void md5_init (md5_ctx_t *ctx)
DECLSPEC void md5_update_64 (md5_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -732,7 +732,7 @@ DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, const __global u32
DECLSPEC void md5_final (md5_ctx_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos);
@ -1302,7 +1302,7 @@ DECLSPEC void md5_init_vector_from_scalar (md5_ctx_vector_t *ctx, md5_ctx_t *ctx
DECLSPEC void md5_update_vector_64 (md5_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -1632,7 +1632,7 @@ DECLSPEC void md5_update_vector_utf16le_swap (md5_ctx_vector_t *ctx, const u32x
DECLSPEC void md5_final_vector (md5_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos);

@ -244,7 +244,7 @@ DECLSPEC void ripemd160_init (ripemd160_ctx_t *ctx)
DECLSPEC void ripemd160_update_64 (ripemd160_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -830,7 +830,7 @@ DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, const
DECLSPEC void ripemd160_final (ripemd160_ctx_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos);
@ -1499,7 +1499,7 @@ DECLSPEC void ripemd160_init_vector_from_scalar (ripemd160_ctx_vector_t *ctx, ri
DECLSPEC void ripemd160_update_vector_64 (ripemd160_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -1829,7 +1829,7 @@ DECLSPEC void ripemd160_update_vector_utf16le_swap (ripemd160_ctx_vector_t *ctx,
DECLSPEC void ripemd160_final_vector (ripemd160_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos);

@ -176,7 +176,7 @@ DECLSPEC void sha1_init (sha1_ctx_t *ctx)
DECLSPEC void sha1_update_64 (sha1_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -998,7 +998,7 @@ DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, const __global u
DECLSPEC void sha1_final (sha1_ctx_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3);
@ -1599,7 +1599,7 @@ DECLSPEC void sha1_init_vector_from_scalar (sha1_ctx_vector_t *ctx, sha1_ctx_t *
DECLSPEC void sha1_update_vector_64 (sha1_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -2013,7 +2013,7 @@ DECLSPEC void sha1_update_vector_utf16beN (sha1_ctx_vector_t *ctx, const u32x *w
DECLSPEC void sha1_final_vector (sha1_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3);

@ -161,7 +161,7 @@ DECLSPEC void sha224_init (sha224_ctx_t *ctx)
DECLSPEC void sha224_update_64 (sha224_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -747,7 +747,7 @@ DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, const __glob
DECLSPEC void sha224_final (sha224_ctx_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3);
@ -1316,7 +1316,7 @@ DECLSPEC void sha224_init_vector_from_scalar (sha224_ctx_vector_t *ctx, sha224_c
DECLSPEC void sha224_update_vector_64 (sha224_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -1688,7 +1688,7 @@ DECLSPEC void sha224_update_vector_utf16beN (sha224_ctx_vector_t *ctx, const u32
DECLSPEC void sha224_final_vector (sha224_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3);

@ -161,7 +161,7 @@ DECLSPEC void sha256_init (sha256_ctx_t *ctx)
DECLSPEC void sha256_update_64 (sha256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -747,7 +747,7 @@ DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, const __glob
DECLSPEC void sha256_final (sha256_ctx_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3);
@ -1316,7 +1316,7 @@ DECLSPEC void sha256_init_vector_from_scalar (sha256_ctx_vector_t *ctx, sha256_c
DECLSPEC void sha256_update_vector_64 (sha256_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -1688,7 +1688,7 @@ DECLSPEC void sha256_update_vector_utf16beN (sha256_ctx_vector_t *ctx, const u32
DECLSPEC void sha256_final_vector (sha256_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3);

@ -185,7 +185,7 @@ DECLSPEC void sha384_init (sha384_ctx_t *ctx)
DECLSPEC void sha384_update_128 (sha384_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len)
{
const int pos = ctx->len & 127;
MAYBE_VOLATILE const int pos = ctx->len & 127;
ctx->len += len;
@ -1191,7 +1191,7 @@ DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, const __glob
DECLSPEC void sha384_final (sha384_ctx_t *ctx)
{
const int pos = ctx->len & 127;
MAYBE_VOLATILE const int pos = ctx->len & 127;
append_0x80_8x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3);
@ -2012,7 +2012,7 @@ DECLSPEC void sha384_init_vector_from_scalar (sha384_ctx_vector_t *ctx, sha384_c
DECLSPEC void sha384_update_vector_128 (sha384_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len)
{
const int pos = ctx->len & 127;
MAYBE_VOLATILE const int pos = ctx->len & 127;
ctx->len += len;
@ -2644,7 +2644,7 @@ DECLSPEC void sha384_update_vector_utf16beN (sha384_ctx_vector_t *ctx, const u32
DECLSPEC void sha384_final_vector (sha384_ctx_vector_t *ctx)
{
const int pos = ctx->len & 127;
MAYBE_VOLATILE const int pos = ctx->len & 127;
append_0x80_8x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3);

@ -185,7 +185,7 @@ DECLSPEC void sha512_init (sha512_ctx_t *ctx)
DECLSPEC void sha512_update_128 (sha512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len)
{
const int pos = ctx->len & 127;
MAYBE_VOLATILE const int pos = ctx->len & 127;
ctx->len += len;
@ -1191,7 +1191,7 @@ DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, const __glob
DECLSPEC void sha512_final (sha512_ctx_t *ctx)
{
const int pos = ctx->len & 127;
MAYBE_VOLATILE const int pos = ctx->len & 127;
append_0x80_8x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3);
@ -2012,7 +2012,7 @@ DECLSPEC void sha512_init_vector_from_scalar (sha512_ctx_vector_t *ctx, sha512_c
DECLSPEC void sha512_update_vector_128 (sha512_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len)
{
const int pos = ctx->len & 127;
MAYBE_VOLATILE const int pos = ctx->len & 127;
ctx->len += len;
@ -2644,7 +2644,7 @@ DECLSPEC void sha512_update_vector_utf16beN (sha512_ctx_vector_t *ctx, const u32
DECLSPEC void sha512_final_vector (sha512_ctx_vector_t *ctx)
{
const int pos = ctx->len & 127;
MAYBE_VOLATILE const int pos = ctx->len & 127;
append_0x80_8x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3);

@ -1344,7 +1344,7 @@ DECLSPEC void whirlpool_init (whirlpool_ctx_t *ctx, SHM_TYPE u32 (*s_Ch)[256], S
DECLSPEC void whirlpool_update_64 (whirlpool_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -1930,7 +1930,7 @@ DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, const
DECLSPEC void whirlpool_final (whirlpool_ctx_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3);
@ -2603,7 +2603,7 @@ DECLSPEC void whirlpool_init_vector_from_scalar (whirlpool_ctx_vector_t *ctx, wh
DECLSPEC void whirlpool_update_vector_64 (whirlpool_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
ctx->len += len;
@ -2933,7 +2933,7 @@ DECLSPEC void whirlpool_update_vector_utf16le_swap (whirlpool_ctx_vector_t *ctx,
DECLSPEC void whirlpool_final_vector (whirlpool_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
MAYBE_VOLATILE const int pos = ctx->len & 63;
append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3);

@ -96,6 +96,12 @@
#define DECLSPEC
#endif
#if (defined IS_AMD && AMD_GCN < 3)
#define MAYBE_VOLATILE volatile
#else
#define MAYBE_VOLATILE
#endif
/**
* AMD specific
*/

@ -258,8 +258,8 @@ __kernel void m01600_loop (__global pw_t *pws, __global const kernel_rule_t *rul
if (j1)
{
const u32 off = wpc_len[pc] / 4;
const u32 mod = wpc_len[pc] % 4;
MAYBE_VOLATILE const u32 off = wpc_len[pc] / 4;
MAYBE_VOLATILE const u32 mod = wpc_len[pc] % 4;
u32 *ptr = wpc[pc] + off - 4;

@ -248,8 +248,8 @@ __kernel void m06300_loop (__global pw_t *pws, __global const kernel_rule_t *rul
if (j1)
{
const u32 off = wpc_len[pc] / 4;
const u32 mod = wpc_len[pc] % 4;
MAYBE_VOLATILE const u32 off = wpc_len[pc] / 4;
MAYBE_VOLATILE const u32 mod = wpc_len[pc] % 4;
u32 *ptr = wpc[pc] + off - 4;

@ -12,10 +12,10 @@
DECLSPEC void memcat8c_be (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 len, const u32 append, u32 *digest)
{
const u32 func_len = len & 63;
MAYBE_VOLATILE const u32 func_len = len & 63;
const u32 mod = func_len & 3;
const u32 div = func_len / 4;
MAYBE_VOLATILE const u32 mod = func_len & 3;
MAYBE_VOLATILE const u32 div = func_len / 4;
u32 tmp0;
u32 tmp1;

@ -1,5 +1,11 @@
* changes v4.2.1 -> xxx
##
## Improvements
##
- Workaround some AMD OpenCL runtime segmentation faults
##
## Bugs
##

@ -4268,7 +4268,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
device_param->device_available_mem = device_param->device_global_mem - MAX_ALLOC_CHECKS_SIZE;
if (device_param->platform_vendor_id == VENDOR_ID_NV)
if ((device_param->device_type & CL_DEVICE_TYPE_GPU) && ((device_param->platform_vendor_id == VENDOR_ID_NV) || ((device_param->platform_vendor_id == VENDOR_ID_AMD) && (device_param->is_rocm == false))))
{
// OK, so the problem here is the following:
// There's just CL_DEVICE_GLOBAL_MEM_SIZE to ask OpenCL about the total memory on the device,

Loading…
Cancel
Save