Opened 5 years ago

Last modified 5 years ago

#17 new defect

memory leak on standard requests

Reported by: https://id.mayfirst.org/dkg Owned by: https://id.mayfirst.org/dkg
Priority: major Component: code
Version: 5.10 Keywords: needs-test leak valgrind
Cc:

Description

imported from mantis, dkg wrote:

Hardy Griech reported what used to be bug 2 here about a recurrent memory leak, which appears to still be a problem:

The code below makes it possible to reproduce the memory leak directly:

while printf "GET / HTTP/1.1\nHost: %s\n\n" "$(hostname -f)" | gnutls-cli 127.0.1.1 --insecure; do : ; done

This is using packages from debian testing.

Change History (3)

comment:1 Changed 5 years ago by https://id.mayfirst.org/dkg

on 2013-03-04 d4sh2007 wrote:

I can not reproduce this bug.

I am using the following shell script to execute requests

#!/bin/bash

while printf "GET / HTTP/1.1\nHost: %s\n\n" "$(hostname -f)" | gnutls-cli dash.za.net; ps aux |grep httpd|awk '{ SUM += $5} END { print SUM/1024/1024 }'; do : ; done

The sum of the Virtual-Memory-Size of all of apache's httpd processes does not appear to increase.

Can anyone clarify this?

comment:2 Changed 5 years ago by https://id.mayfirst.org/dkg

benbe wrote:

Maybe have a look at it with valgrind. Make sure to install the *-dbg packages so you have debugging symbols available (the output is MUCH nicer then ;-))

Haven't tested this.

comment:3 Changed 5 years ago by https://id.mayfirst.org/dkg

d4sh2007 wrote:

Here's some notes that hopefully will shed some light on resolving this issue.


  • http://linux.die.net/man/3/gnutls_global_init

    Note! This function is not thread safe. If two threads call this function simultaneously, they can cause a race between checking the global counter and incrementing it, causing both threads to execute the library initialization code. That would lead to a memory leak. To handle this, your application could invoke this function after aquiring a thread mutex. To ignore the potential memory leak is also an option.

Note: See TracTickets for help on using tickets.