[GH-ISSUE #2674] Generate and host updated builds for macOS #1729

Closed
opened 2026-10-15 04:23:32 +07:00 by bsakaguchi · 67 comments
Owner

Originally created by @kholia on GitHub (Aug 15, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2674

Originally assigned to: @kholia on GitHub.

See https://github.com/magnumripper/JohnTheRipper/issues/869 for the details.

I think https://docs.travis-ci.com/user/deployment/releases/ can help in completing this task.

Originally created by @kholia on GitHub (Aug 15, 2017). Original GitHub issue: https://github.com/openwall/john/issues/2674 Originally assigned to: @kholia on GitHub. See https://github.com/magnumripper/JohnTheRipper/issues/869 for the details. I think https://docs.travis-ci.com/user/deployment/releases/ can help in completing this task.
bsakaguchi 2026-10-15 04:23:32 +07:00
Author
Owner

@kholia commented on GitHub (Aug 15, 2017):

@magnumripper I think this will need work from your side.

Here are two references,

https://docs.travis-ci.com/user/deployment/releases/

https://github.com/kholia/JohnTheRipper/tree/macOS (top commit)

It seems that I am unable to publish builds ("releases") for magnumripper/JohnTheRipper/ slug.

<!-- gh-comment-id:322483386 --> @kholia commented on GitHub (Aug 15, 2017): @magnumripper I think this will need work from your side. Here are two references, https://docs.travis-ci.com/user/deployment/releases/ https://github.com/kholia/JohnTheRipper/tree/macOS (top commit) It seems that I am unable to publish builds ("releases") for `magnumripper/JohnTheRipper/` slug.
Author
Owner

@kholia commented on GitHub (Aug 15, 2017):

I think I have all the pieces required now. https://github.com/kholia/JohnTheRipper/releases now has a macOS build available :-)

Remember to use travis encrypt "GitHub token" -r <username>/JohnTheRipper command to generate the secure API key. The GitHub token needs to be generated with a repo scope using the https://github.com/settings/tokens page.

<!-- gh-comment-id:322509295 --> @kholia commented on GitHub (Aug 15, 2017): I think I have all the pieces required now. https://github.com/kholia/JohnTheRipper/releases now has a macOS build available :-) Remember to use `travis encrypt "GitHub token" -r <username>/JohnTheRipper` command to generate the secure API key. The GitHub token needs to be generated with a `repo` scope using the https://github.com/settings/tokens page.
Author
Owner

@solardiz commented on GitHub (Aug 15, 2017):

https://github.com/kholia/JohnTheRipper/releases now has a macOS build available :-)

Cool. But I guess it's for specific CPU features? I think we need at least SSE2-only and AVX2-enabled builds. BTW, the same applies to our automated Windows builds.

<!-- gh-comment-id:322516310 --> @solardiz commented on GitHub (Aug 15, 2017): > https://github.com/kholia/JohnTheRipper/releases now has a macOS build available :-) Cool. But I guess it's for specific CPU features? I think we need at least SSE2-only and AVX2-enabled builds. BTW, the same applies to our automated Windows builds.
Author
Owner

@kholia commented on GitHub (Aug 15, 2017):

I am not sure about the CPU features being used by the current macOS build. I will check this out.

I will look into how I can do SSE2-only and AVX2 builds. Tips around this topic are highly welcome!

<!-- gh-comment-id:322523275 --> @kholia commented on GitHub (Aug 15, 2017): I am not sure about the CPU features being used by the current macOS build. I will check this out. I will look into how I can do SSE2-only and AVX2 builds. Tips around this topic are highly welcome!
Author
Owner

@solardiz commented on GitHub (Aug 15, 2017):

I will look into how I can do SSE2-only and AVX2 builds.

I think "./configure --disable-native-tests" should result in an SSE2-only build. As to an AVX2 build, it should happen by default if the underlying system has AVX2. If not, then you might be able to force that, but it gets trickier - you'll have to override the CFLAGS, yet not drop (so re-introduce) the original contents of CFLAGS (or else other optimizations will be lost). Hopefully, the build system would just happen to be AVX2-capable.

<!-- gh-comment-id:322541952 --> @solardiz commented on GitHub (Aug 15, 2017): > I will look into how I can do SSE2-only and AVX2 builds. I think "./configure --disable-native-tests" should result in an SSE2-only build. As to an AVX2 build, it should happen by default if the underlying system has AVX2. If not, then you might be able to force that, but it gets trickier - you'll have to override the CFLAGS, yet not drop (so re-introduce) the original contents of CFLAGS (or else other optimizations will be lost). Hopefully, the build system would just happen to be AVX2-capable.
Author
Owner

@magnumripper commented on GitHub (Aug 15, 2017):

$ ./configure --help

  --disable-native-tests  Do not test build system for target features.
                          Implies --disable-native-march.
  --disable-native-march  Do not use things like -march=native even if valid
                          compiler option(s). Native tests still can be run in
                          this mode
<!-- gh-comment-id:322544580 --> @magnumripper commented on GitHub (Aug 15, 2017): $ ./configure --help ``` --disable-native-tests Do not test build system for target features. Implies --disable-native-march. --disable-native-march Do not use things like -march=native even if valid compiler option(s). Native tests still can be run in this mode ```
Author
Owner

@magnumripper commented on GitHub (Aug 15, 2017):

I believe ./configure CPPFLAGS=-mavx2 --disable-native-tests should produce an AVX2 build on many non-AVX2 build hosts. It doesn't work on my Macbook though, for some reason it ends up producing an SSE2 build.

<!-- gh-comment-id:322546041 --> @magnumripper commented on GitHub (Aug 15, 2017): I believe `./configure CPPFLAGS=-mavx2 --disable-native-tests` should produce an AVX2 build on many non-AVX2 build hosts. It doesn't work on my Macbook though, for some reason it ends up producing an SSE2 build.
Author
Owner

@solardiz commented on GitHub (Aug 15, 2017):

What the point behind --disable-native-march? What are those native tests we'd want to run if we don't(?) produce a native build?

BTW, this reminds me: in my recent testing of php_mt_seed, I found that -march=native caused an 8% slowdown on Haswell compared to -mavx2. I worked around that by adding -mtune=generic right after -march=native. This is a gcc issue (I think its attempt at better instruction scheduling for Haswell fails when the source code contains more than a usual amount of parallelism, such as through explicit interleaving, like we do in both of these projects), but anyhow we might want to see if adding -mtune=generic provides a net speedup for JtR as well.

<!-- gh-comment-id:322546289 --> @solardiz commented on GitHub (Aug 15, 2017): What the point behind `--disable-native-march`? What are those native tests we'd want to run if we don't(?) produce a native build? BTW, this reminds me: in my recent testing of php_mt_seed, I found that `-march=native` caused an 8% slowdown on Haswell compared to `-mavx2`. I worked around that by adding `-mtune=generic` right after `-march=native`. This is a gcc issue (I think its attempt at better instruction scheduling for Haswell fails when the source code contains more than a usual amount of parallelism, such as through explicit interleaving, like we do in both of these projects), but anyhow we might want to see if adding `-mtune=generic` provides a net speedup for JtR as well.
Author
Owner

@solardiz commented on GitHub (Aug 15, 2017):

./configure CPPFLAGS=-mavx2 --disable-native-tests

Doesn't that leave CFLAGS without -mavx2?

<!-- gh-comment-id:322546586 --> @solardiz commented on GitHub (Aug 15, 2017): > ./configure CPPFLAGS=-mavx2 --disable-native-tests Doesn't that leave CFLAGS without `-mavx2`?
Author
Owner

@magnumripper commented on GitHub (Aug 15, 2017):

What the point behind --disable-native-march?

Many systems doesn't (or didn't) have -march=native. At first it was a Linux-only option.

./configure CPPFLAGS=-mavx2 --disable-native-tests

Doesn't that leave CFLAGS without -mavx2?

Apparently it does (I believe the above worked long ago). This works fine right now on my AVX Macbook:

./configure CFLAGS="-mavx2 -O2 -g" --disable-native-tests
<!-- gh-comment-id:322547457 --> @magnumripper commented on GitHub (Aug 15, 2017): > What the point behind `--disable-native-march`? Many systems doesn't (or didn't) have `-march=native`. At first it was a Linux-only option. >> ./configure CPPFLAGS=-mavx2 --disable-native-tests > > Doesn't that leave CFLAGS without `-mavx2`? Apparently it does (I believe the above worked long ago). This works fine right now on my AVX Macbook: ``` ./configure CFLAGS="-mavx2 -O2 -g" --disable-native-tests ```
Author
Owner

@magnumripper commented on GitHub (Aug 15, 2017):

At first it was a Linux-only option.

In fact it's still listed as such in the gcc-7 manpage although it has worked fine on OSX for years.

-march=native causes the compiler to auto-detect the architecture of the build
computer.  At present, this feature is only supported on GNU/Linux, and not all
architectures are recognized.  If the auto-detect is unsuccessful the option has
no effect.
<!-- gh-comment-id:322548874 --> @magnumripper commented on GitHub (Aug 15, 2017): > At first it was a Linux-only option. In fact it's still listed as such in the gcc-7 manpage although it has worked fine on OSX for years. ``` -march=native causes the compiler to auto-detect the architecture of the build computer. At present, this feature is only supported on GNU/Linux, and not all architectures are recognized. If the auto-detect is unsuccessful the option has no effect. ```
Author
Owner

@solardiz commented on GitHub (Aug 15, 2017):

./configure CFLAGS="-mavx2 -O2 -g" --disable-native-tests

Doesn't this miss other optimization options that we normally use? Perhaps -fomit-frame-pointer?

<!-- gh-comment-id:322549999 --> @solardiz commented on GitHub (Aug 15, 2017): > ./configure CFLAGS="-mavx2 -O2 -g" --disable-native-tests Doesn't this miss other optimization options that we normally use? Perhaps `-fomit-frame-pointer`?
Author
Owner

@magnumripper commented on GitHub (Aug 15, 2017):

The other options are added afterwards. On my system, CFLAGS defaults to [starts out as] "-O2 -g". I can't remember if that's a property of gcc or of autoconf. Should be autoconf I guess.

<!-- gh-comment-id:322550974 --> @magnumripper commented on GitHub (Aug 15, 2017): The other options are added afterwards. On my system, CFLAGS defaults to [starts out as] "-O2 -g". I can't remember if that's a property of gcc or of autoconf. Should be autoconf I guess.
Author
Owner

@magnumripper commented on GitHub (Aug 15, 2017):

The compilation of simd-intrinsics.c ends up like this with my mentioned CFLAGS (well I also use -I and -L pointing to Homebrew stuff):

gcc -DAC_BUILT -mavx2 -DJOHN_AVX2 -c -mavx2 -O2 -g -I/usr/local/include -DARCH_LITTLE_ENDIAN=1   -Wall -Wdeclaration-after-statement -fomit-frame-pointer --param allow-store-data-races=0 -Wno-deprecated-declarations  -Wunused-but-set-variable -std=gnu89 -Wdate-time   -fopenmp  -D_THREAD_SAFE -pthread   -I/usr/local/opt/openssl/include -I/usr/local/include -DHAVE_OPENCL -D_THREAD_SAFE -pthread -funroll-loops simd-intrinsics.c -o simd-intrinsics.o

Not sure what caused the double -mavx2 but it doesn't cause any trouble.

<!-- gh-comment-id:322552505 --> @magnumripper commented on GitHub (Aug 15, 2017): The compilation of simd-intrinsics.c ends up like this with my mentioned CFLAGS (well I also use `-I` and `-L` pointing to Homebrew stuff): ``` gcc -DAC_BUILT -mavx2 -DJOHN_AVX2 -c -mavx2 -O2 -g -I/usr/local/include -DARCH_LITTLE_ENDIAN=1 -Wall -Wdeclaration-after-statement -fomit-frame-pointer --param allow-store-data-races=0 -Wno-deprecated-declarations -Wunused-but-set-variable -std=gnu89 -Wdate-time -fopenmp -D_THREAD_SAFE -pthread -I/usr/local/opt/openssl/include -I/usr/local/include -DHAVE_OPENCL -D_THREAD_SAFE -pthread -funroll-loops simd-intrinsics.c -o simd-intrinsics.o ``` Not sure what caused the double `-mavx2` but it doesn't cause any trouble.
Author
Owner

@kholia commented on GitHub (Aug 16, 2017):

I could not do a SSE2-only build so far. The current build configurations commands can be seen at,
https://github.com/kholia/JohnTheRipper/blob/macOS/.travis/check.sh

Here is a SSE4.1 + AVX2 combo build,
https://github.com/kholia/JohnTheRipper/releases/download/macOS-3/JtR-macOS.zip

@magnumripper Can you please check if the john-avx2 binary from this build is working on your AVX2 Mac system? My Mac VM does not support AVX2.

This builds require OpenSSL + GMP to be installed (brew install --force openssl gmp).

<!-- gh-comment-id:322759788 --> @kholia commented on GitHub (Aug 16, 2017): I could not do a SSE2-only build so far. The current build configurations commands can be seen at, https://github.com/kholia/JohnTheRipper/blob/macOS/.travis/check.sh Here is a SSE4.1 + AVX2 combo build, https://github.com/kholia/JohnTheRipper/releases/download/macOS-3/JtR-macOS.zip @magnumripper Can you please check if the `john-avx2` binary from this build is working on your AVX2 Mac system? My Mac VM does not support AVX2. This builds require OpenSSL + GMP to be installed (brew install --force openssl gmp).
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

I could not do a SSE2-only build so far

Try adding CFLAGS=-mno-sse4.1 -O2 -g to that one. Or even -mno-ssse3 instead.

@magnumripper Can you please check if the john-avx2 binary from this build

I currently only have an AVX Macbook so I can't test AVX2.

<!-- gh-comment-id:322798670 --> @magnumripper commented on GitHub (Aug 16, 2017): > I could not do a SSE2-only build so far Try adding `CFLAGS=-mno-sse4.1 -O2 -g` to that one. Or even `-mno-ssse3` instead. > @magnumripper Can you please check if the john-avx2 binary from this build I currently only have an AVX Macbook so I can't test AVX2.
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

Well I could test it anyway of course.

$ run/john-avx2 
Illegal instruction: 4

That's strange. It should say "Sorry, this build requires AVX2" or something like that.

<!-- gh-comment-id:322800129 --> @magnumripper commented on GitHub (Aug 16, 2017): Well I could test it anyway of course. ``` $ run/john-avx2 Illegal instruction: 4 ``` That's strange. It should say "Sorry, this build requires AVX2" or something like that.
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

Process 6939 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x00000001002756bf john-avx2`CRC32_Init_tab + 31
john-avx2`CRC32_Init_tab:
->  0x1002756bf <+31>: vpbroadcastd 0x1acb78(%rip), %ymm0     ; padding + 160
    0x1002756c8 <+40>: vpxor  %ymm3, %ymm3, %ymm3
    0x1002756cc <+44>: vpbroadcastd 0x1bf66b(%rip), %ymm4     ; itoa16u + 144
    0x1002756d5 <+53>: leaq   0x4ce644(%rip), %rcx      ; JTR_CRC32_table
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  * frame #0: 0x00000001002756bf john-avx2`CRC32_Init_tab + 31
    frame #1: 0x000000010027d137 john-avx2`main + 135
    frame #2: 0x00007fffad736235 libdyld.dylib`start + 1
    frame #3: 0x00007fffad736235 libdyld.dylib`start + 1
<!-- gh-comment-id:322801462 --> @magnumripper commented on GitHub (Aug 16, 2017): ``` Process 6939 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) frame #0: 0x00000001002756bf john-avx2`CRC32_Init_tab + 31 john-avx2`CRC32_Init_tab: -> 0x1002756bf <+31>: vpbroadcastd 0x1acb78(%rip), %ymm0 ; padding + 160 0x1002756c8 <+40>: vpxor %ymm3, %ymm3, %ymm3 0x1002756cc <+44>: vpbroadcastd 0x1bf66b(%rip), %ymm4 ; itoa16u + 144 0x1002756d5 <+53>: leaq 0x4ce644(%rip), %rcx ; JTR_CRC32_table (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) * frame #0: 0x00000001002756bf john-avx2`CRC32_Init_tab + 31 frame #1: 0x000000010027d137 john-avx2`main + 135 frame #2: 0x00007fffad736235 libdyld.dylib`start + 1 frame #3: 0x00007fffad736235 libdyld.dylib`start + 1 ```
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

./configure CPPFLAGS=-mavx2 --disable-native-tests

Doesn't that leave CFLAGS without -mavx2?

Apparently it does (I believe the above worked long ago).

CPPFLAGS is added everywhere needed, so using CPPFLAGS=-mavx2 is actually safer. The problem I had yesterday was that I later overwrote CPPFLAGS with an -I/usr/local/include(...).

@kholia try dropping CFLAGS from your lines and using CPPFLAGS=-mavx2 instead. I believe that will end up better (for reasons we might want to dig into).

<!-- gh-comment-id:322802411 --> @magnumripper commented on GitHub (Aug 16, 2017): >>> ./configure CPPFLAGS=-mavx2 --disable-native-tests >> >> Doesn't that leave CFLAGS without `-mavx2`? > > Apparently it does (I believe the above worked long ago). CPPFLAGS is added everywhere needed, so using `CPPFLAGS=-mavx2` is actually safer. The problem I had yesterday was that I later overwrote CPPFLAGS with an `-I/usr/local/include(...)`. @kholia try dropping CFLAGS from your lines and using `CPPFLAGS=-mavx2` instead. I believe that will end up better (for reasons we might want to dig into).
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

I had a look at Makefile. Using CPPFLAGS should be no different from CFLAGS, as we end up with a final CFLAGS that end with CPPFLAGS. I think my faiblesse for using CPPFLAGS (which is not very logical) comes from the fact I don't have to add the -O2 -g...

<!-- gh-comment-id:322807525 --> @magnumripper commented on GitHub (Aug 16, 2017): I had a look at Makefile. Using CPPFLAGS should be no different from CFLAGS, as we end up with a final CFLAGS that end with CPPFLAGS. I think my faiblesse for using CPPFLAGS (which is not very logical) comes from the fact I don't have to add the `-O2 -g`...
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

BTW see also https://github.com/magnumripper/JohnTheRipper/wiki/Fallback-binary-chains

<!-- gh-comment-id:322807991 --> @magnumripper commented on GitHub (Aug 16, 2017): BTW see also https://github.com/magnumripper/JohnTheRipper/wiki/Fallback-binary-chains
Author
Owner

@kholia commented on GitHub (Aug 16, 2017):

This page is super useful.

Will using CFLAGS=-mavx ... (not mavx2) generate builds which we can test on your Mac system?

I will create a VM to test this "fallback binary chains" stuff. It seems too wonderful to me. Does it really work? :-)

<!-- gh-comment-id:322813672 --> @kholia commented on GitHub (Aug 16, 2017): This page is super useful. Will using `CFLAGS=-mavx ...` (not mavx2) generate builds which we can test on your Mac system? I will create a VM to test this "fallback binary chains" stuff. It seems too wonderful to me. Does it really work? :-)
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

Will using CFLAGS=-mavx ... (not mavx2) generate builds which we can test on your Mac system?

It should. I just tested building here using your AVX2 configure line, and I do get the "Sorry, AVX2 is required for this build". I wonder why I got "Illegal instruction: 4" using your binary.

I will create a VM to test this "fallback binary chains" stuff. It seems too wonderful to me. Does it really work? :-)

Sure, it's tested on Linux and OSX.

<!-- gh-comment-id:322815646 --> @magnumripper commented on GitHub (Aug 16, 2017): > Will using CFLAGS=-mavx ... (not mavx2) generate builds which we can test on your Mac system? It should. I just tested building here using your AVX2 configure line, and I do get the "Sorry, AVX2 is required for this build". I wonder why I got "Illegal instruction: 4" using your binary. > I will create a VM to test this "fallback binary chains" stuff. It seems too wonderful to me. Does it really work? :-) Sure, it's tested on Linux and OSX.
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

@kholia if you try out CPU fallback, be sure to have 648b13fe first!

<!-- gh-comment-id:322821906 --> @magnumripper commented on GitHub (Aug 16, 2017): @kholia if you try out CPU fallback, be sure to have 648b13fe first!
Author
Owner

@kholia commented on GitHub (Aug 16, 2017):

I do get the "Sorry, AVX2 is required for this build". I wonder why I got "Illegal instruction: 4" using your binary.

This difference is very weird and I can't think of a reason.

I will give CPU fallback (with that commit) a try tomorrow. It is time for bed here.

<!-- gh-comment-id:322826058 --> @kholia commented on GitHub (Aug 16, 2017): > I do get the "Sorry, AVX2 is required for this build". I wonder why I got "Illegal instruction: 4" using your binary. This difference is very weird and I can't think of a reason. I will give CPU fallback (with that commit) a try tomorrow. It is time for bed here.
Author
Owner

@magnumripper commented on GitHub (Aug 16, 2017):

This difference is very weird and I can't think of a reason.

That's what was fixed in #2679 - it's history now! Some compiler optimization (in your build but not in mine) decided to use AVX2 instructions for CRC32_Init_tab() and Jim had placed that function call prior to the CPU detection/fallback. The problem has been there since June 2015 but I never saw it surfacing until now.

<!-- gh-comment-id:322864996 --> @magnumripper commented on GitHub (Aug 16, 2017): > This difference is very weird and I can't think of a reason. That's what was fixed in #2679 - it's history now! Some compiler optimization (in your build but not in mine) decided to use AVX2 instructions for `CRC32_Init_tab()` and Jim had placed that function call prior to the CPU detection/fallback. The problem has been there since June 2015 but I never saw it surfacing until now.
Author
Owner

@kholia commented on GitHub (Aug 17, 2017):

CPU detection is working great now. Fallback binary chain stuff also seems to be working fine. 👍 for both.

I am still having problems generating SSE2-only builds. I see the following errors in Travis CI,

checking for MMX... no
checking for arch.h alternative... x86-64.h
checking for 32/64 bit... 32-bit
checking for extra ASFLAGS... clang: error: unsupported argument '-q' to option 'Wa,'
None needed
checking for X32 ABI... no
checking for byte ordering according to target triple... little
checking supplied paths for OpenSSL...  
checking additional paths for OpenSSL... none
checking openssl/opensslv.h usability... no
checking openssl/opensslv.h presence... yes
configure: WARNING: openssl/opensslv.h: present but cannot be compiled
configure: WARNING: openssl/opensslv.h:     check for missing prerequisite headers?
configure: WARNING: openssl/opensslv.h: see the Autoconf documentation
configure: WARNING: openssl/opensslv.h:     section "Present But Cannot Be Compiled"
configure: WARNING: openssl/opensslv.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------------------ ##
configure: WARNING:     ## Report this to john-users mailing list at openwall.com ##
configure: WARNING:     ## ------------------------------------------------------ ##
checking for openssl/opensslv.h... no
configure: error: JtR requires OpenSSL headers being installed
See `config.log' for more details

I am using the following configure command,

./configure --disable-native-tests CPPFLAGS="-mno-ssse3 -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib

For now I will generate SSE4.1 and AVX2 binaries. macOS Sierra requires SSE4.1 to run.

<!-- gh-comment-id:323034156 --> @kholia commented on GitHub (Aug 17, 2017): CPU detection is working great now. Fallback binary chain stuff also seems to be working fine. 👍 for both. I am still having problems generating SSE2-only builds. I see the following errors in Travis CI, ``` checking for MMX... no checking for arch.h alternative... x86-64.h checking for 32/64 bit... 32-bit checking for extra ASFLAGS... clang: error: unsupported argument '-q' to option 'Wa,' None needed checking for X32 ABI... no checking for byte ordering according to target triple... little checking supplied paths for OpenSSL... checking additional paths for OpenSSL... none checking openssl/opensslv.h usability... no checking openssl/opensslv.h presence... yes configure: WARNING: openssl/opensslv.h: present but cannot be compiled configure: WARNING: openssl/opensslv.h: check for missing prerequisite headers? configure: WARNING: openssl/opensslv.h: see the Autoconf documentation configure: WARNING: openssl/opensslv.h: section "Present But Cannot Be Compiled" configure: WARNING: openssl/opensslv.h: proceeding with the compiler's result configure: WARNING: ## ------------------------------------------------------ ## configure: WARNING: ## Report this to john-users mailing list at openwall.com ## configure: WARNING: ## ------------------------------------------------------ ## checking for openssl/opensslv.h... no configure: error: JtR requires OpenSSL headers being installed See `config.log' for more details ``` I am using the following configure command, `./configure --disable-native-tests CPPFLAGS="-mno-ssse3 -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib` For now I will generate SSE4.1 and AVX2 binaries. macOS Sierra requires SSE4.1 to run.
Author
Owner

@solardiz commented on GitHub (Aug 17, 2017):

For now I will generate SSE4.1 and AVX2 binaries. macOS Sierra requires SSE4.1 to run.

That's what I thought: if SSE4.1 gets enabled by default even without -march=native, maybe that's because the versions of OS X the binary would be able to run on require SSE4.1 anyway. If so, it's pointless to build an SSE2-only binary for those versions of OS X. An SSE2-only binary would make sense only if it's also runnable on OS X old enough that it could potentially run on hardware lacking SSE4.1.

And there's no point in going below SSSE3 in any OS X build, because Core 2 Duo already supported SSSE3 and that's what was found in the earliest widespread Intel Macs and (I think) what the earliest x86-64 releases of OS X would run on (we're talking 64-bit builds of JtR anyway).

So my comment about needing an SSE2-only build was wrong. The oldest we might want to support is SSSE3 or SSE4.1, depending on target OS X versions.

<!-- gh-comment-id:323108213 --> @solardiz commented on GitHub (Aug 17, 2017): > For now I will generate SSE4.1 and AVX2 binaries. macOS Sierra requires SSE4.1 to run. That's what I thought: if SSE4.1 gets enabled by default even without `-march=native`, maybe that's because the versions of OS X the binary would be able to run on require SSE4.1 anyway. If so, it's pointless to build an SSE2-only binary for those versions of OS X. An SSE2-only binary would make sense only if it's also runnable on OS X old enough that it could potentially run on hardware lacking SSE4.1. And there's no point in going below SSSE3 in any OS X build, because Core 2 Duo already supported SSSE3 and that's what was found in the earliest widespread Intel Macs and (I think) what the earliest x86-64 releases of OS X would run on (we're talking 64-bit builds of JtR anyway). So my comment about needing an SSE2-only build was wrong. The oldest we might want to support is SSSE3 or SSE4.1, depending on target OS X versions.
Author
Owner

@kholia commented on GitHub (Aug 18, 2017):

Latest AVX2 enabled macOS builds with automatic fallback to SSE4.1 are now available at https://github.com/kholia/JohnTheRipper/releases.

Please test them.

These builds have only been tested on macOS Sierra and not on older OS X. Generating and testing builds for older OS X would require more work.

<!-- gh-comment-id:323258144 --> @kholia commented on GitHub (Aug 18, 2017): Latest AVX2 enabled macOS builds with automatic fallback to SSE4.1 are now available at https://github.com/kholia/JohnTheRipper/releases. Please test them. These builds have only been tested on macOS Sierra and not on older OS X. Generating and testing builds for older OS X would require more work.
Author
Owner

@magnumripper commented on GitHub (Aug 18, 2017):

They seem to work (having only AVX, I ran "john" but it ended up running "john-sse4.1") but you should add an AVX version inbetween. So AVX2 -> AVX -> SSE4.1. The performance drop from AVX to SSE4.1 is significant:

Benchmarking: NT [MD4 128/128 SSE4.1 4x4]... DONE
Raw:	37543K c/s real, 37543K c/s virtual

Benchmarking: NT [MD4 128/128 AVX 4x3]... DONE
Raw:	48555K c/s real, 48075K c/s virtual
<!-- gh-comment-id:323305782 --> @magnumripper commented on GitHub (Aug 18, 2017): They seem to work (having only AVX, I ran "john" but it ended up running "john-sse4.1") but you should add an AVX version inbetween. So AVX2 -> AVX -> SSE4.1. The performance drop from AVX to SSE4.1 is significant: ``` Benchmarking: NT [MD4 128/128 SSE4.1 4x4]... DONE Raw: 37543K c/s real, 37543K c/s virtual Benchmarking: NT [MD4 128/128 AVX 4x3]... DONE Raw: 48555K c/s real, 48075K c/s virtual ```
Author
Owner

@kholia commented on GitHub (Aug 18, 2017):

I will add the AVX binary right away. Thanks for testing this stuff 👍

<!-- gh-comment-id:323306393 --> @kholia commented on GitHub (Aug 18, 2017): I will add the AVX binary right away. Thanks for testing this stuff 👍
Author
Owner

@magnumripper commented on GitHub (Aug 18, 2017):

The performance drop from AVX to SSE4.1 is significant

On the other hand this may be compiler differences as well. I see your build was made with clang 8.1.0, my build (the AVX version above) used gcc 7.1.0

<!-- gh-comment-id:323306492 --> @magnumripper commented on GitHub (Aug 18, 2017): > The performance drop from AVX to SSE4.1 is significant On the other hand this may be compiler differences as well. I see your build was made with clang 8.1.0, my build (the AVX version above) used gcc 7.1.0
Author
Owner

@kholia commented on GitHub (Aug 18, 2017):

The only problem with generating multiple builds is the increase in the Travis CI building + testing time that will be required. I don't have the numbers right now but let's hope that the situation is bearable.

<!-- gh-comment-id:323307884 --> @kholia commented on GitHub (Aug 18, 2017): The only problem with generating multiple builds is the increase in the Travis CI building + testing time that will be required. I don't have the numbers right now but let's hope that the situation is bearable.
Author
Owner

@kholia commented on GitHub (Aug 18, 2017):

@magnumripper macOS build with AVX2->AVX->SSE4.1 fallback is ready for testing at the following URL,

https://github.com/kholia/JohnTheRipper/releases.

Use the build associated with macOS-7 tag.

<!-- gh-comment-id:323323950 --> @kholia commented on GitHub (Aug 18, 2017): @magnumripper macOS build with AVX2->AVX->SSE4.1 fallback is ready for testing at the following URL, https://github.com/kholia/JohnTheRipper/releases. Use the build associated with `macOS-7` tag.
Author
Owner

@magnumripper commented on GitHub (Aug 18, 2017):

Works like a champ here:

$ CPUID_DISABLE=1 JtR-macOS/run/john -test -form:nt
Illegal instruction: 4

The above is expected (we override the CPU test)

With normal invocation, it falls back to AVX:

$ JtR-macOS/run/john -test -form:nt
Benchmarking: NT [MD4 128/128 AVX 4x4]... DONE
Raw:	39328K c/s real, 39328K c/s virtual

The difference between a clang build and gcc is huge, but that's another story.

<!-- gh-comment-id:323375029 --> @magnumripper commented on GitHub (Aug 18, 2017): Works like a champ here: ``` $ CPUID_DISABLE=1 JtR-macOS/run/john -test -form:nt Illegal instruction: 4 ``` The above is expected (we override the CPU test) With normal invocation, it falls back to AVX: ``` $ JtR-macOS/run/john -test -form:nt Benchmarking: NT [MD4 128/128 AVX 4x4]... DONE Raw: 39328K c/s real, 39328K c/s virtual ``` The difference between a clang build and gcc is huge, but that's another story.
Author
Owner

@kholia commented on GitHub (Aug 18, 2017):

Great!

I can help in setting this up for the official repository.

One catch is that the publication of a build requires a tag to be associated to the corresponding commit. E.g. Commit 5bc79e5 has tag macOS-7 associated with it in my repository.

<!-- gh-comment-id:323376512 --> @kholia commented on GitHub (Aug 18, 2017): Great! I can help in setting this up for the official repository. One catch is that the publication of a build requires a `tag` to be associated to the corresponding commit. E.g. Commit 5bc79e5 has tag `macOS-7` associated with it in my repository.
Author
Owner

@solardiz commented on GitHub (Aug 18, 2017):

The difference between a clang build and gcc is huge, but that's another story.

Note also that you had 4x3 with gcc and Dhiru gets 4x4 with clang. Maybe we need to re-tune this for current clang. Maybe 4x3 will be optimal for it as well, just like it is(?) for gcc.

<!-- gh-comment-id:323377649 --> @solardiz commented on GitHub (Aug 18, 2017): > The difference between a clang build and gcc is huge, but that's another story. Note also that you had 4x3 with gcc and Dhiru gets 4x4 with clang. Maybe we need to re-tune this for current clang. Maybe 4x3 will be optimal for it as well, just like it is(?) for gcc.
Author
Owner

@magnumripper commented on GitHub (Aug 18, 2017):

One catch is that the publication of a build requires a tag to be associated to the corresponding commit. E.g. Commit 5bc79e5 has tag macOS-7 associated with it in my repository.

Perhaps "macOS-20170818" is better? "macOS-7" sound like an OS version.

Just for the record I am and always was a bit weary about binary releases, especially automated ones. I don't want to be "associated" with them in any way. Someone could take "release" as some kind of quality measure, for a starter.

<!-- gh-comment-id:323380567 --> @magnumripper commented on GitHub (Aug 18, 2017): > One catch is that the publication of a build requires a tag to be associated to the corresponding commit. E.g. Commit 5bc79e5 has tag macOS-7 associated with it in my repository. Perhaps "macOS-20170818" is better? "macOS-7" sound like an OS version. Just for the record I am and always was a bit weary about binary releases, especially automated ones. I don't want to be "associated" with them in any way. Someone could take "release" as some kind of quality measure, for a starter.
Author
Owner

@kholia commented on GitHub (Aug 18, 2017):

Yes, macOS-20170818 is a lot better than macOS-7. I will start using this naming scheme.

I understand your concerns about binary builds. It would not be great if we start getting newbie level support questions around binary builds on GitHub.

<!-- gh-comment-id:323381977 --> @kholia commented on GitHub (Aug 18, 2017): Yes, `macOS-20170818` is a lot better than `macOS-7`. I will start using this naming scheme. I understand your concerns about binary builds. It would not be great if we start getting newbie level support questions around binary builds on GitHub.
Author
Owner

@solardiz commented on GitHub (Aug 18, 2017):

Someone could take "release" as some kind of quality measure

We should call these things "snapshots" or "builds" for that reason.

Yes, macOS-20170818 is a lot better than macOS-7. I will start using this naming scheme.

How about macosx-20170818, consistent with our (legacy) make target names.

<!-- gh-comment-id:323385083 --> @solardiz commented on GitHub (Aug 18, 2017): > Someone could take "release" as some kind of quality measure We should call these things "snapshots" or "builds" for that reason. > Yes, macOS-20170818 is a lot better than macOS-7. I will start using this naming scheme. How about `macosx-20170818`, consistent with our (legacy) make target names.
Author
Owner

@kholia commented on GitHub (Aug 18, 2017):

These builds are for macOS (the new OS name) and not for OS X. So using the macOS base word seems more appropriate to me. Something like macOS-20170818-snapshot should work I think.

<!-- gh-comment-id:323386609 --> @kholia commented on GitHub (Aug 18, 2017): These builds are for macOS (the new OS name) and not for OS X. So using the `macOS` base word seems more appropriate to me. Something like `macOS-20170818-snapshot` should work I think.
Author
Owner

@magnumripper commented on GitHub (Aug 18, 2017):

"snapshot" is good. I guess it will still be listed under "releases" on GitHub, but with "snapshot" in the name we're kinda home free.

<!-- gh-comment-id:323392820 --> @magnumripper commented on GitHub (Aug 18, 2017): "snapshot" is good. I guess it will still be listed under "releases" on GitHub, but with "snapshot" in the name we're kinda home free.
Author
Owner

@kholia commented on GitHub (Aug 19, 2017):

One problem which I just noticed is that the build distribution size is not optimal.

All the binaries (e.g. zip2john, racf2john) which use the symlink-to-john trick aren't handled well by the zip command, which leads to increased size of the compressed build archive.

$ du -hs racf2john bitlocker2john 
6.5M	racf2john
16K	bitlocker2john

Notice the large size difference in the above output.

I tried using tar + xz compression but it is too slow. The .tar.xz output archive is also a bit hard to use on macOS. The tar + bz2 compression doesn't compress well.

I am experimenting with removing the symlink-to-john trick for some binaries to see the impact on the final compressed archive size.

Update:

After removing the symlink-to-john trick for racf2john,

$ du -hs ../run/racf2john 
32K	../run/racf2john
<!-- gh-comment-id:323514603 --> @kholia commented on GitHub (Aug 19, 2017): One problem which I just noticed is that the build distribution size is not optimal. All the binaries (e.g. zip2john, racf2john) which use the symlink-to-john trick aren't handled well by the zip command, which leads to increased size of the compressed build archive. ``` $ du -hs racf2john bitlocker2john 6.5M racf2john 16K bitlocker2john ``` Notice the large size difference in the above output. I tried using tar + xz compression but it is too slow. The `.tar.xz` output archive is also a bit hard to use on macOS. The tar + bz2 compression doesn't compress well. I am experimenting with removing the symlink-to-john trick for some binaries to see the impact on the final compressed archive size. Update: After removing the symlink-to-john trick for racf2john, ``` $ du -hs ../run/racf2john 32K ../run/racf2john ```
Author
Owner

@solardiz commented on GitHub (Aug 19, 2017):

All the binaries (e.g. zip2john, racf2john) which use the symlink-to-john trick aren't handled well by the zip command

Maybe you need this option to zip:

       -y     Store  symbolic  links  as  such  in the zip archive, instead of compressing and storing the file
              referred to by the link (UNIX only).
<!-- gh-comment-id:323516178 --> @solardiz commented on GitHub (Aug 19, 2017): > All the binaries (e.g. zip2john, racf2john) which use the symlink-to-john trick aren't handled well by the zip command Maybe you need this option to `zip`: ``` -y Store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link (UNIX only). ```
Author
Owner

@kholia commented on GitHub (Aug 19, 2017):

Thank you! By using this -y zip option the output size went from 60.6 MB to 36.5 MB.

I am wondering if there is still room for more reduction in the output size.

<!-- gh-comment-id:323519877 --> @kholia commented on GitHub (Aug 19, 2017): Thank you! By using this `-y` zip option the output size went from 60.6 MB to 36.5 MB. I am wondering if there is still room for more reduction in the output size.
Author
Owner

@kholia commented on GitHub (Aug 19, 2017):

Using 7-Zip further reduces the output archive size to 15 MB, and that too in a reasonable amount of time!

We already require macOS users to run brew install openssl gmp. Maybe they can be requested to run brew install p7zip as well, to extract such output 7z archives?

<!-- gh-comment-id:323520494 --> @kholia commented on GitHub (Aug 19, 2017): Using 7-Zip further reduces the output archive size to 15 MB, and that too in a reasonable amount of time! We already require macOS users to run `brew install openssl gmp`. Maybe they can be requested to run `brew install p7zip` as well, to extract such output `7z` archives?
Author
Owner

@solardiz commented on GitHub (Aug 19, 2017):

Maybe they can be requested to run brew install p7zip as well to extract such output 7z archives?

I guess so, but doesn't xz compress just as well? Is xz available on macOS by default?

<!-- gh-comment-id:323520720 --> @solardiz commented on GitHub (Aug 19, 2017): > Maybe they can be requested to run brew install p7zip as well to extract such output 7z archives? I guess so, but doesn't `xz` compress just as well? Is `xz` available on macOS by default?
Author
Owner

@kholia commented on GitHub (Aug 19, 2017):

I believe that macOS has xz available by default. I will double check. The tar + xz combination takes more time, and doesn't compress as well as 7-Zip.

$ time 7z a JtR.7z X  # X has the contents of the build
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
...
Archive size: 15511664 bytes (15 MiB)
Everything is Ok

real	0m19.625s
user	0m28.826s
sys	0m0.322s

$ time tar -cJf JtR.tar.xz X

real	0m30.973s
user	0m30.709s
sys	0m0.233s

$ du -hs JtR.tar.xz 
27M	JtR.tar.xz
<!-- gh-comment-id:323521633 --> @kholia commented on GitHub (Aug 19, 2017): I believe that macOS has `xz` available by default. I will double check. The `tar + xz` combination takes more time, and doesn't compress as well as 7-Zip. ``` $ time 7z a JtR.7z X # X has the contents of the build 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 ... Archive size: 15511664 bytes (15 MiB) Everything is Ok real 0m19.625s user 0m28.826s sys 0m0.322s $ time tar -cJf JtR.tar.xz X real 0m30.973s user 0m30.709s sys 0m0.233s $ du -hs JtR.tar.xz 27M JtR.tar.xz ```
Author
Owner

@solardiz commented on GitHub (Aug 19, 2017):

The tar + xz combination takes more time, and doesn't compress as well as 7-Zip.

I think you can fix that (and maybe even improve upon 7-Zip's result) by sorting the file list such that similar files are closer together in tar's output stream. For example, here's what I used to repackage Nmap source tarball for Owl:

tar cJf %SOURCE0 --owner=root --group=root `find %srcname ! -type d | sort -i -t / -k 3 | sort -i -t . -k 3`

The -k 3 would probably be wrong and need to be adjusted.

I think 7-Zip performs something similar internally.

<!-- gh-comment-id:323524563 --> @solardiz commented on GitHub (Aug 19, 2017): > The tar + xz combination takes more time, and doesn't compress as well as 7-Zip. I think you can fix that (and maybe even improve upon 7-Zip's result) by sorting the file list such that similar files are closer together in tar's output stream. For example, here's what I used to repackage Nmap source tarball for Owl: tar cJf %SOURCE0 --owner=root --group=root `find %srcname ! -type d | sort -i -t / -k 3 | sort -i -t . -k 3` The `-k 3` would probably be wrong and need to be adjusted. I think 7-Zip performs something similar internally.
Author
Owner

@kholia commented on GitHub (Aug 21, 2017):

Using this trick (with -k 3 / -k 4) reduced the archive size from 27M to 23M. 7-Zip still leads with a size of 15M.

Update: macOS builds in .7z format are now available.

<!-- gh-comment-id:323708957 --> @kholia commented on GitHub (Aug 21, 2017): Using this trick (with `-k 3` / `-k 4`) reduced the archive size from 27M to 23M. 7-Zip still leads with a size of 15M. Update: macOS builds in `.7z` format are now available.
Author
Owner

@magnumripper commented on GitHub (Aug 21, 2017):

Maybe you want to make strip as well (if you don't already) before archiving, that should do quite some difference.

<!-- gh-comment-id:323824165 --> @magnumripper commented on GitHub (Aug 21, 2017): Maybe you want to `make strip` as well (if you don't already) before archiving, that should do quite some difference.
Author
Owner

@magnumripper commented on GitHub (Aug 21, 2017):

BTW you obviously don't have to strip in a separate step - just change eg. make -sj4 to make -sj4 strip.

<!-- gh-comment-id:323826397 --> @magnumripper commented on GitHub (Aug 21, 2017): BTW you obviously don't have to strip in a separate step - just change eg. `make -sj4` to `make -sj4 strip`.
Author
Owner

@kholia commented on GitHub (Aug 22, 2017):

I think that using strip on the binaries would break generation of nice backtraces (from gdb / lldb) in case of crashes.

<!-- gh-comment-id:323911928 --> @kholia commented on GitHub (Aug 22, 2017): I think that using `strip` on the binaries would break generation of nice backtraces (from gdb / lldb) in case of crashes.
Author
Owner

@magnumripper commented on GitHub (Aug 22, 2017):

Sure but most people needing a precompiled binary don't know squat about how to use a debugger anyway. I'm curious how much smaller it'd make the archive. Perhaps not that much?

<!-- gh-comment-id:323937822 --> @magnumripper commented on GitHub (Aug 22, 2017): Sure but most people needing a precompiled binary don't know squat about how to use a debugger anyway. I'm curious how much smaller it'd make the archive. Perhaps not that much?
Author
Owner

@kholia commented on GitHub (Aug 22, 2017):

Hmm, fair point. I am giving strip a try right now.

<!-- gh-comment-id:323938101 --> @kholia commented on GitHub (Aug 22, 2017): Hmm, fair point. I am giving `strip` a try right now.
Author
Owner

@kholia commented on GitHub (Aug 22, 2017):

Enabling strip reduced the output archive size from 14.8M to 14.4M. I was expecting way more.

As usual, https://github.com/kholia/JohnTheRipper/releases has the builds.

Update: Overall, I am happy with the current build size. I can now shift my focus on generating equivalent MinGW builds for Windows users.

<!-- gh-comment-id:323944189 --> @kholia commented on GitHub (Aug 22, 2017): Enabling `strip` reduced the output archive size from 14.8M to 14.4M. I was expecting way more. As usual, https://github.com/kholia/JohnTheRipper/releases has the builds. Update: Overall, I am happy with the current build size. I can now shift my focus on generating equivalent MinGW builds for Windows users.
Author
Owner

@magnumripper commented on GitHub (Aug 22, 2017):

Wow, I guess debug info packs real well. In that case I agree it's better not stripping.

<!-- gh-comment-id:323945490 --> @magnumripper commented on GitHub (Aug 22, 2017): Wow, I guess debug info packs real well. In that case I agree it's better not stripping.
Author
Owner

@kholia commented on GitHub (Sep 1, 2017):

I got AVX and AVX2 working on my virtual Mac.

$ uname -a
Darwin mac 16.7.0 Darwin Kernel Version 16.7.0...

$ sysctl -a | grep leaf7
machdep.cpu.leaf7_features: SMEP BMI1 AVX2 BMI2
machdep.cpu.leaf7_feature_bits: 424

$ ../run/john --test --format=descrypt
Benchmarking: descrypt, traditional crypt(3) [DES 128/128 AVX-16]... DONE
Many salts:	5077K c/s real, 5077K c/s virtual
Only one salt:	4893K c/s real, 4893K c/s virtual

$ CPUID_DISABLE=1 ../run/john --test --format=descrypt  # disable CPU features detection
Benchmarking: descrypt, traditional crypt(3) [DES 256/256 AVX2-16]... DONE
Many salts:	9424K c/s real, 9424K c/s virtual
Only one salt:	8893K c/s real, 8893K c/s virtual

However, I have to disable the CPU_detect function to make use of AVX2 extensions.

It seems that we may need to tweak our CPU_detect function a bit for macOS. Or maybe I need to expose MOVBE + FMA3 CPU extensions to the macOS guest?

<!-- gh-comment-id:326570048 --> @kholia commented on GitHub (Sep 1, 2017): I got AVX and AVX2 working on my virtual Mac. ``` $ uname -a Darwin mac 16.7.0 Darwin Kernel Version 16.7.0... $ sysctl -a | grep leaf7 machdep.cpu.leaf7_features: SMEP BMI1 AVX2 BMI2 machdep.cpu.leaf7_feature_bits: 424 $ ../run/john --test --format=descrypt Benchmarking: descrypt, traditional crypt(3) [DES 128/128 AVX-16]... DONE Many salts: 5077K c/s real, 5077K c/s virtual Only one salt: 4893K c/s real, 4893K c/s virtual $ CPUID_DISABLE=1 ../run/john --test --format=descrypt # disable CPU features detection Benchmarking: descrypt, traditional crypt(3) [DES 256/256 AVX2-16]... DONE Many salts: 9424K c/s real, 9424K c/s virtual Only one salt: 8893K c/s real, 8893K c/s virtual ``` However, I have to disable the `CPU_detect` function to make use of `AVX2` extensions. It seems that we may need to tweak our `CPU_detect` function a bit for macOS. Or maybe I need to expose `MOVBE + FMA3` CPU extensions to the macOS guest?
Author
Owner

@kholia commented on GitHub (Sep 2, 2017):

From x86-64.S,

#define CF_AVX                  $0x1C000000 /* AVX + XSAVE + OSXSAVE */
#define CF_AVX2                 $0x1C401000 /* the above + MOVBE + FMA3 */

From commit f9338ccaee, "The AVX2 check is very quick and dirty, not using leaf 7 nor extended flags but it should be sufficient for a starter".

Somehow the AVX2 detection is failing on my virtual Mac. It seems that neither my host CPU (i7-6600U) nor the guest CPU supports the FMA3 extension. On host, AVX2 detection works fine but on the guest VM I have to use the CPUID_DISABLE=1 hack to use AVX2.

@magnumripper Do you have any tips on this topic? Thanks!

<!-- gh-comment-id:326725724 --> @kholia commented on GitHub (Sep 2, 2017): From x86-64.S, ``` #define CF_AVX $0x1C000000 /* AVX + XSAVE + OSXSAVE */ #define CF_AVX2 $0x1C401000 /* the above + MOVBE + FMA3 */ ``` From commit f9338ccaeec94949a2e7f4a7cb54da9a1919750d, "The AVX2 check is very quick and dirty, not using leaf 7 nor extended flags but it should be sufficient for a starter". Somehow the AVX2 detection is failing on my virtual Mac. It seems that neither my host CPU (i7-6600U) nor the guest CPU supports the `FMA3` extension. On host, AVX2 detection works fine but on the guest VM I have to use the `CPUID_DISABLE=1` hack to use AVX2. @magnumripper Do you have any tips on this topic? Thanks!
Author
Owner

@kholia commented on GitHub (Sep 2, 2017):

https://github.com/tycho/cpuid generated dumps from host and guest,

<!-- gh-comment-id:326726653 --> @kholia commented on GitHub (Sep 2, 2017): https://github.com/tycho/cpuid generated dumps from host and guest, * [cpuid-host.txt](https://github.com/magnumripper/JohnTheRipper/files/1271962/cpuid-host.txt) * [cpuid-host-raw.txt](https://github.com/magnumripper/JohnTheRipper/files/1271963/cpuid-host-raw.txt) * [cpuid-macOS.txt](https://github.com/magnumripper/JohnTheRipper/files/1271964/cpuid-macOS.txt) * [cpuid-macOS-raw.txt](https://github.com/magnumripper/JohnTheRipper/files/1271965/cpuid-macOS-raw.txt)
Author
Owner

@magnumripper commented on GitHub (Sep 2, 2017):

Somehow the AVX2 detection is failing on my virtual Mac

We've seen problems with virtual machines before and AFAIK it's a problem with them, not with JtR. Having said that, I'd welcome a patch that works around the problems without introducing other problems.

<!-- gh-comment-id:326731000 --> @magnumripper commented on GitHub (Sep 2, 2017): > Somehow the AVX2 detection is failing on my virtual Mac We've seen problems with virtual machines before and AFAIK it's a problem with them, not with JtR. Having said that, I'd welcome a patch that works around the problems without introducing other problems.
Author
Owner

@magnumripper commented on GitHub (Sep 2, 2017):

#1986 #2089 #2384

<!-- gh-comment-id:326732069 --> @magnumripper commented on GitHub (Sep 2, 2017): #1986 #2089 #2384
Author
Owner

@kholia commented on GitHub (Sep 2, 2017):

Thanks for the references 👍

It is a minor problem (an inconvenience rather) which I can workaround by CPUID_DISABLE=1 hack. I will stop worrying about it now :-)

<!-- gh-comment-id:326732253 --> @kholia commented on GitHub (Sep 2, 2017): Thanks for the references 👍 It is a minor problem (an inconvenience rather) which I can workaround by `CPUID_DISABLE=1` hack. I will stop worrying about it now :-)
Author
Owner

@solardiz commented on GitHub (Sep 2, 2017):

We've seen problems with virtual machines before and AFAIK it's a problem with them, not with JtR.

In general yes, but in this case per Dhiru's comments above we actually know our check for AVX2 is wrong - it doesn't check for AVX2, but rather checks for MOVBE and FMA3, neither of which we use. We should have a separate issue for fixing this (implement proper AVX2 detection).

<!-- gh-comment-id:326740705 --> @solardiz commented on GitHub (Sep 2, 2017): > We've seen problems with virtual machines before and AFAIK it's a problem with them, not with JtR. In general yes, but in this case per Dhiru's comments above we actually know our check for AVX2 is wrong - it doesn't check for AVX2, but rather checks for MOVBE and FMA3, neither of which we use. We should have a separate issue for fixing this (implement proper AVX2 detection).
Author
Owner

@magnumripper commented on GitHub (Sep 2, 2017):

it doesn't check for AVX2, but rather checks for MOVBE and FMA3, neither of which we use

True. I've had that in mind for a while, I'll create a proper issue for it.

<!-- gh-comment-id:326749582 --> @magnumripper commented on GitHub (Sep 2, 2017): > it doesn't check for AVX2, but rather checks for MOVBE and FMA3, neither of which we use True. I've had that in mind for a while, I'll create a proper issue for it.
Author
Owner

@magnumripper commented on GitHub (Sep 8, 2017):

Like I said in #2716, everything is exactly as it should be (at least for 64-bit).

It seems that neither my host CPU (i7-6600U) nor the guest CPU supports the FMA3 extension

That CPU does have FMA3.

<!-- gh-comment-id:328171902 --> @magnumripper commented on GitHub (Sep 8, 2017): Like I said in #2716, everything is exactly as it should be (at least for 64-bit). > It seems that neither my host CPU (i7-6600U) nor the guest CPU supports the FMA3 extension That CPU does have FMA3.
Author
Owner

@ghost commented on GitHub (Dec 15, 2018):

Bug closed as:

  • Low Priority - They have a tendency to become high priority if enough of the users complain.

  • Business Priority - Obsolete hardware and software. Hardware nobody owns, etc.

  • WontFix - Covers all the reasons we chose to close the bug without taking action.

    • Nobody cares.
    • Can't reproduce, working as intended, obsolete.
    • Required information was not provided.
<!-- gh-comment-id:447587949 --> @ghost commented on GitHub (Dec 15, 2018): Bug closed as: * **Low Priority** - They have a tendency to become high priority if enough of the users complain. * **Business Priority** - Obsolete hardware and software. Hardware nobody owns, etc. * **WontFix** - Covers all the reasons we chose to close the bug without taking action. * Nobody cares. * Can't reproduce, working as intended, obsolete. * Required information was not provided.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1729
No description provided.