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

ssh_decode_sequence_multi & compiler error #460

Closed
karel-m opened this issue Oct 26, 2018 · 12 comments
Closed

ssh_decode_sequence_multi & compiler error #460

karel-m opened this issue Oct 26, 2018 · 12 comments

Comments

@karel-m
Copy link
Member

karel-m commented Oct 26, 2018

I have got this report:

cc ... -c ltc/misc/ssh/ssh_decode_sequence_multi.c -o ltc/misc/ssh/ssh_decode_sequence_multi.o
{standard input}: Assembler messages:
{standard input}:100: Error: Incorrect register `%rbx' used with `l' suffix
{standard input}:101: Error: Incorrect register `%rbx' used with `l' suffix
*** [ltc/misc/ssh/ssh_decode_sequence_multi.o] Error code 1

It is probably: gcc 4.2.1 20070831 patched [FreeBSD]

Full report http://www.cpantesters.org/cpan/report/341fe940-d829-11e8-9067-b381f67cb40a

And ... I have absolutely no idea what's going on.

Cc: @rmw42

@rmw42
Copy link
Contributor

rmw42 commented Oct 26, 2018

Well, since we don't have any assembly language in there, that's gotta be a compiler bug...

@sjaeckel
Copy link
Member

Could it be related to the invocation of LOAD {32,64}H() while dereferencing a pointer?

That's the only part of the code which pulls in assembly

@rmw42
Copy link
Contributor

rmw42 commented Oct 26, 2018

Ah, hadn't seen that... it's nothing like the error, though:

#define LOAD64H(x, y)          \
asm __volatile__ (             \
   "movq (%1),%0\n\t"          \
   "bswapq %0\n\t"             \
   :"=r"(x): "r"(y): "memory");

@rmw42
Copy link
Contributor

rmw42 commented Oct 26, 2018

It also successfully compiled ciphers/camellia.c, encauth/gcm/gcm_gf_mult.c and hashes/sha2/sha512.c, which all use LOAD64H(), so I can't see it being the inline asm for that macro...

@rmw42
Copy link
Contributor

rmw42 commented Oct 26, 2018

I guess the only way we'll get to the bottom of this is if someone can find a FreeBSD box with that compiler on it. Replacing -o ltc/misc/ssh/ssh_decode_sequence_multi.o with -S -o ssh_decode_sequence_multi.s in the CC command will get the asm it was generating, and the issue is around line 100...

@sjaeckel
Copy link
Member

I know that'd be only a temporary solution, but do you even provide an API in Perl for those ssh functions?
If not, couldn't you simply disable their compilation?

@karel-m
Copy link
Member Author

karel-m commented Oct 27, 2018

Cc @eserte

Hi Slaven, we are discussing here a compiler error from your cpantester report related to my perl module CryptX. The error is basically a failure to compile one file from libtomcrypt library - see http://www.cpantesters.org/cpan/report/341fe940-d829-11e8-9067-b381f67cb40a

Is the compiler and/or the platform of this cpantester machine somehow unusual/special? Does the same cpantester machine complain/fail in a similar way with other libraries/modules?

@karel-m
Copy link
Member Author

karel-m commented Oct 27, 2018

couldn't you simply disable their compilation?

The irony is that we hit here the reverse of #449 which can be called: "ecc_sign_hash_ex + ecc_verify_hash_ex forces linking SSH decode/encode code" 😄

So maybe after #450 or something like that I can simply exclude ssh_(en|de)code_sequence_multi.c

@eserte
Copy link

eserte commented Oct 27, 2018

I checked on another (real, non-VM) freebsd9 machine, and the same compiler error happens here, too.
What works on both machines is to use the installed gcc 4.8 compiler:

perl Makefile.PL CC=gcc48

And I never saw this kind of error while compiling other stuff.

@karel-m
Copy link
Member Author

karel-m commented Oct 29, 2018

Further investigation revealed that the trouble making line is:

LOAD32H(size, in);

plus the fact that size is unsigned long but should be ulong32.

So it is fixable, not a compiler bug.

@karel-m
Copy link
Member Author

karel-m commented Oct 29, 2018

@eserte may I ask you for a quick check whether CryptX-0.061_003 doesn't fail anymore?

http://cpan.metacpan.org/authors/id/M/MI/MIK/CryptX-0.061_003.tar.gz

@karel-m
Copy link
Member Author

karel-m commented Oct 30, 2018

@karel-m karel-m closed this as completed Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants