https server - memory leaks



I am running a decent HTTP server which fulfills just one specific task. I trimed (almost - setup stuff) all memory leaks so far, except for one.

Massif/Valgrind tell me that it is part of libgiognutls.so/libgnutls.so (g_memdup -> g_bytes_new). I had a very brief look at the code but could not spot anything suspicous in gtls{server,}connection.[ch] - but as said I only had a very brief look.

Also when I just do a few requests and set breakpoints on g_bytes_new and g_bytes_unref their count is equal, and g_memdup occurs by far too frequently to set breakpoints on.

I attached a screenshot of massif, showing the increased memory usage over time (and requests) altough the requests is pretty much just a nop.

The requests are currently issued via curl

curl -k -v -i -X PUT -d "bogus content" -u "foo:bar" --digest "https://127.0.0.1:1234/


// the soup server callback looks like this

static void
server_callback (SoupServer *server,
                 SoupMessage *msg,
                 const char *path,
                 GHashTable *query,
                 SoupClientContext *client,
                 gpointer user_data)
{

 echo_debug ("brute force memleak search...");
 soup_message_set_status (msg, SOUP_STATUS_SERVICE_UNAVAILABLE /* 503 */);
 return;

}



// server setup looks like (which I previously already posted)

  server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "fooifier",
                         SOUP_SERVER_TLS_CERTIFICATE, tlscert,
                         SOUP_SERVER_PORT, 1234,
                         NULL);
  authdomain = soup_auth_domain_digest_new (
                   SOUP_AUTH_DOMAIN_REALM, REALM,
                SOUP_AUTH_DOMAIN_DIGEST_AUTH_CALLBACK, auth_digest_callback,
                SOUP_AUTH_DOMAIN_DIGEST_AUTH_DATA, map_user_to_digest,
                NULL);
  soup_auth_domain_add_path (authdomain, "/");
  soup_server_add_auth_domain (server, SOUP_AUTH_DOMAIN (authdomain));
  g_object_unref (authdomain);
  soup_server_add_handler (server,
                        NULL /* NULL == default handler */,
                        (SoupServerCallback)server_callback,
                        NULL, NULL);
  g_assert (soup_server_is_https (server));
  soup_server_run_async (server);



Any help, pointer or hint is highly appreciated.

libsoup 2.44.2
gio 2.38.2
glib 2.38.2


Best


Bernhard

Attachment: gnutls-leak-2013-12.png
Description: PNG image



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]