<div dir="ltr">Hello Tomas,<div><br></div><div>Thanks Man.</div><div>It started working when compiled with your suggestions.</div><div><br></div><div>Could it be an issue with openssl or with the compile ?</div><div><br></div><div>Thanks,</div><div>Minal</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 2, 2022 at 2:32 PM Tomas Mraz <<a href="mailto:tomas@openssl.org">tomas@openssl.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This is crashing inside the getentropy call in glibc or the weak symbol<br>
binding does not work correctly for some reason.<br>
<br>
I'd suggest changing the line 359 of<br>
providers/implementations/rands/seeding/rand_unix.c<br>
from:<br>
#  if !defined(__DragonFly__) && !defined(__NetBSD__)<br>
to:<br>
#  if 0<br>
<br>
That might help.<br>
<br>
Regards,<br>
Tomas Mraz<br>
<br>
On Thu, 2022-06-02 at 12:49 +0530, Minal Patil wrote:<br>
> here is the backtrace with debug.<br>
> Program received signal SIGILL, Illegal instruction.<br>
> 0x0000000010000004 in ?? ()<br>
> Missing separate debuginfos, use: dnf debuginfo-install libgcc-8.3.1-<br>
> 4.5.el8.ppc64le libstdc++-8.3.1-4.5.el8.ppc64le<br>
> (gdb) bt<br>
> #0  0x0000000010000004 in ?? ()<br>
> #1  0x000000001006da60 in syscall_random (buf=0x104a3350, buflen=48)<br>
>     at providers/implementations/rands/seeding/rand_unix.c:364<br>
> #2  0x000000001006e3b4 in ossl_pool_acquire_entropy (pool=0x104a3300)<br>
>     at providers/implementations/rands/seeding/rand_unix.c:646<br>
> #3  0x0000000010252ca0 in seed_src_generate (vseed=0x10446e90,<br>
> out=0x104a32c0 "", outlen=48, strength=0,<br>
>     prediction_resistance=0, adin=0x7fffffffe340 "PoD\020",<br>
> adin_len=8) at providers/implementations/rands/seed_src.c:114<br>
> #4  0x0000000010253124 in seed_get_seed (vseed=0x10446e90,<br>
> pout=0x7fffffffe410, entropy=256, min_len=48,<br>
>     max_len=4294967294, prediction_resistance=0, adin=0x7fffffffe340<br>
> "PoD\020", adin_len=8)<br>
>     at providers/implementations/rands/seed_src.c:204<br>
> #5  0x000000001032a764 in get_entropy (drbg=0x10446f50,<br>
> pout=0x7fffffffe410, entropy=384, min_len=48, max_len=4294967294,<br>
>     prediction_resistance=0) at<br>
> providers/implementations/rands/drbg.c:241<br>
> #6  0x000000001032b140 in ossl_prov_drbg_instantiate<br>
> (drbg=0x10446f50, strength=0, prediction_resistance=0,<br>
>     pers=0x10397a88 <ossl_pers_string> "OpenSSL NIST SP 800-90A<br>
> DRBG", perslen=29)<br>
>     at providers/implementations/rands/drbg.c:451<br>
> #7  0x000000001024eab8 in drbg_ctr_instantiate_wrapper<br>
> (vdrbg=0x10446f50, strength=0, prediction_resistance=0, pstr=0x0,<br>
>     pstr_len=0, params=0x7fffffffe620) at<br>
> providers/implementations/rands/drbg_ctr.c:337<br>
> #8  0x0000000010127aa0 in evp_rand_instantiate_locked<br>
> (ctx=0x1042da90, strength=0, prediction_resistance=0, pstr=0x0,<br>
>     pstr_len=0, params=0x7fffffffe620) at crypto/evp/evp_rand.c:505<br>
> #9  0x0000000010127b50 in EVP_RAND_instantiate (ctx=0x1042da90,<br>
> strength=0, prediction_resistance=0, pstr=0x0,<br>
>     pstr_len=0, params=0x7fffffffe620) at crypto/evp/evp_rand.c:518<br>
> #10 0x000000001003a988 in rand_new_drbg (libctx=0x0,<br>
> parent=0x1042da60, reseed_interval=256, reseed_time_interval=3600)<br>
>     at crypto/rand/rand_lib.c:595<br>
> #11 0x000000001003ab58 in RAND_get0_primary (ctx=0x0) at<br>
> crypto/rand/rand_lib.c:642<br>
> #12 0x000000001003add4 in RAND_get0_private (ctx=0x0) at<br>
> crypto/rand/rand_lib.c:706<br>
> #13 0x0000000010039cd4 in RAND_priv_bytes_ex (ctx=0x0, buf=0x10421f40<br>
> "", num=64, strength=0)<br>
>     at crypto/rand/rand_lib.c:333<br>
> #14 0x00000000100a7824 in bnrand (flag=PRIVATE, rnd=0x10420e70,<br>
> bits=512, top=1, bottom=1, strength=0, ctx=0x10420b90)<br>
>     at crypto/bn/bn_rand.c:51<br>
> #15 0x00000000100a7db4 in BN_priv_rand_ex (rnd=0x10420e70, bits=512,<br>
> top=1, bottom=1, strength=0, ctx=0x10420b90)<br>
>     at crypto/bn/bn_rand.c:122<br>
> #16 0x00000000100a6ae4 in probable_prime (rnd=0x10420e70, bits=512,<br>
> safe=0, mods=0x10420f30, ctx=0x10420b90)<br>
> --Type <RET> for more, q to quit, c to continue without paging--<br>
>     at crypto/bn/bn_prime.c:486<br>
> #17 0x00000000100a5c3c in BN_generate_prime_ex2 (ret=0x10420e70,<br>
> bits=512, safe=0, add=0x0, rem=0x0, cb=0x0,<br>
>     ctx=0x10420b90) at crypto/bn/bn_prime.c:160<br>
> #18 0x000000001003dce8 in rsa_multiprime_keygen (rsa=0x10411eb0,<br>
> bits=1024, primes=2, e_value=0x10411e70, cb=0x0)<br>
>     at crypto/rsa/rsa_gen.c:191<br>
> #19 0x000000001003e71c in rsa_keygen (libctx=0x0, rsa=0x10411eb0,<br>
> bits=1024, primes=2, e_value=0x10411e70, cb=0x0,<br>
>     pairwise_test=0) at crypto/rsa/rsa_gen.c:437<br>
> #20 0x000000001003d598 in RSA_generate_multi_prime_key<br>
> (rsa=0x10411eb0, bits=1024, primes=2, e_value=0x10411e70, cb=0x0)<br>
>     at crypto/rsa/rsa_gen.c:71<br>
> #21 0x000000001003d434 in RSA_generate_key_ex (rsa=0x10411eb0,<br>
> bits=1024, e_value=0x10411e70, cb=0x0)<br>
>     at crypto/rsa/rsa_gen.c:46<br>
> #22 0x0000000010003ae8 in generate_key (keysize=1024,<br>
> pub_key=0x7fffffffef48, pri_key=0x7fffffffef50) at generatekey.c:25<br>
> #23 0x0000000010003da8 in main () at generatekey.c:74<br>
> <br>
> On Thu, Jun 2, 2022 at 12:06 PM Tomas Mraz <<a href="mailto:tomas@openssl.org" target="_blank">tomas@openssl.org</a>> wrote:<br>
> > Can you please try to build the openssl with debug information (-d<br>
> > on<br>
> > Configure command line)? To see whether the backtrace will contain<br>
> > more<br>
> > information.<br>
> > <br>
> > Tomas Mraz<br>
> > <br>
> > On Thu, 2022-06-02 at 11:09 +0530, Minal Patil wrote:<br>
> > > Hello All,<br>
> > > <br>
> > > I am trying to use RSA_generate_key_ex function to generate the<br>
> > > RSA<br>
> > > key pairs on RHEL 7.2 PPCle. I am observing crash when i link the<br>
> > > source code with Openssl 3.0 whereas same works if i link with<br>
> > > Openssl 1.0.2<br>
> > > <br>
> > > Below is configure command used for compiling openssl<br>
> > > ./Configure no-shared threads --<br>
> > > prefix=/home/testuser/OpenSSL/Build<br>
> > -<br>
> > > -openssldir=/home/testuser/OpenSSL/Build --libdir=lib linux-<br>
> > > ppc64le<br>
> > -<br>
> > > Wa,--noexecstack<br>
> > > <br>
> > > I am attaching the source code I am using for reference. <br>
> > > Below is stack trace observed <br>
> > > <br>
> > > Program received signal SIGILL, Illegal instruction.<br>
> > > #0  0x0000000010000004 in ?? ()<br>
> > > #1  0x000000001005afdc in ossl_pool_acquire_entropy ()<br>
> > > #2  0x00000000101fed14 in seed_get_seed ()<br>
> > > #3  0x00000000102be844 in get_entropy ()<br>
> > > #4  0x00000000102bee8c in ossl_prov_drbg_instantiate ()<br>
> > > #5  0x00000000101f9b2c in drbg_ctr_instantiate_wrapper ()<br>
> > > #6  0x00000000100ff2e0 in EVP_RAND_instantiate ()<br>
> > > #7  0x0000000010031c18 in rand_new_drbg ()<br>
> > > #8  0x0000000010032bd0 in RAND_get0_primary ()<br>
> > > #9  0x00000000100333f8 in RAND_get0_private ()<br>
> > > #10 0x0000000010033558 in RAND_priv_bytes_ex ()<br>
> > > #11 0x00000000100926cc in BN_priv_rand_ex ()<br>
> > > #12 0x0000000010090b78 in BN_generate_prime_ex2 ()<br>
> > > #13 0x0000000010035a90 in RSA_generate_multi_prime_key ()<br>
> > > #14 0x00000000100361b4 in RSA_generate_key_ex ()<br>
> > > #15 0x00000000100048b8 in generate_key (keysize=1024,<br>
> > > pub_key=0x7fffffffef38, pri_key=0x7fffffffef40) at<br>
> > > generatekey.c:25<br>
> > > #16 0x0000000010004b78 in main () at generatekey.c:74<br>
> > > <br>
> > > I am compiling both 1.0.2j and 3.0 with same configure command<br>
> > > and<br>
> > on<br>
> > > the same machine(i.e. RHEL 7).  <br>
> > > <br>
> > > Any suggestion or pointer would be highly helpful.<br>
> > <br>
> > -- <br>
> > Tomáš Mráz, OpenSSL<br>
> > <br>
> > <br>
> <br>
> <br>
<br>
-- <br>
Tomáš Mráz, OpenSSL<br>
<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Thanks & Regards, <br>MINAL PATIL<br>Mail :<a href="mailto:minu.patil@gmail.com" target="_blank">minu.patil@gmail.com</a></div></div></div>