Thanks! The filename seems to get corrupted already before dlopen:
-----
void
java::lang::Runtime::_load (jstring path, jboolean do_search)
...
lt_dlhandle h;
// FIXME: make sure path is absolute.
{
// Synchronize on java.lang.Class. This is to protect the class chain
from
// concurrent modification by class registration calls which may be
run
// during the dlopen().
JvSynchronize sync (&java::lang::Class::class$);
h = do_search ? lt_dlopenext (lib_name) : lt_dlopen (lib_name);
}
...
-----
The value of lib_name is "libhello" before call to JvSynchronize and
corrupted afterwards.