sandervs / javahidapi

Automatically exported from code.google.com/p/javahidapi
Other
0 stars 0 forks source link

Please fix the stack guard #63

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Create a simple .jar file that outputs the temperature:

public class Main {
    static final int VENDOR_ID = 3141;
    static final int PRODUCT_ID = 29697;
    static final int BUFSIZE = 2048;
    private static final long READ_UPDATE_DELAY_MS = 10;

    static {
        ClassPathLibraryLoader.loadNativeHIDLibrary();
    }

    public static void main(String[] args) {
        System.out.println("Temp");

        while(true)
        {
            readDevice();

            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            } // sleep for 10 seconds
        } 
    }
...

2. The example works on Mac OS X 10.9 from the terminal with the command:
 java -jar temper1.jar

3. On a raspberry pi with a raspbian (Debian) image i got the following error 
message:

OpenJDK Zero VM warning: You have loaded library 
/tmp/libhidapi-jni-642831176804085687937.so which might have disabled stack 
guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', 
or link it with '-z noexecstack'.
Temp
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
com.codeminders.hidapi.HIDManager.init()V
    at com.codeminders.hidapi.HIDManager.init(Native Method)
    at com.codeminders.hidapi.HIDManager.<init>(HIDManager.java:53)
    at com.codeminders.hidapi.HIDManager.getInstance(HIDManager.java:121)
    at Main.main(Main.java:24)

Please, can you compile a new version of javahidapi with the described 
parameter: "-z noexecstack"

Best regards,
Andrej

Original issue reported on code.google.com by andrejal...@googlemail.com on 8 Aug 2014 at 1:33