On Wed, Sep 25, 2002, Adrian Petru DIMULESCU wrote: > Hello, > > I've just installed openssl-0.9.6g on a sparc Solaris 2.5.1 > Compiler: gcc version 2.95.3 20010315 (release) > > The problem is that I keep getting a segmentation fault when calling > BIO_new_mem_buf. > > > Here's a truss of my program when it crashes: > > Incurred fault #6, FLTBOUNDS %pc = 0x0044B630 > siginfo: SIGSEGV SEGV_MAPERR addr=0x0044B630 > Received signal #11, SIGSEGV [default] > siginfo: SIGSEGV SEGV_MAPERR addr=0x0044B630 > *** process killed *** > > And here's what gdb says: > > (gdb) where > #0 0x44b630 in ?? () > #1 0xef52429c in CRYPTO_malloc () > #2 0xef55ee10 in BIO_new () > #3 0xef560110 in BIO_new_mem_buf () > #4 0xef791b60 in CryptOpenSSL_read_public_RSA_from_mem ( > clePublique=0x255f0 "-----BEGIN PUBLIC > KEY-----\nMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDptYTOdOuFa0tPCLL3qWZ1Aymv\n > f9GL18CYD2x6n9i7C7juCVueYutFkRYLt5uqzuejpT2BibaxlNgN/9KcMC+odQvv\nlfFMRy6yDC > qaFiw6Xzb+qABTNQ/L3nWvLYjO1Fu1Ml/"...) > at KercashCrypt-openssl.c:239 > #5 0xef79128c in Crypt_RSAEncryptString ( > clePublique=0x255f0 "-----BEGIN PUBLIC > KEY-----\nMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDptYTOdOuFa0tPCLL3qWZ1Aymv\n > f9GL18CYD2x6n9i7C7juCVueYutFkRYLt5uqzuejpT2BibaxlNgN/9KcMC+odQvv\nlfFMRy6yDC > qaFiw6Xzb+qABTNQ/L3nWvLYjO1Fu1Ml/"..., > message=0x24608 "00&12") at KercashCrypt.c:68 > #6 0xef7735e8 in KertelMP_Send (Con=0x244c8, c=0x24608 "00&12", > bAvecCryptage=1) at KercashApi.c:963 > #7 0xef773884 in KertelMP_SendCommande (Con=0x244c8, cmd=0x25ac0) at > KercashApi.c:1023 > #8 0xef7744e0 in KertelMP_Connect (sSiteId=0xeffffd6f "12", Con=0x220c8, > pRet=0x220c4) at KercashApi.c:1399 > #9 0x109c4 in main (argc=5, argv=0xeffffc6c) at kmpclient.c:85 > > > ... and here's the source which generates this: > > > /** > * Read a public RSA structure from memory. > * clePublique should be a null-terminated string. > */ > RSA* CryptOpenSSL_read_public_RSA_from_mem(const char* clePublique) { > BIO* bio = NULL; > EVP_PKEY* pKey = NULL; > RSA* rsa = NULL; > > bio = BIO_new_mem_buf(clePublique, -1); > > pKey = PEM_read_bio_PUBKEY (bio, NULL, NULL, NULL); > rsa = EVP_PKEY_get1_RSA(pKey); > EVP_PKEY_free(pKey); > > BIO_free(bio); > return rsa; > } > > > Should you have any idea, I'd be more than happy to hear it. >
It looks like OpenSSL hasn't been compiled with the full debugging symbols so the debugger isn't saying exactly on which line the crash occurred. However the information present looks very odd, as though its crashing during memory allocation. This shouldn't normally happen unless something has left memory in a very distressed state. Steve. -- Dr. Stephen Henson [EMAIL PROTECTED] OpenSSL Project http://www.openssl.org/~steve/ ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]