Commit 11a50e79 authored by Nils Goroll's avatar Nils Goroll

umem: test-load libumem in a separate namespace in the management process

libumem's atfork handler will redefine malloc() and friends so if we
load it in the manager, we cannot confine its use to the stevedore
parent 2c4e481e
......@@ -41,6 +41,7 @@
#include <stdlib.h>
#include <umem.h>
#include <dlfcn.h>
#include <link.h>
#include "storage/storage.h"
#include "storage/storage_simple.h"
......@@ -262,7 +263,8 @@ smu_init(struct stevedore *parent, int ac, char * const *av)
/* Check if these load in the management process. */
(void) dlerror();
if ((libumem_hndl = dlopen("libumem.so", RTLD_NOW)) == NULL)
libumem_hndl = dlmopen(LM_ID_NEWLM, "libumem.so", RTLD_LAZY);
if (libumem_hndl == NULL)
ARGV_ERR("(-sumem) cannot open libumem.so: %s", dlerror());
#define DLSYM_UMEM(fptr,sym) \
......@@ -282,6 +284,9 @@ smu_init(struct stevedore *parent, int ac, char * const *av)
#undef DLSYM_UMEM
AZ(dlclose(libumem_hndl));
libumem_hndl = NULL;
e = VNUM_2bytes(av[0], &u, 0);
if (e != NULL)
ARGV_ERR("(-sumem) size \"%s\": %s\n", av[0], e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment