m4-patches
[Top][All Lists]
Advanced

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

memory leak in unload(`gnu')


From: Eric Blake
Subject: memory leak in unload(`gnu')
Date: Tue, 03 Oct 2006 06:56:29 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This is not a complete fix (I'm still trying to track down where else
memory is being leaked), but greatly reduces the lost memory when
repeatedly loading and unloading the gnu module (before the patch, the
added test grew to over 5.5M of mem usage; after, it grew to just 3.2M).
I also found a libltdl memleak in the process.  I wish I knew a portable
way to artifically cap the heap usage and cause a memory exhausted error
in the face of a leak, without making the test take too long to execute.
But this test is at least valuable in that we don't coredump when the gnu
module is dlpreloaded, and hence variables aren't reset to their initial
state between unload and load (as I did run into that situation while
preparing this patch).

2006-10-03  Eric Blake  <address@hidden>

        Partially plug memory leak when unloading gnu module.
        * tests/modules.at (unload gnu module): New test.
        * modules/gnu.c (gnu_LTX_m4_finish_module): New function.
        (m4_regexp_compile): Move static storage to module visibility.
        * tests/options.at (--debug): Adjust to new output.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFIl3984KuGfSFAYARAskiAJwL570lV6lKz2c9CO1TWQdLVuLBXQCgwwma
xP2AA+44D6cpBTJiZfVwukg=
=2qlf
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]