Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 364639 - sys-auth/pam_mysql: memory leak
Summary: sys-auth/pam_mysql: memory leak
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-24 08:00 UTC by Ralf
Modified: 2011-11-24 18:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf 2011-04-24 08:00:49 UTC
Any available sys-auth/pam_mysql package has a memory leak as some MySQL library memory is not getting freed. When being used with saslauthd (dev-libs/cyrus-sasl) pam_mysql eats all memory until the oom-killer hits the machine. A patch is available in the additional information field.

Unfortunately the pam_mysql ebuilds also are missing support for user patches (src_prepare()/epatch_user call missing).

Reproducible: Always

Steps to Reproduce:
1. Install.
2. Configure saslauthd to use pam_mysql for authentication.
3. Depending on the number of authentication sessions watch the available memory decrease over time.
Actual Results:  
saslauthd/pam_mysql ate over 4GB of memory after a few weeks.

Expected Results:  
Allocated memory should be freed completely when the authentication is through.

--- pam_mysql.c.orig    2006-01-09 11:35:59.000000000 +0100
+++ pam_mysql.c 2011-04-22 09:11:52.037063001 +0200
@@ -2338,6 +2338,7 @@
        }

        mysql_close(ctx->mysql_hdl);
+       mysql_library_end();

        xfree(ctx->mysql_hdl);
        ctx->mysql_hdl = NULL;
Comment 1 Hanno Böck gentoo-dev 2011-11-24 18:26:12 UTC
thanks for the report, fixed