freeing of X509_CRL object

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

freeing of X509_CRL object

Raghavendra a
Hi All,

In my program,
converting X509_CRL object to string format using X509_CRL_print and BIO_get_mem_data.  after that if de-allocate  _x509crl  using X509_CRL_free.  it is crashing with below reason.

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

not sure if X509_CRL_print de-allocates some part of _x509crl ,  external freeing of X509_CRL again leading to double free?
Please help on this issue.


Regards,
Raghavendra




--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: freeing of X509_CRL object

OpenSSL - User mailing list

The print routine does not free anything.

 

From: Raghavendra a <[hidden email]>
Reply-To: openssl-users <[hidden email]>
Date: Friday, May 11, 2018 at 5:53 AM
To: openssl-users <[hidden email]>
Subject: [openssl-users] freeing of X509_CRL object

 

In my program,

converting X509_CRL object to string format using X509_CRL_print and BIO_get_mem_data.  after that if de-allocate  _x509crl  using X509_CRL_free.  it is crashing with below reason.

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

not sure if X509_CRL_print de-allocates some part of _x509crl ,  external freeing of X509_CRL again leading to double free?

Please help on this issue.

 

Regards,

Raghavendra

 

 

 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: freeing of X509_CRL object

Raghavendra a
Hi Rich,

Thanks for information.
Any idea, why is X509_CRL_free reporting below error with valgrind?


Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)



Regards,
Raghavendra
 

On Fri, May 11, 2018 at 3:40 PM, Salz, Rich via openssl-users <[hidden email]> wrote:

The print routine does not free anything.

 

From: Raghavendra a <[hidden email]>
Reply-To: openssl-users <[hidden email]>
Date: Friday, May 11, 2018 at 5:53 AM
To: openssl-users <[hidden email]>
Subject: [openssl-users] freeing of X509_CRL object

 

In my program,

converting X509_CRL object to string format using X509_CRL_print and BIO_get_mem_data.  after that if de-allocate  _x509crl  using X509_CRL_free.  it is crashing with below reason.

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

not sure if X509_CRL_print de-allocates some part of _x509crl ,  external freeing of X509_CRL again leading to double free?

Please help on this issue.

 

Regards,

Raghavendra

 

 

 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users



--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: freeing of X509_CRL object

OpenSSL - User mailing list

Something else is going wrong.  Is that the only valgrind error?   Are you sure you didn’t free the object in your code?

 

From: Raghavendra a <[hidden email]>
Date: Friday, May 11, 2018 at 6:22 AM
To: Rich Salz <[hidden email]>, openssl-users <[hidden email]>
Subject: Re: [openssl-users] freeing of X509_CRL object

 

Thanks for information.

Any idea, why is X509_CRL_free reporting below error with valgrind?

 

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

 

Regards,

Raghavendra

 

 

On Fri, May 11, 2018 at 3:40 PM, Salz, Rich via openssl-users <[hidden email]> wrote:

The print routine does not free anything.

 

From: Raghavendra a <[hidden email]>
Reply-To: openssl-users <
[hidden email]>
Date: Friday, May 11, 2018 at 5:53 AM
To: openssl-users <
[hidden email]>
Subject: [openssl-users] freeing of X509_CRL object

 

In my program,

converting X509_CRL object to string format using X509_CRL_print and BIO_get_mem_data.  after that if de-allocate  _x509crl  using X509_CRL_free.  it is crashing with below reason.

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

not sure if X509_CRL_print de-allocates some part of _x509crl ,  external freeing of X509_CRL again leading to double free?

Please help on this issue.

 

Regards,

Raghavendra

 

 

 


--
openssl-users mailing list
To unsubscribe:
https://mta.openssl.org/mailman/listinfo/openssl-users

 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: freeing of X509_CRL object

Raghavendra a
Hi,

Yes, I am freeing _x509crl  using X509_CRL_free  after using in X509_CRL_print.
Above valgrind error is for free operation, is it wrong?

Regards,
Raghavendra

On Fri, May 11, 2018 at 5:21 PM, Salz, Rich <[hidden email]> wrote:

Something else is going wrong.  Is that the only valgrind error?   Are you sure you didn’t free the object in your code?

 

From: Raghavendra a <[hidden email]>
Date: Friday, May 11, 2018 at 6:22 AM
To: Rich Salz <[hidden email]>, openssl-users <[hidden email]>
Subject: Re: [openssl-users] freeing of X509_CRL object

 

Thanks for information.

Any idea, why is X509_CRL_free reporting below error with valgrind?

 

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

 

Regards,

Raghavendra

 

 

On Fri, May 11, 2018 at 3:40 PM, Salz, Rich via openssl-users <[hidden email]> wrote:

The print routine does not free anything.

 

From: Raghavendra a <[hidden email]>
Reply-To: openssl-users <
[hidden email]>
Date: Friday, May 11, 2018 at 5:53 AM
To: openssl-users <
[hidden email]>
Subject: [openssl-users] freeing of X509_CRL object

 

In my program,

converting X509_CRL object to string format using X509_CRL_print and BIO_get_mem_data.  after that if de-allocate  _x509crl  using X509_CRL_free.  it is crashing with below reason.

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

not sure if X509_CRL_print de-allocates some part of _x509crl ,  external freeing of X509_CRL again leading to double free?

Please help on this issue.

 

Regards,

Raghavendra

 

 

 


--
openssl-users mailing list
To unsubscribe:
https://mta.openssl.org/mailman/listinfo/openssl-users

 



--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: freeing of X509_CRL object

OpenSSL - User mailing list

Based on the information you provided, I don’t have any other advice.  The print routine does not free the CRL. You must be free’ing it twice.  Perhaps run under a debugger with a breakpoint

 

From: Raghavendra a <[hidden email]>
Date: Tuesday, May 15, 2018 at 2:58 AM
To: Rich Salz <[hidden email]>
Cc: openssl-users <[hidden email]>
Subject: Re: [openssl-users] freeing of X509_CRL object

 

Hi,

Yes, I am freeing _x509crl  using X509_CRL_free  after using in X509_CRL_print.

Above valgrind error is for free operation, is it wrong?

Regards,

Raghavendra

 

On Fri, May 11, 2018 at 5:21 PM, Salz, Rich <[hidden email]> wrote:

Something else is going wrong.  Is that the only valgrind error?   Are you sure you didn’t free the object in your code?

 

From: Raghavendra a <[hidden email]>
Date: Friday, May 11, 2018 at 6:22 AM
To: Rich Salz <
[hidden email]>, openssl-users <[hidden email]>
Subject: Re: [openssl-users] freeing of X509_CRL object

 

Thanks for information.

Any idea, why is X509_CRL_free reporting below error with valgrind?

 

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

 

Regards,

Raghavendra

 

 

On Fri, May 11, 2018 at 3:40 PM, Salz, Rich via openssl-users <[hidden email]> wrote:

The print routine does not free anything.

 

From: Raghavendra a <[hidden email]>
Reply-To: openssl-users <
[hidden email]>
Date: Friday, May 11, 2018 at 5:53 AM
To: openssl-users <
[hidden email]>
Subject: [openssl-users] freeing of X509_CRL object

 

In my program,

converting X509_CRL object to string format using X509_CRL_print and BIO_get_mem_data.  after that if de-allocate  _x509crl  using X509_CRL_free.  it is crashing with below reason.

Valgrind output:
==31919== Invalid read of size 4
==31919==    at 0xB475EF2: CRYPTO_atomic_add (threads_pthread.c:155)
==31919==    by 0xB355537: asn1_do_lock (tasn_utl.c:79)
==31919==    by 0xB352767: asn1_item_embed_free (tasn_fre.c:88)
==31919==    by 0xB3528D4: ASN1_item_free (tasn_fre.c:20)

not sure if X509_CRL_print de-allocates some part of _x509crl ,  external freeing of X509_CRL again leading to double free?

Please help on this issue.

 

Regards,

Raghavendra

 

 

 


--
openssl-users mailing list
To unsubscribe:
https://mta.openssl.org/mailman/listinfo/openssl-users

 

 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users