Discussion:
[openssl.org #3556] Problem building openssl 1.0.1i in debug mode
Dmitry Belyavsky via RT
2014-10-04 15:26:56 UTC
Permalink
Hello openssl team,

I've got a problem building openssl

I used the commands

./Configure shared debug
make

and get an error

gcc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include -DBN_DEBUG
-DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM
-ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations
-Werror -c -o bn_ctx.o bn_ctx.c
bn_ctx.c: In function ‘ctxdbg’:
bn_ctx.c:161:29: error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
cc1: all warnings being treated as errors
make[2]: *** [bn_ctx.o] Ошибка 1
make[2]: Leaving directory
`/home/beldmit/hobby/crypto/openssl-1.0.1i/crypto/bn'
make[1]: *** [subdirs] Ошибка 1
make[1]: Leaving directory
`/home/beldmit/hobby/crypto/openssl-1.0.1i/crypto'
make: *** [build_crypto] Ошибка 1

system version is

***@manul$ uname -a
Linux manul 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux

gcc version is
***@manul$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --enable-plugin --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)

Thank you
--
SY, Dmitry Belyavsky

______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Salz, Rich
2014-10-05 01:58:14 UTC
Permalink
In crypto/bn/bn_ctx.c, line 161:
fprintf(stderr,"(%08x): ", (unsigned int)ctx);
change it to this
fprintf(stderr,"(%p): ", ctx);

and see if that fixes it.
--
Principal Security Engineer, Akamai Technologies
IM: ***@jabber.me Twitter: RichSalz


�zt�,����-��i��0Š^��%��z�����X������^��%u������Z+
Dmitry Belyavsky
2014-10-05 07:34:26 UTC
Permalink
Hello Rich,

Unfortunately no :-(
The error became

bn_ctx.c: In function ‘ctxdbg’:
bn_ctx.c:161:27: error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
bn_ctx.c:161:2: error: format ‘%p’ expects argument of type ‘void *’, but
argument 3 has type ‘unsigned int’ [-Werror=format]
cc1: all warnings being treated as errors
Post by Salz, Rich
fprintf(stderr,"(%08x): ", (unsigned int)ctx);
change it to this
fprintf(stderr,"(%p): ", ctx);
and see if that fixes it.
--
Principal Security Engineer, Akamai Technologies
--
SY, Dmitry Belyavsky
Salz, Rich
2014-10-05 12:08:22 UTC
Permalink
Did you take the (unsigned int) cast off?

Do sed –n –e 160,162p bn_ctx.
:��I"Ϯ��r�m���� (����Z+�7�zZ)���1���x ��h����W^��^��%��
Dmitry Belyavsky
2014-10-05 13:51:20 UTC
Permalink
Hello Rich,

Yes, removing the cast solves the problem.

***@manul$ sed -n -e 160,162p crypto/bn/bn_ctx.c
BN_STACK *stack = &ctx->stack;
fprintf(stderr,"(%p): ", ctx);
while(bnidx < ctx->used)


Thank you!
Post by Salz, Rich
Did you take the (unsigned int) cast off?
Do sed –n –e 160,162p bn_ctx.
--
SY, Dmitry Belyavsky
Andy Polyakov via RT
2014-10-23 13:34:17 UTC
Permalink
Post by Dmitry Belyavsky via RT
I used the commands
./Configure shared debug
^^^^^^^^^^^^^^^^^^^^^^^^ I don't think this would be working build on
a 64-bit platform such as one in question. Or rather even if it does
work (make test passes, etc.) it wouldn't be supported and questions
should be dismissed. "Official" way to make a debugging build is to pass
-d to ./config.


______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Dmitry Belyavsky
2014-10-23 13:39:19 UTC
Permalink
Hello Andy,
Post by Andy Polyakov via RT
Post by Dmitry Belyavsky via RT
I used the commands
./Configure shared debug
^^^^^^^^^^^^^^^^^^^^^^^^ I don't think this would be working build on
a 64-bit platform such as one in question. Or rather even if it does
work (make test passes, etc.) it wouldn't be supported and questions
should be dismissed. "Official" way to make a debugging build is to pass
-d to ./config.
Thank you for information!
--
SY, Dmitry Belyavsky
Dmitry Belyavsky via RT
2014-10-23 13:39:27 UTC
Permalink
Hello Andy,
Post by Andy Polyakov via RT
Post by Dmitry Belyavsky via RT
I used the commands
./Configure shared debug
^^^^^^^^^^^^^^^^^^^^^^^^ I don't think this would be working build on
a 64-bit platform such as one in question. Or rather even if it does
work (make test passes, etc.) it wouldn't be supported and questions
should be dismissed. "Official" way to make a debugging build is to pass
-d to ./config.
Thank you for information!
--
SY, Dmitry Belyavsky

______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Loading...