Hmm, the bug ticket service on SourceForge doesn't seem to deliver my
mail expectedly. So I am forwarding here with hoping Wojciech Kocjan
awares.

sf...@users.sourceforge.net:
>
> Hello Wojciech,
>
> "Wojciech Kocjan":
> > 1/ open() a temp file, write() contents of .so to the file and close() it
> > 2/ perform dlopen() on the file and dlsym() to find one or more symbols
> > 3/ perform unlink() to remove it, while keeping handle from dlopen() open - 
> > NOT calling dlclose() - since the code calls APIs from the temp .so
> > 4/ this library works, but subsequent calls fail
>
> Will you see an error after fixing your test code like this?
>
> --- /tmp/aufs-dlopen-unlink-error.c   2013-10-07 18:06:53.000000000 +0900
> +++ ./a.c     2013-10-07 22:13:09.626923806 +0900
> @@ -24,10 +24,15 @@
>       dl = dlopen(filebuf, RTLD_NOW | RTLD_GLOBAL);
>       if (dl != NULL)
>       {
> -         if (dlsym(dl, funcname) == NULL)
> -             printf("%s: unable to dlsym()\n", funcname);
> +         void *p;
> +         char *s;
> +         dlerror();
> +         p = dlsym(dl, funcname);
> +         s = dlerror();
> +         if (s)
> +             printf("%s: unable to dlsym(), %s\n", funcname, s);
>           else
> -             printf("%s: OK\n", funcname);
> +             printf("%s: OK, %p\n", funcname, p);
>       }
>       else
>           printf("%s: unable to dlopen()\n", funcname);
>
> According to "man dlsym", the return value NULL doesn't indicate an
> error. But I don't know you can call the function via NULL ptr.
> Anyway, regardless this patch, I could not reproduce the problem on my
> test system.
>
> (result on my test system)
> Test_FuncA: OK, 0x7f7e66c20670
> Test_FuncB: OK, 0x7f7e66a1f670
>
> For deeper investigate,
> - in your test program, you should check the return value of all
>   libraries and systemcalls.
> - please read aufs README file, and post the necessary info to
>   aufs-users ML.
>
>
> J. R. Okajima

And most suspicious part in your test program is the shortage of read()
and write(). Eg. their return value is smaller than its argument.


J. R. Okajima

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk

Reply via email to