Re: Error while encryption or Decrypting
Dear brad Thanks for the advice and the hint I have been through the free commands to check where the error occured In APPS folder in enc.c file whenever I comment this line(640) if (benc != NULL) BIO_free(benc); the dump core disappear I am working in check what does this line mean and what is benc regards On 7/29/07, Brad Hards [EMAIL PROTECTED] wrote: On Saturday 28 July 2007 01:49, Pink Princess wrote: *** glibc detected *** /home/noura/workspace/256OpenSSL/apps/openssl: double free or corruption (!prev): 0x0820d170 *** This is the most likely problem - you are free()ing memory that has already been free()d. Maybe you are free()ing memory that openssl is cleaning up later. Try running under valgrind or a debugger. Brad
RE: Error while encryption or Decrypting
That line means if benc still points at something, free it. The problem is - more likely than not, somebody has already freed benc, but did not set benc to zero (or NULL). As a result, this check (line 640) says benc is not zero, so it must be pointing at something that must be freed, so invoke the free(). Trace the use of benc and make sure whoever freed it before line 640, also set it to zero. Better way of freeing in the context would be: if (benc != NULL) { if (BIO_free(benc) == 0) abort_with_error(Cannot free benc!); benc = 0; } where abort_with_error() is your own function. _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pink Princess Sent: Monday, July 30, 2007 06:50 To: Brad Hards Cc: openssl-users@openssl.org Subject: Re: Error while encryption or Decrypting Dear brad Thanks for the advice and the hint I have been through the free commands to check where the error occured In APPS folder in enc.c file whenever I comment this line(640) if (benc != NULL) BIO_free(benc); the dump core disappear I am working in check what does this line mean and what is benc regards On 7/29/07, Brad Hards [EMAIL PROTECTED] wrote: On Saturday 28 July 2007 01:49, Pink Princess wrote: *** glibc detected *** /home/noura/workspace/256OpenSSL/apps/openssl: double free or corruption (!prev): 0x0820d170 *** This is the most likely problem - you are free()ing memory that has already been free()d. Maybe you are free()ing memory that openssl is cleaning up later. Try running under valgrind or a debugger. Brad
Re: Error while encryption or Decrypting
On Saturday 28 July 2007 01:49, Pink Princess wrote: *** glibc detected *** /home/noura/workspace/256OpenSSL/apps/openssl: double free or corruption (!prev): 0x0820d170 *** This is the most likely problem - you are free()ing memory that has already been free()d. Maybe you are free()ing memory that openssl is cleaning up later. Try running under valgrind or a debugger. Brad pgpZ5SnA8TwGO.pgp Description: PGP signature
Re: Error while encryption or Decrypting
Pink Princess wrote: Dear all; I wish this time I will find an answer from any one I implemented my own cipher in OpenSSL . The implementation works fine with encryption and decryption but it always give me dump core error Can any one help me ! what might cause the problem ? OpenSSL enc -cs-256-ecb -in /home/noura/workspace/test.txt -out /home/noura/workspace/Ctest.txt -k 123456789 I am in 256: I am in [setup256] I am in [cs_encrypt256] *** glibc detected *** /home/noura/workspace/256OpenSSL/apps/openssl: double free or corruption (!prev): 0x0820d170 *** === Backtrace: = /lib/tls/i686/cmov/libc.so.6[0xb7eec8bd] /lib/tls/i686/cmov/libc.so.6(__libc_free+0x84)[0xb7eeca44] /home/noura/workspace/256OpenSSL/apps/openssl[0x80b0d07] === Memory map: 08048000-081e7000 r-xp 08:05 982299 /home/noura/workspace/256OpenSSL/apps/openssl 081e7000-081f9000 rwxp 0019e000 08:05 982299 /home/noura/workspace/256OpenSSL/apps/openssl 081f9000-0821f000 rwxp 081f9000 00:00 0 [heap] b7d0-b7d21000 rwxp b7d0 00:00 0 b7d21000-b7e0 ---p b7d21000 00:00 0 b7e84000-b7e86000 rwxp b7e84000 00:00 0 b7e86000-b7fb3000 r-xp 08:05 360009 /lib/tls/i686/cmov/libc-2.4.so http://2.4.so b7fb3000-b7fb5000 r-xp 0012c000 08:05 360009 /lib/tls/i686/cmov/libc- 2.4.so http://2.4.so b7fb5000-b7fb7000 rwxp 0012e000 08:05 360009 /lib/tls/i686/cmov/libc-2.4.so http://2.4.so b7fb7000-b7fba000 rwxp b7fb7000 00:00 0 b7fba000-b7fbc000 r-xp 08:05 360012 /lib/tls/i686/cmov/libdl- 2.4.so http://2.4.so b7fbc000-b7fbe000 rwxp 1000 08:05 360012 /lib/tls/i686/cmov/libdl-2.4.so http://2.4.so b7fc2000-b7fcc000 r-xp 08:05 327107 /lib/libgcc_s.so.1 b7fcc000-b7fcd000 rwxp 9000 08:05 327107 /lib/libgcc_s.so.1 b7fcd000-b7fd1000 rwxp b7fcd000 00:00 0 b7fd1000-b7fea000 r-xp 08:05 327044 /lib/ld-2.4.so http://2.4.so b7fea000-b7fec000 rwxp 00018000 08:05 327044 /lib/ld- 2.4.so http://2.4.so bf969000-bf97e000 rwxp bf969000 00:00 0 [stack] e000-f000 ---p 00:00 0 [vdso] sorry princess , just have a good summer . we all on break. __ OpenSSL Project http://www.openssl.org User Support Mailing Listopenssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]