Mailing List Archive

libgcrypt and patches
Hello,

some months ago I sent patches (multiple times) to the current libgcrypt
CVS code to fix a series of memory holes. Since this time I neither had
any response nor did the CVS code of libgcrypt change a bit since then.

Is there still libgcrypt development?

Is there any sense in resending the patches?

Who is currently responsible for the software?

Ciao
--
____ _ _ ____ _ _ _ _ ____
| | | | | | \ / | | | the cool Gremlin from Bischofswerda
| __ | ____| | \/ | | | WWW: http://www.dstoecker.de/
| | | | | | | | PGP key available on www page.
|____| _|_ |____| _|_ _|_ |____| I hope AMIGA never stops making fun!
Re: libgcrypt and patches [ In reply to ]
On Thu, 25 Aug 2005 14:35:37 +0200 (CEST), Dirk Stoecker said:

> some months ago I sent patches (multiple times) to the current libgcrypt
> CVS code to fix a series of memory holes. Since this time I neither had
> any response nor did the CVS code of libgcrypt change a bit since then.

Libgcrypt is under subversion, maybe you used the the old CVS rep.
The latest changes are a few days old.

> Is there any sense in resending the patches?

I recall a mail which tried to solve some one time allocations - we
want apply such a fix.


Salam-Shalom,

Werner
Re: libgcrypt and patches [ In reply to ]
Werner Koch <wk@gnupg.org> writes:

> On Thu, 25 Aug 2005 14:35:37 +0200 (CEST), Dirk Stoecker said:
>
>> some months ago I sent patches (multiple times) to the current libgcrypt
>> CVS code to fix a series of memory holes. Since this time I neither had
>> any response nor did the CVS code of libgcrypt change a bit since then.
>
> Libgcrypt is under subversion, maybe you used the the old CVS rep.
> The latest changes are a few days old.

Is there some information on how to access libgcrypt in subversion
anywhere? I read the announcement that gnupg changed to subversion,
but not for other packages. www.gnupg.org still point at CVS,
although viewcvs on cvs.gnupg.org seem to have stopped working.

One guessed location failed here:

jas@latte:~/src$ svn co svn://cvs.gnupg.org/libgcrypt/trunk libgcrypt
svn: /var/lib/svn/libgcrypt/conf/svnserve.conf:12: Section header expected

Thanks,
Simon
Re: libgcrypt and patches [ In reply to ]
* Simon Josefsson (jas@extundo.com) wrote:
> Werner Koch <wk@gnupg.org> writes:
> > On Thu, 25 Aug 2005 14:35:37 +0200 (CEST), Dirk Stoecker said:
> > Libgcrypt is under subversion, maybe you used the the old CVS rep.
> > The latest changes are a few days old.
>
> Is there some information on how to access libgcrypt in subversion
> anywhere? I read the announcement that gnupg changed to subversion,
> but not for other packages. www.gnupg.org still point at CVS,
> although viewcvs on cvs.gnupg.org seem to have stopped working.
>
> One guessed location failed here:
>
> jas@latte:~/src$ svn co svn://cvs.gnupg.org/libgcrypt/trunk libgcrypt
> svn: /var/lib/svn/libgcrypt/conf/svnserve.conf:12: Section header expected

Same here ;) It'd be cool to have a link to the svn repo somewhere.

--
Michele
Re: libgcrypt and patches [CLEANUP_PATCH] [ In reply to ]
Hello,

> > Is there any sense in resending the patches?
>
> I recall a mail which tried to solve some one time allocations - we
> want apply such a fix.

Ok, I try it again. Attached is a minor patch against current svn, which
uses GCRYCTL_FINALIZE to get a cleanup of the whole library. When this is
used, all the loaded memory is freed in a way which (hopefully) brings
the system to initial state. It should be possible to reuse the library
afterwards as if it has never been used (except for possible bugs). I use
this for 3-4 months now and never had any problems.

I did not modify the examples, althought this would be a good idea. All
the examples should run in valgrind without reporting any unfreed memory!

Ciao
--
____ _ _ ____ _ _ _ _ ____
| | | | | | \ / | | | the cool Gremlin from Bischofswerda
| __ | ____| | \/ | | | WWW: http://www.dstoecker.de/
| | | | | | | | PGP key available on www page.
|____| _|_ |____| _|_ _|_ |____| I hope AMIGA never stops making fun!
Re: libgcrypt and patches [CLEANUP_PATCH] [ In reply to ]
On Mon, 5 Sep 2005 11:13:55 +0200 (CEST), Dirk Stoecker said:

> Ok, I try it again. Attached is a minor patch against current svn, which
> uses GCRYCTL_FINALIZE to get a cleanup of the whole library. When this is
> used, all the loaded memory is freed in a way which (hopefully) brings
> the system to initial state. It should be possible to reuse the library

I still fail to see the need for it. Why do you want to remove a non
simple DSO out of your process (which is actually not possible on most
systems) once it has been loaded?


Shalom-Salam,

Werner
Re: libgcrypt and patches [CLEANUP_PATCH] [ In reply to ]
On Mon, 5 Sep 2005, Werner Koch wrote:

> On Mon, 5 Sep 2005 11:13:55 +0200 (CEST), Dirk Stoecker said:
>
> > Ok, I try it again. Attached is a minor patch against current svn, which
> > uses GCRYCTL_FINALIZE to get a cleanup of the whole library. When this is
> > used, all the loaded memory is freed in a way which (hopefully) brings
> > the system to initial state. It should be possible to reuse the library
>
> I still fail to see the need for it. Why do you want to remove a non
> simple DSO out of your process (which is actually not possible on most
> systems) once it has been loaded?

No. I don't want to remove it. I want to free it's allocated resources.
libgcrypt dynamically allocates resources. The software I need this for
has really heavy memory usage including lots of allocations, ...

The points are:

1) Debugging tools to track memory loss cannot and will not distinguish
between memory loss on purpose and memory loss due to programming
errors.

2) I want the memory back. I have enough other memory troubles. I do not
need to waste memory, which is only used once in the application.

3) Libraries of whatever kind should be able to free every resource they
request. It is no good style to forget such stuff.

4) Libgcrypt already has the appropriate command for it, only it is not
used yet.

5) It's really straightforward and easy. It does not change the interface.
It only enhances it. If you do not call
gcry_control(GCRYCTL_FINALIZE, 0);
nothing changes. If you call it you get the memory back, but can
nevertheless start to use all the functions again.

So finally: There is nothing speaking against it, but some points for it.

Quoting a mail from July, 1th:

>> 1. The problem is that when FN_gcry_pk_genkey is
>> reached program is stopped, I get the following
>> message: Detected memory leaks! and my library is
>> deployed.
>
> I suppose this due to one-time allocation done by libgcrypt. There is
> currently no way of getting rid of these one-time allocations.

Well, now there would be a way to do so.

> Dynamically removing libgcrypt from the process is not supported.

I don't care for that. Only for the memory. But probably this gets a
possibility afterwards as well, who knows?

Ciao
--
____ _ _ ____ _ _ _ _ ____
| | | | | | \ / | | | the cool Gremlin from Bischofswerda
| __ | ____| | \/ | | | WWW: http://www.dstoecker.de/
| | | | | | | | PGP key available on www page.
|____| _|_ |____| _|_ _|_ |____| I hope AMIGA never stops making fun!