Bug 1271

Summary: Load the native libraries from the memory instead of using temporary files
Product: [JogAmp] Gluegen Reporter: Julien Gouesse <gouessej>
Component: coreAssignee: Sven Gothel <sgothel>
Severity: normal CC: gouessej
Priority: P4    
Version: 2.4.0   
Hardware: All   
OS: all   
Workaround: ---

Description Julien Gouesse 2015-11-22 13:44:04 CET
The automated native library loading currently requires to extract the native libraries into a kind of temporary cache on the file system. It uses a small binary file to detect whether a directory is "executable". However, some virus scanners detect this binary file as a virus, some others detect the extracted libraries as possible viruses. Moreover, GlueGen fails to find a location to build this temporary cache in constrained environments or a valid location might become unusable when there isn't enough available space.

Java and the Windows API don't support the native library loading when the library isn't in the file system but it's possible to load a DLL from the memory:

Actually, a JIT compiler can do something similar.

I suggest to copy the native libraries into the memory and to load them from it instead of extracting them into the file system first.
Comment 1 Julien Gouesse 2016-02-29 17:46:12 CET
It's too much ambitious. Such a mechanism would be difficult to maintain. However, a more simple solution would be more suitable, for example a property to define the location of the cache.