mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-09 04:11:27 +08:00
29fddfc7df
The tests posix/bug-ga2-mem and resolv/mtrace-tst-leaks2 are failing on fedora 33 as mtrace reports memory leaks. The /etc/nsswitch.conf differs between Fedora 32: hosts: files dns myhostname Fedora 33: hosts: files resolve [!UNAVAIL=return] myhostname dns Therefore /lib64/libnss_resolve.so.2 (from systemd) and the dependencies libgcc_s.so.1 and libpthread.so.0 are loaded. Usually all malloc'ed resources from getaddrinfo / gethostbyname are freed and the libraries are dlclose'd in nss/nsswitch.c:libc_freeres_fn (free_mem). Unfortunately, /lib64/libnss_resolve.so.2 is marked with DF_1_NODELETE. As this library is not unmapped, you'll see "Memory not freed". Therefore those tests are now only relying on libnss_files.so by making them test-container tests and providing the required configuration files. By moving the tests to tests-container, those are now running with "make check". Therefore the mtrace part of the tests are also moved from "make xcheck" to "make check". bug-ga2.c is now using test-driver.c in order to support WAIT_FOR_DEBUGGER environment variable.
32 lines
607 B
C
32 lines
607 B
C
/* Test case by Sam Varshavchik <mrsam@courier-mta.com>. */
|
|
#include <mcheck.h>
|
|
#include <netdb.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <support/check.h>
|
|
|
|
static int
|
|
do_test (void)
|
|
{
|
|
struct addrinfo hints, *res;
|
|
int i, ret;
|
|
|
|
mtrace ();
|
|
for (i = 0; i < 100; i++)
|
|
{
|
|
memset (&hints, 0, sizeof (hints));
|
|
hints.ai_family = PF_UNSPEC;
|
|
hints.ai_socktype = SOCK_STREAM;
|
|
|
|
ret = getaddrinfo ("www.gnu.org", "http", &hints, &res);
|
|
|
|
if (ret)
|
|
FAIL_EXIT1 ("%s\n", gai_strerror (ret));
|
|
|
|
freeaddrinfo (res);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
#include <support/test-driver.c>
|