Comment 25 for bug 1619616

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Narrowing the problem: it isn't any of the Mir code, or the generated code, or explicit calls into libprotobuf-lite.

The following program loads and unloads libprotobuf-lite.so from 2.6.1 successfully. With 3.0.0 it fails to unload.

#include <stdio.h>
#include <dlfcn.h>

int main(int argc, char** argv)
{
    char const* libname = argc <= 1 ? "libprotobuf-lite.so" : argv[1];

    void* dl = NULL;

    dl = dlopen(libname, RTLD_NOW);
    if (!dl)
    {
        printf("dlopen() error: (%s)\n", dlerror());
        return 1;
    }

    printf("library loaded\n");
    dlclose(dl);

    dl = dlopen(libname, RTLD_NOW|RTLD_NOLOAD);

    if (dl)
    {
        printf("library didn't unload: (%s)\n", libname);
        dlclose(dl);
        return 1;
    }

    printf("library unloaded\n");

    return 0;
}