mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1526] New legacy build errors for dynamic #996
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#996
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frank-dittrich on GitHub (Jul 9, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1526
Originally assigned to: @frank-dittrich on GitHub.
I'll look into this, but don't have time for it right now.
@jfoug commented on GitHub (Jul 9, 2015):
I get an entire different failure for legacy linux-x86-64-native target:
This was after doing a 'make distclean' to make sure there were no straggler stuff from a ./configure run
@frank-dittrich commented on GitHub (Jul 9, 2015):
@jfoug I did test after
make distcleanas well.No idea why you get errors for md4.c.
I retried
d6daf0band get the same result, even if I try make generic.Do you have any local changes?
@frank-dittrich commented on GitHub (Jul 9, 2015):
I forgot to mention: after the
I do have md4.o and md5.o.
This is an AVX system, will retry on an AVX2 system later.
@frank-dittrich commented on GitHub (Jul 9, 2015):
Funny:
make -s -f Makefile.legacy linux-x86-64-clangsucceeds.I just get a few warnings.
@frank-dittrich commented on GitHub (Jul 9, 2015):
On a 64bit AVX2 system (older gcc version etc.),
make -s -f Makefile.legacy linux-x86-64-nativesucceeds, amake -s -f Makefile.legacy linux-x86-64fails when linking the john binary (undefined reference to fmt_stribog_256 / fmt_stribog_512).@frank-dittrich commented on GitHub (Jul 9, 2015):
Seems to depend on gcc version.
On super,
make -s -f Makefile.legacy linux-x86-64-nativesucceeds for the default build environment as well as after each of these:On my AVX2 system and on my AVX laptop, both Fedora 22 with gcc 5.1.1, I get the same build errors.
etc., while
make -s -f Makefile.legacy linux-x86-64-clangsucceeds.So, may be I'm seeing gcc bugs?
@jfoug what gcc version and what OS were you using for the
make -f Makefile.legacytest?@frank-dittrich commented on GitHub (Jul 9, 2015):
On well and bull,
make -f Makefile.legacy linux-x86-64-nativesucceeds as well.@magnumripper commented on GitHub (Jul 9, 2015):
It's a known problem: We access members of private structs in crypto libs, depending on them not to be renamed, or be named differently by some other version/vendor.
It's more or less impossible get it safe - unless we just stop ever using OpenSSL for code we do have in our tree. Why don't we?
@frank-dittrich commented on GitHub (Jul 9, 2015):
@magnumripper and how does autoconf manage to avoid these problems?
@magnumripper commented on GitHub (Jul 9, 2015):
Everybody gets them, but how big are they? Even when defined out, you may get a file of several hundred bytes, depending on OS and circumstances.
@magnumripper commented on GitHub (Jul 9, 2015):
It's more of "happen to" than "manage to". It's likely about
-Ipaths used, or order of them.@frank-dittrich commented on GitHub (Jul 9, 2015):
Yes! This will fix the probem I get on my systems:
I wonder why gcc only complains about the old version in legacy builds, not in autoconf builds.
@frank-dittrich commented on GitHub (Jul 9, 2015):
I'll re-test legacy without the above patch, but with -std=gnu89 added to CFLAGS.
@frank-dittrich commented on GitHub (Jul 9, 2015):
Yes, adding
-std=gnu89to the Makefile.legacy CFLAGS fixes my build errors as well.But if the
dynamic_compiler.cchange posted above fixes my build error even without adding-std=gnu89option to CFLAGS, may be we should commit that as well?@jfoug does adding
-std=gnu89to the CFLAGS fix your legacy build problems?@jfoug commented on GitHub (Jul 9, 2015):
-std=gnu89 makes no difference. Like magnum stated, it has something to do with paths and such. Since I really do not care about makefile.legacy, I am not spending any time on this.
I have found the gcc CPP to be problematic. if there are ways I can make these macros a bit nicer to more compilers, I will. NOTE, I have yet to build on my sparc. I expect to have some changes there also. Surprisingly, VC's macro processor seems more robust than gcc. It was able to handle things like re-interpretation of values which the macro concatenated items. But unfortunately, there does seem to be some nuanced differences between compilers when it comes to the pre-processor, when you get to some of the more obscure usages like pasting strings or concatenation stuff.
builds on
@magnumripper commented on GitHub (Jul 9, 2015):
We have other code that needs -std=gnu89 but I think you should commit those changes to dynamic_compiler.c as well. Do I see right and there's just whitespace changes? Likely other preprocessors will need that as well.
@frank-dittrich commented on GitHub (Jul 9, 2015):
Yes, this is just a whitespace change. And, being paranoid, I'll compare sha1sum of the object file before and after that change.
@jfoug commented on GitHub (Jul 9, 2015):
This did not need 'fixed' also ??? does not make sense
I would expect these to fail in same way
@jfoug commented on GitHub (Jul 9, 2015):
Likely this was the ones the preprocessor could not properly handle
@frank-dittrich commented on GitHub (Jul 9, 2015):
@jfoug even if it doesn't make sense, nevertheless it did help.
May be not all of the whitespace changes were needed.
I can try to reduce my change to the bare minimum that makes it work even without -std=gnu89.
@jfoug commented on GitHub (Jul 9, 2015):
Try changing just this (note the lines are 'trimmed'
It may be the C compiler that can not handle it.
What is output is this: (Let's say T is MD5)
"MD5""_raw("
where your change is: "MD5" "_raw("
I would think the compiler should handle that just fine, but I could be wrong.
@jfoug commented on GitHub (Jul 9, 2015):
I will just space pad all string pasting usage in my code.
@frank-dittrich commented on GitHub (Jul 9, 2015):
@jfoug this is the minimal change that makes legacy build succeed without -std=gnu89:
@jfoug commented on GitHub (Jul 9, 2015):
Ok, some shortcoming of the CPP. I will put spacing everywhere I use string pasting, just to be safe.
@jfoug commented on GitHub (Jul 10, 2015):
Is this issue 'fixed' ? I still can not compile on my base install Fedora VM with legacy (64 bit -native target), but I am almost certain it is due to include/lib paths not getting setup properly for oSSL. It is not an issue whatsoever on that system (or any others I can get my hands on) with a autoconf build, so for me, I really do not care.
But this bug still stands open.
@frank-dittrich commented on GitHub (Jul 10, 2015):
@jfoug For me it is fixed now.
That's why I don't even want to add --std=gnu89 to legacy CFLAGS, so that we can detect some more problems with different compilers.
Please leave it open, I want to find out whether I can reproduce and finally avoid the bug you got.
I never wanted you to spend much time on it, since I know you don't care much about legacy.
That's why I self-assigned this issue.
What Fedora version do you have in your VM?
@jfoug commented on GitHub (Jul 10, 2015):
[ghost@localhost src]$ uname -a
Linux localhost.localdomain 4.0.4-303.fc22.x86_64 #1 SMP Thu May 28 12:37:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[ghost@localhost src]$ gcc --version
gcc (GCC) 5.1.1 20150422 (Red Hat 5.1.1-1)
Running in VirtualBox VM
@frank-dittrich commented on GitHub (Jul 11, 2015):
@magnumripper @jfoug I am sure the
error was caused by not including
<openssl/md4.h>for legacy builds.So, commit
6313df9bd4should fix that.It adds -DHAVE_LIBSSL to Makefile.legacy CFLAGS.
@magnumripper commented on GitHub (Jul 12, 2015):
But it does show us a bug. You just hid it.
md4.h
md4.c
@jfoug introduced this bug in
abe2cdb5@magnumripper commented on GitHub (Jul 12, 2015):
So md4.h should be fixed,
s/block/Block/. But I really really need to get some sleep now.@jfoug commented on GitHub (Jul 12, 2015):
No, I am going to undo the block->Block in the .c file. The parts that are 'important' are the ABCD. I am not sure why the other was changed.