[gnutls-devel] GnuTLS 3.2.15 SIGSEGV in _gnutls_buffer_append_data

Nikos Mavrogiannopoulos nmav at gnutls.org
Tue Dec 16 15:33:25 CET 2014


On Tue, 2014-12-16 at 15:48 +0200, Jaak Ristioja wrote:
> On 16.12.2014 14:11, Nikos Mavrogiannopoulos wrote:
> > That looks like a memory corruption. For these types of errors valgrind
> > may given more reliable information than gdb. Could you have a run with
> > valgrind?
> Unfortunately my minimal test case requires too much memory, Valgrind's
> memory manager is unable to allocate this much and exits with a verbose
> OOM message.

-faddress=sanitize is an alternative way to debug memory corruptions.
However, I tried your test case with 3.3.11 and there hasn't been any
issue. Have you tried the latest gnutls versions?

> > The idea is to have a buffer where data can be appended easily and
> quickly.
> The code seems to contain a lot of complicated logic for something which
> should be rather simple. I don't understand why all the memmove logic is
> needed when appending to the buffer.

The buffer has the ability for quite consumption of its data (see
buffer_pop_datum), but when appending to a buffer you most probably want
to re-use any space that was consumed by buffer_pop_datum(). Said that,
if you think there can be optimizations please suggest them.

regards,
Nikos





More information about the Gnutls-devel mailing list