I have found aufs not supporting application performing the following steps in order to download a .so embedded in the binary. The code does:
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
This is done in order to unpack and dlopen() library as it is needed and/or depending on specific operating system/libraries present.
This only fails if unlink() was called and only fails for aufs - works fine for all other Linux FSes and works properly on many other Unix systems as well.
Attached is a sample code that shows how to reproduce it - it calls gcc to build the .so, so it requires gcc to be present.
The code fails if I run it inside aufs - such as:
mount none /mnt -t aufs -o dirs=/tmp/emptydir:/path/to/chroot-env
This has failed for me with Ubuntu 12.04 LTS (Kernel 3.2.0-54-generic-pae). Both chroot-env and regular OS were same Ubuntu 12.04 LTS, but I suspect this is not specific to Ubuntu.
The result from non-aufs system is:
Test_FuncA: OK
Test_FuncB: OK
On aufs it is:
Test_FuncA: OK
Test_FuncB: unable to dlsym()
(all subsequent dlopen+dlsym fail with dlsym() not finding the symbol)