Hi,

FWIW, I want to share with you my findings with using CryptoPP on
Lion. I have not found a bug report similar to my findings.

I have built CryptoPP trunk (revision 532) with gcc 4.2.1 on Lion,
arch x86_64. I noticed that by building integer.cpp (only) with "-g -
O0" the test hangs with the following output:

...
Testing SymmetricCipher algorithm SEED/ECB.
....
Tests complete. Total tests = 4. Failed tests = 0.

BlumBlumShub validation suite running...

and it hangs here. The stack trace is:


$ gdb cryptest.exe
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug  8 20:32:45
UTC 2011)
...
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
shared libraries ... done

(gdb) r v
...

BlumBlumShub validation suite running...

^C
Program received signal SIGINT, Interrupt.
0x000000010017dfed in CryptoPP::Baseline_Sub (N=16, C=0x100e04a10,
A=0x100e04a10, B=0x100e04ac0) at integer.cpp:817
817                     SubtractWithBorrow(u, A[i], B[i]);
(gdb) bt
#0  0x000000010017dfed in CryptoPP::Baseline_Sub (N=16, C=0x100e04a10,
A=0x100e04a10, B=0x100e04ac0) at integer.cpp:817
#1  0x00000001001a3ceb in CryptoPP::Subtract (C=0x100e04a10,
A=0x100e04a10, B=0x100e04ac0, N=16) at integer.cpp:2033
#2  0x0000000100197337 in CorrectQuotientEstimate (R=0x100e04a10,
T=0x100e04b40, Q=0x100e04990, B=0x100e04ac0, N=16) at integer.cpp:2548
#3  0x0000000100197993 in CryptoPP::Divide (R=0x100e048c0,
Q=0x100e04940, T=0x100e049c0, A=0x100e04640, NA=32, B=0x100e04540,
NB=16) at integer.cpp:2607
#4  0x000000010019d582 in CryptoPP::PositiveDivide
(remainder=@0x7fff5fbfd3c0, quotient=@0x7fff5fbfd328,
a=@0x7fff5fbfd3e8, b=@0x7fff5fbfd4f8) at integer.cpp:3732
#5  0x000000010019d652 in CryptoPP::Integer::Divide
(remainder=@0x7fff5fbfd3c0, quotient=@0x7fff5fbfd328,
dividend=@0x7fff5fbfd3e8, divisor=@0x7fff5fbfd4f8) at integer.cpp:3737
#6  0x000000010019d8ba in CryptoPP::Integer::Modulo
(this=0x7fff5fbfd3e8, b=@0x7fff5fbfd4f8) at integer.cpp:3791
#7  0x00000001001eb435 in CryptoPP::ModularArithmetic::Square
(this=0x7fff5fbfd4e0, a=@0x7fff5fbfd3e8) at modarith.h:80
#8  0x00000001000f7a08 in
CryptoPP::PublicBlumBlumShub::PublicBlumBlumShub (this=0x7fff5fbfd4d0,
n=@0x7fff5fbfd580, seed=@0x7fff5fbfd620) at blumshub.cpp:12
#9  0x00000001000f83fb in CryptoPP::BlumBlumShub::BlumBlumShub
(this=0x7fff5fbfd4d0, p=@0x7fff5fbfd670, q=@0x7fff5fbfd648,
seed=@0x7fff5fbfd620) at blumshub.cpp:50
#10 0x000000010007e549 in ValidateBBS () at validat2.cpp:58
#11 0x0000000100051068 in ValidateAll () at validat1.cpp:99
#12 0x000000010003d4fe in Validate (alg=0, seedInput=0x7fff5fbfd4f8 "�
\005D", thorough=false) at test.cpp:775
#13 0x0000000100044560 in main (argc=0, argv=0x7fff5fbffaa0) at
test.cpp:309
(gdb)

This does not happen in optimized builds (-O2).

$ uname -a
Darwin nomad.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9
20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/src/
configure --disable-checking --enable-werror --prefix=/Developer/usr/
llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++
--program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/
$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-
llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/
Developer/usr/local --program-prefix=i686-apple-darwin11- --
host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-
include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build
2336.1.00)

The library was built with default options, except for integer.cpp (as
detailed above). Same results were obtained by building the whole
library and the test program with "-g -O0".

Is this a known issue?

Thanks,
Liviu

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to