OK, thanks for the hints. I've spent some time looking at this issue and I now have an idea what is happening.
When you issue )LOAD, the native library becomes loaded again, even though it's already loaded. There are two issues with this:
First and foremost, after the )LOAD the version of libemacs that is shipped with GNU APL was loaded, not the one correct onw (which happens to be in my development directory). If you intend to call dlopen on the same library, it's important that it's actually the same library and not another one with the same name in a different directory.
Secondly, after loading this library again, GNU APL calls the get_sig() function again. Even if the dlopen() call had returned the same pointer, this would be problematic because the library performs some initialisation stuff in this function call (as you previously had recommended when I asked where I should run the initialisation). Trying to reinitialise an already initialised library is not good.
In short, I think that the idea of using a normal function as entry point into the native code is problematic. I wouldn't mind a redesign of this so that native code lives in a namespace separate from the normal code so it's unaffected by calls to )CLEAR, )ERASE etc.
Regards,
Elias