Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc 12 warnings #5154

Open
claudioandre-br opened this issue Jun 1, 2022 · 18 comments
Open

gcc 12 warnings #5154

claudioandre-br opened this issue Jun 1, 2022 · 18 comments

Comments

@claudioandre-br
Copy link
Member

gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)

I updated (some) CI builders to Fedora 36 (it is a --disable-openmp build)

Configure finished.  Now "make -s clean && make -sj4" to compile.
ar: creating aes.a
ar: creating poly1305-donna.a
ar: creating secp256k1.a
ar: creating ed25519-donna.a
pkcs12_plug.c: In function 'mbedtls_pkcs12_derivation_simd_sha1':
pkcs12_plug.c:448:9: error: 'pkcs12_fill_salt_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
  448 |         pkcs12_fill_salt_buffer_simd(salt_block, v, salt, saltlen, SSE_GROUP_SZ_SHA1);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:448:9: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:375:13: note: in a call to function 'pkcs12_fill_salt_buffer_simd'
  375 | static void pkcs12_fill_salt_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:449:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
  449 |         pkcs12_fill_buffer_simd(pwd_block,  v, pwd,  pwdlen, SSE_GROUP_SZ_SHA1);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:449:9: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:449:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
pkcs12_plug.c:449:9: note: referencing argument 3 of type 'const unsigned char *[3360]'
pkcs12_plug.c:449:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
pkcs12_plug.c:449:9: note: referencing argument 4 of type 'size_t[3360]' {aka 'long unsigned int[3360]'}
pkcs12_plug.c:396:13: note: in a call to function 'pkcs12_fill_buffer_simd'
  396 | static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:497:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
  497 |                 pkcs12_fill_buffer_simd( hash_block, v, (const unsigned char**)hash_output, hlens, SSE_GROUP_SZ_SHA1);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:497:17: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:497:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
pkcs12_plug.c:497:17: note: referencing argument 3 of type 'const unsigned char *[3360]'
pkcs12_plug.c:497:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
pkcs12_plug.c:497:17: note: referencing argument 4 of type 'size_t[3360]' {aka 'long unsigned int[3360]'}
pkcs12_plug.c:396:13: note: in a call to function 'pkcs12_fill_buffer_simd'
  396 | static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c: In function 'mbedtls_pkcs12_derivation_simd_sha256':
pkcs12_plug.c:556:9: error: 'pkcs12_fill_salt_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
  556 |         pkcs12_fill_salt_buffer_simd(salt_block, v, salt, saltlen, SSE_GROUP_SZ_SHA256);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:556:9: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:375:13: note: in a call to function 'pkcs12_fill_salt_buffer_simd'
  375 | static void pkcs12_fill_salt_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:557:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
  557 |         pkcs12_fill_buffer_simd(pwd_block,  v, pwd,  pwdlen, SSE_GROUP_SZ_SHA256);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:557:9: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:557:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
pkcs12_plug.c:557:9: note: referencing argument 3 of type 'const unsigned char *[3360]'
pkcs12_plug.c:557:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
pkcs12_plug.c:557:9: note: referencing argument 4 of type 'size_t[3360]' {aka 'long unsigned int[3360]'}
pkcs12_plug.c:396:13: note: in a call to function 'pkcs12_fill_buffer_simd'
  396 | static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:605:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
  605 |                 pkcs12_fill_buffer_simd( hash_block, v, (const unsigned char**)hash_output, hlens, SSE_GROUP_SZ_SHA256);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:605:17: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:605:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
pkcs12_plug.c:605:17: note: referencing argument 3 of type 'const unsigned char *[3360]'
pkcs12_plug.c:605:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 128 [-Werror=stringop-overflow=]
pkcs12_plug.c:605:17: note: referencing argument 4 of type 'size_t[3360]' {aka 'long unsigned int[3360]'}
pkcs12_plug.c:396:13: note: in a call to function 'pkcs12_fill_buffer_simd'
  396 | static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c: In function 'mbedtls_pkcs12_derivation_simd_sha512':
pkcs12_plug.c:705:9: error: 'pkcs12_fill_salt_buffer_simd' accessing 26880 bytes in a region of size 64 [-Werror=stringop-overflow=]
  705 |         pkcs12_fill_salt_buffer_simd(salt_block, v, salt, saltlen, SSE_GROUP_SZ_SHA512);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:705:9: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:375:13: note: in a call to function 'pkcs12_fill_salt_buffer_simd'
  375 | static void pkcs12_fill_salt_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:706:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 64 [-Werror=stringop-overflow=]
  706 |         pkcs12_fill_buffer_simd(pwd_block,  v, pwd,  pwdlen, SSE_GROUP_SZ_SHA512);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:706:9: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:706:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 64 [-Werror=stringop-overflow=]
pkcs12_plug.c:706:9: note: referencing argument 3 of type 'const unsigned char *[3360]'
pkcs12_plug.c:706:9: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 64 [-Werror=stringop-overflow=]
pkcs12_plug.c:706:9: note: referencing argument 4 of type 'size_t[3360]' {aka 'long unsigned int[3360]'}
pkcs12_plug.c:396:13: note: in a call to function 'pkcs12_fill_buffer_simd'
  396 | static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:753:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 64 [-Werror=stringop-overflow=]
  753 |                 pkcs12_fill_buffer_simd( hash_block, v, (const unsigned char**)hash_output, hlens, SSE_GROUP_SZ_SHA512 );
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs12_plug.c:753:17: note: referencing argument 1 of type 'unsigned char *[3360]'
pkcs12_plug.c:753:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 64 [-Werror=stringop-overflow=]
pkcs12_plug.c:753:17: note: referencing argument 3 of type 'const unsigned char *[3360]'
pkcs12_plug.c:753:17: error: 'pkcs12_fill_buffer_simd' accessing 26880 bytes in a region of size 64 [-Werror=stringop-overflow=]
pkcs12_plug.c:753:17: note: referencing argument 4 of type 'size_t[3360]' {aka 'long unsigned int[3360]'}
pkcs12_plug.c:396:13: note: in a call to function 'pkcs12_fill_buffer_simd'
  396 | static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
      |             ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:1556: pkcs12_plug.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:190: default] Error 2
@claudioandre-br
Copy link
Member Author

Also emit warnings for --enable-openmp-for-fast-formats --enable-simd=avx2

@xambroz
Copy link

xambroz commented Feb 19, 2023

i see that on F37 as well

@solardiz
Copy link
Member

solardiz commented Jun 3, 2024

I'm also getting these with gcc version 12.2.0 (Debian 12.2.0-14) building for powerpc64le-linux-gnu (but I think the latter doesn't matter). With gcc version 11.3.1 20220421 (Red Hat 11.3.1-2) (GCC) building for x86_64, I am getting these when I --enable-asan, but not without that configure option.

@solardiz
Copy link
Member

solardiz commented Jun 4, 2024

with gcc version 12.2.0 (Debian 12.2.0-14) building for powerpc64le-linux-gnu

On the same system, building with --enable-asan, I get even more warnings:

krb5pa-sha1_fmt_plug.c: In function ‘split’:
krb5pa-sha1_fmt_plug.c:287:44: warning: ‘$’ directive output may be truncated writing 1 byte into a region of size between 0 and 374 [-Wformat-truncation=]
  287 |         snprintf(out, sizeof(out), "%s%s$%s$%s$%s$%s", FORMAT_TAG, e, u, r, s, tc);
      |                                            ^
krb5pa-sha1_fmt_plug.c:287:9: note: ‘snprintf’ output 13 or more bytes (assuming 515) into a destination of size 383
  287 |         snprintf(out, sizeof(out), "%s%s$%s$%s$%s$%s", FORMAT_TAG, e, u, r, s, tc);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dynamic_fmt.c: In function ‘prepare’:
dynamic_fmt.c:1159:71: warning: ‘$$F’ directive output may be truncated writing 3 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
 1159 |                                         snprintf(ct2, sizeof(ct2), "%s$$F%d%s", cpBuilding, i, split_fields[i]);
      |                                                                       ^~~
dynamic_fmt.c:1159:68: note: directive argument in the range [0, 9]
 1159 |                                         snprintf(ct2, sizeof(ct2), "%s$$F%d%s", cpBuilding, i, split_fields[i]);
      |                                                                    ^~~~~~~~~~~
dynamic_fmt.c:1159:41: note: ‘snprintf’ output 5 or more bytes (assuming 1028) into a destination of size 1024
 1159 |                                         snprintf(ct2, sizeof(ct2), "%s$$F%d%s", cpBuilding, i, split_fields[i]);
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[... pkcs12 warnings were here ...]
opencl_krb5pa-sha1_fmt_plug.c: In function ‘split’:
opencl_krb5pa-sha1_fmt_plug.c:445:44: warning: ‘$’ directive output may be truncated writing 1 byte into a region of size between 0 and 274 [-Wformat-truncation=]
  445 |         snprintf(out, sizeof(out), "%s%s$%s$%s$%s$%s", FORMAT_TAG, e, u, r, s, tc);
      |                                            ^
opencl_krb5pa-sha1_fmt_plug.c:445:9: note: ‘snprintf’ output 13 or more bytes (assuming 339) into a destination of size 283
  445 |         snprintf(out, sizeof(out), "%s%s$%s$%s$%s$%s", FORMAT_TAG, e, u, r, s, tc);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
opencl_common.c: In function ‘opencl_driver_info’:
opencl_common.c:354:69: warning: ‘%s’ directive output may be truncated writing up to 2111 bytes into a region of size between 51 and 2098 [-Wformat-truncation=]
  354 |                         snprintf(buf, sizeof(buf), "%s - AMDGPU-Pro %s", dname, name);
      |                                                                     ^~
opencl_common.c:354:25: note: ‘snprintf’ output between 15 and 4173 bytes into a destination of size 2112
  354 |                         snprintf(buf, sizeof(buf), "%s - AMDGPU-Pro %s", dname, name);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
opencl_common.c:352:66: warning: ‘%s’ directive output may be truncated writing up to 2111 bytes into a region of size between 54 and 2101 [-Wformat-truncation=]
  352 |                         snprintf(buf, sizeof(buf), "%s - Crimson %s", dname, name);
      |                                                                  ^~
opencl_common.c:352:25: note: ‘snprintf’ output between 12 and 4170 bytes into a destination of size 2112
  352 |                         snprintf(buf, sizeof(buf), "%s - Crimson %s", dname, name);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
opencl_common.c:350:67: warning: ‘%s’ directive output may be truncated writing up to 2111 bytes into a region of size between 53 and 2100 [-Wformat-truncation=]
  350 |                         snprintf(buf, sizeof(buf), "%s - Catalyst %s", dname, name);
      |                                                                   ^~
opencl_common.c:350:25: note: ‘snprintf’ output between 13 and 4171 bytes into a destination of size 2112
  350 |                         snprintf(buf, sizeof(buf), "%s - Catalyst %s", dname, name);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@solardiz solardiz changed the title gcc 12.1 warnings (no-omp) gcc 12 warnings Jun 4, 2024
@solardiz
Copy link
Member

solardiz commented Jun 4, 2024

On the same system, building with --enable-asan, I get even more warnings:

We were also getting these with gcc 10 when building with ASan in #5139.

@solardiz
Copy link
Member

solardiz commented Nov 6, 2024

The pkcs12_plug.c warnings here are also seen with gcc 14 (on our CI now).

@claudioandre-br
Copy link
Member Author

claudioandre-br commented Nov 6, 2024

The pkcs12 is the important warning that remains (appears everywhere). Also, the lack of prototype in gpg2john comes second.

Once this has been resolved, the rest will be done in one go.

@magnumripper
Copy link
Member

magnumripper commented Dec 2, 2024

I only see the pkcs12 warning now (not using ASan or anything like that) but it drives me insane. I have stared at the code for hours, I see nothing wrong. All affected code actually fits on the screen so it's easy to review.

I think we should do this:

diff --git a/src/pkcs12_plug.c b/src/pkcs12_plug.c
index b9e6316ae..76fdf112b 100644
--- a/src/pkcs12_plug.c
+++ b/src/pkcs12_plug.c
@@ -416,6 +416,13 @@ static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], siz
 	}
 }
 
+/*
+ * Mute what appears to be a false positive in gcc 12-14, see #5154
+ */
+#if __GNUC__ >= 12 && __GNUC__ <= 14
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+
 static int mbedtls_pkcs12_derivation_simd_sha1( unsigned char *data[SSE_GROUP_SZ_SHA1], size_t datalen,
 	        const unsigned char *pwd[SSE_GROUP_SZ_SHA1], size_t pwdlen[SSE_GROUP_SZ_SHA1],
 	        const unsigned char *salt, size_t saltlen, int id, int iterations )

As written we are purposefully forced to revisit for gcc-15 unless they fixed something.

@magnumripper
Copy link
Member

On another note we should drop the mbedtls_ prefix from those files, it's even more misleading now. Some of those functions are written from scratch by Jim and still have it.

@claudioandre-br
Copy link
Member Author

Once upon a time I created a patch that I think makes sense (based on my old C book) and the pfx format (a format that calls the functions) still works after the change (in AVX2). No performance regression and no warnings.

diff --git a/src/pkcs12_plug.c b/src/pkcs12_plug.c
index b9e6316ae..134772444 100644
--- a/src/pkcs12_plug.c
+++ b/src/pkcs12_plug.c
@@ -372,7 +372,7 @@ int pkcs12_pbe_derive_key_simd_sha256( int iterations, int id, const unsigned ch
 }
 
 
-static void pkcs12_fill_salt_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
+static void pkcs12_fill_salt_buffer_simd(unsigned char *data[], size_t data_len,
                                     const unsigned char *filler, size_t fill_len, int fill_count)
 {
 	int j;
@@ -393,9 +393,9 @@ static void pkcs12_fill_salt_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX]
 	}
 }
 
-static void pkcs12_fill_buffer_simd(unsigned char *data[SIMD_MAX_GROUP_PFX], size_t data_len,
-                                    const unsigned char *filler[SIMD_MAX_GROUP_PFX],
-				    size_t fill_len[SIMD_MAX_GROUP_PFX], int fill_count)
+static void pkcs12_fill_buffer_simd(unsigned char *data[], size_t data_len,
+                                    const unsigned char *filler[],
+				    size_t fill_len[], int fill_count)
 {
 	int j;
 	unsigned char *p;

But, since it is SIMD, I'm probably missing something.

@magnumripper
Copy link
Member

I can't believe I didn't try that. I'll test it and amend my PR

magnumripper added a commit to magnumripper/john that referenced this issue Dec 2, 2024
We're simply hiding the size from the compiler and pray the
warnings are false positives.

Kudos to Claudio, see openwall#5154
@magnumripper
Copy link
Member

Yeah, it obviously works fine. Technically it's more or less the same thing though, we just silence the warnings and hope there isn't a real bug somewhere in there. I'm fairly confident there is no bug though, other than possibly in gcc.

I replaced my "diagnostic ignored" patch with Claudio's in #5602 now.

magnumripper added a commit that referenced this issue Dec 3, 2024
We're simply hiding the size from the compiler and pray the
warnings are false positives.

Kudos to Claudio, see #5154
@falkuh
Copy link

falkuh commented Dec 12, 2024

Hi, not sure whether I fall back behind this discussion. On my MacStudio M1 I still get the blake2b_state error. Any help appreciated.

###################

After

CC=/usr/bin/clang
export CC
./configure && make

I stll get

Configured for building John the Ripper jumbo:

Target CPU ................................. arm, 64-bit LE
AES-NI support ............................. no
Target OS .................................. darwin23.6.0
Cross compiling ............................ no
Legacy arch header ......................... arm32le.h

Optional libraries/features found:
Memory map (share/page large files) ........ yes
Fork support ............................... yes
OpenMP support ............................. no
OpenCL support ............................. yes
Generic crypt(3) format .................... yes
libgmp (PRINCE mode and faster SRP formats)  yes
128-bit integer (faster PRINCE mode) ....... yes
libz (pkzip and some other formats) ........ yes
libbz2 (gpg2john extra decompression logic)  yes
libpcap (vncpcap2john and SIPdump) ......... yes
OpenMPI support (default disabled) ......... no
ZTEX USB-FPGA module 1.15y support ......... no

Install missing libraries to get any needed features that were omitted.

Configure finished.  Now "make -s clean && make -sj4" to compile.
/Applications/Xcode.app/Contents/Developer/usr/bin/make find_version
echo "#define JTR_GIT_VERSION JUMBO_VERSION "\"-a16c8a7625 2019-05-14 18:29:46 +0200\""" > version.h.new
diff >/dev/null 2>/dev/null version.h.new version.h && rm -f version.h.new || mv -f version.h.new version.h
/usr/bin/clang -DAC_BUILT  -DJOHN_ -c -g -O2 -I/usr/local/include -I/opt/local/include -DARCH_LITTLE_ENDIAN=1  -Wall -Wno-tautological-constant-out-of-range-compare -fno-omit-frame-pointer -Wno-deprecated-declarations -Wformat-extra-args -Wunused-but-set-variable -Qunused-arguments -std=gnu89 -Wdate-time    -D_THREAD_SAFE -pthread -I/usr/local/include -I/opt/local/include -DCL_SILENCE_DEPRECATION -DHAVE_OPENCL -D_THREAD_SAFE -pthread -funroll-loops argon2_core_plug.c -o argon2_core_plug.o
In file included from argon2_core_plug.c:32:
./blake2.h:112:23: error: size of array element of type 'blake2b_state' (aka 'struct __blake2b_state') (368 bytes) isn't a multiple of its alignment (64 bytes)
  112 |     blake2b_state S[4][1];
      |                       ^
./blake2.h:113:20: error: size of array element of type 'blake2b_state' (aka 'struct __blake2b_state') (368 bytes) isn't a multiple of its alignment (64 bytes)
  113 |     blake2b_state R[1];
      |                    ^
2 errors generated.
make[1]: *** [argon2_core_plug.o] Error 1
make: *** [default] Error 2

@solardiz
Copy link
Member

Hi @falkuh. Your comment is off-topic for this issue. What you're running into was discussed in several other GitHub issues here, now closed. The reason you're still running into this problem is because you're trying to build our previous release from 2019, not latest code from this repo. Please update to the latest source code from this repo, or you may use a recent binary build for macOS from https://github.com/openwall/john-packages/releases

@solardiz
Copy link
Member

Separately, I notice we had arm, 64-bit LE in combination with arm32le.h, so a mix of 64- and 32-bit. I hope this is something we've also fixed since then, @magnumripper?

> Target CPU ................................. arm, 64-bit LE
> AES-NI support ............................. no
> Target OS .................................. darwin23.6.0
> Cross compiling ............................ no
> Legacy arch header ......................... arm32le.h

@solardiz
Copy link
Member

solardiz commented Dec 12, 2024

Oh, and also why do we still have this issue about the warnings open? Haven't we fixed those via #5602?
Edit: Oh, I guess we've only fixed the warnings from the OP, but not those from my later comment #5154 (comment)?

@magnumripper
Copy link
Member

I get it correctly on the M1, current head 250498b

Target CPU ......................................... arm ASIMD, 64-bit LE
Target OS .......................................... darwin24.2.0
Cross compiling .................................... no
Legacy arch header ................................. arm64le.h

As for closing or not, I guess we could close this issue as only ASan builds show warnings (has been the case for years) but we could obviously try and fix them.

@solardiz
Copy link
Member

we had arm, 64-bit LE in combination with arm32le.h, so a mix of 64- and 32-bit. I hope this is something we've also fixed since then

Indeed we did, in d6c8792 referring to #4585.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants