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

Crash in DL_GroupParameters_IntegerBased::GetEncodedElementSize for Cygwin i386 at -O3 #40

Closed
noloader opened this issue Oct 10, 2015 · 1 comment
Assignees
Labels
Bug Enhancement gcc-4 GCC compiler version 4
Milestone

Comments

@noloader
Copy link
Collaborator

Here are the symptoms:

$ make
g++ -DNDEBUG -g2 -O3 -march=native -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS -pipe -c cryptlib.cpp
g++ -DNDEBUG -g2 -O3 -march=native -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS -pipe -c shacal2.cpp
...

$ ./cryptest.exe v
...

MQV validation suite running...

passed    authenticated key agreement domain parameters validation
...

$ gdb ./cryptest.exe
...
Program received signal SIGSEGV, Segmentation fault.
CryptoPP::DL_GroupParameters_IntegerBased::GetEncodedElementSize (this=0x11,
    reversible=0x1) at gfpcrypt.h:65
65        {CRYPTOPP_UNUSED(reversible); return GetModulus().ByteCount();}
(gdb)

Here is the platform and compiler version:

$ g++ --version
g++ (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
CYGWIN_NT-6.1-WOW windows-7-x64 2.2.1(0.289/5/3) 2015-08-20 11:40 i686 Cygwin

The issue is present with -DCRYPTOPP_DISABLE_ASM.

Despite best efforts, its still unclear why this pointer is 0x11.

@noloader
Copy link
Collaborator Author

The work around was to move the definition for DL_GroupParameters_IntegerBased::GetEncodedElementSize out-of-line. That is, move the implementation to the CPP file.

Its unclear why this worked...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Enhancement gcc-4 GCC compiler version 4
Projects
None yet
Development

No branches or pull requests

1 participant