Bug#633501: libjinput-jni: contains undefined symbol EVIOCGUSAGE

2011-12-20 Thread froese
Package: libjinput-jni
Version: 20100502+dfsg-5
Followup-For: Bug #633501

Dear Maintainer,

please apply Geoffrey's patch or remove the package.

In the current state, the package is totally broken!

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.0.1+ (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libjinput-jni depends on:
ii  libc6  2.13-21

libjinput-jni recommends no packages.

libjinput-jni suggests no packages.

-- no debconf information



__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.


Bug#633501: libjinput-jni: contains undefined symbol EVIOCGUSAGE

2011-11-21 Thread Sébastien Guillemin
Hi,

  Don't know if you got a test program in the meanwhile. In case you
didn't, here is one (not very useful, but it does trigger the error).

package com.example;
import net.java.games.input.test.ControllerEventTest;
public class TestApp
{
public static void main(String args[])
{
ControllerEventTest eventTest = new ControllerEventTest();
}
}

--
Seb



__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.


Bug#633501: libjinput-jni: contains undefined symbol EVIOCGUSAGE

2011-10-03 Thread Geoffrey Thomas

tags 633501 + patch
forwarded 633501 http://java.net/jira/browse/JINPUT-44
thanks

Hi all,

I've reported this bug upstream at http://java.net/jira/browse/JINPUT-44 , 
and submitted a patch (attached, and also at 
http://ldpreload.com/p/jinput-remove-getDeviceUsageBits.patch ) to 
eliminate all code related to this nonexistent ioctl. The package builds 
cleanly with this patch applied via debian/patches, and I've verified that 
the resulting .so no longer references an EVIOCGUSAGE symbol, but I don't 
have enough of an idea of how this package works to properly test that it 
addresses the reported crash. (At the very least, I can't reproduce the 
crash simply by installing this package, or adding "import 
net.java.games.input.*" to a Hello World class.)


Java team, if you would like me to prepare a debdiff or NMU including this 
patch, let me know (and let me know how to test it), and I'll be happy to 
do so.


--
Geoffrey Thomas
http://ldpreload.com
geo...@ldpreload.comIndex: trunk/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java
===
--- trunk/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java	(revision 247)
+++ trunk/plugins/linux/src/java/net/java/games/input/LinuxEventDevice.java	(working copy)
@@ -94,28 +94,6 @@
 	}
 
 	private final Controller.Type guessType() throws IOException {
-		Controller.Type type_from_usages = guessTypeFromUsages();
-		if (type_from_usages == Controller.Type.UNKNOWN)
-			return guessTypeFromComponents();
-		else
-			return type_from_usages;
-	}
-	
-	private final Controller.Type guessTypeFromUsages() throws IOException {
-		byte[] usage_bits = getDeviceUsageBits();
-		if (isBitSet(usage_bits, NativeDefinitions.USAGE_MOUSE))
-			return Controller.Type.MOUSE;
-		else if (isBitSet(usage_bits, NativeDefinitions.USAGE_KEYBOARD))
-			return Controller.Type.KEYBOARD;
-		else if (isBitSet(usage_bits, NativeDefinitions.USAGE_GAMEPAD))
-			return Controller.Type.GAMEPAD;
-		else if (isBitSet(usage_bits, NativeDefinitions.USAGE_JOYSTICK))
-			return Controller.Type.STICK;
-		else
-			return Controller.Type.UNKNOWN;
-	}
-
-	private final Controller.Type guessTypeFromComponents() throws IOException {
 		List components = getComponents();
 		if (components.size() == 0)
 			return Controller.Type.UNKNOWN;
@@ -342,15 +320,6 @@
 	}
 	private final static native void nGetBits(long fd, int ev_type, byte[] evtype_bits) throws IOException;
 
-	private final byte[] getDeviceUsageBits() throws IOException {
-		byte[] bits = new byte[NativeDefinitions.USAGE_MAX/8 + 1];
-		if (getVersion() >= 0x010001) {
-			nGetDeviceUsageBits(fd, bits);
-		}
-		return bits;
-	}
-	private final static native void nGetDeviceUsageBits(long fd, byte[] type_bits) throws IOException;
-
 	public final synchronized void pollKeyStates() throws IOException {
 		nGetKeyStates(fd, key_states);
 	}
Index: trunk/plugins/linux/src/native/net_java_games_input_LinuxEventDevice.c
===
--- trunk/plugins/linux/src/native/net_java_games_input_LinuxEventDevice.c	(revision 247)
+++ trunk/plugins/linux/src/native/net_java_games_input_LinuxEventDevice.c	(working copy)
@@ -112,20 +112,6 @@
 	return num_effects;
 }
 
-JNIEXPORT void JNICALL Java_net_java_games_input_LinuxEventDevice_nGetDeviceUsageBits(JNIEnv *env, jclass unused, jlong fd_address, jbyteArray usages_array) {
-#if EV_VERSION >= 0x010001
-	int fd = (int)fd_address;
-	jsize len = (*env)->GetArrayLength(env, usages_array);
-	jbyte *usages = (*env)->GetByteArrayElements(env, usages_array, NULL);
-	if (usages == NULL)
-		return;
-	int res = ioctl(fd, EVIOCGUSAGE(len), usages);
-	(*env)->ReleaseByteArrayElements(env, usages_array, usages, 0);
-	if (res == -1)
-		throwIOException(env, "Failed to get device usages (%d)\n", errno);
-#endif
-}
-
 JNIEXPORT void JNICALL Java_net_java_games_input_LinuxEventDevice_nGetBits(JNIEnv *env, jclass unused, jlong fd_address, jint evtype, jbyteArray bits_array) {
 	int fd = (int)fd_address;
 	jsize len = (*env)->GetArrayLength(env, bits_array);
__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Bug#633501: libjinput-jni: contains undefined symbol EVIOCGUSAGE

2011-07-10 Thread Lingzhu Xiang
Package: libjinput-jni
Version: 20100502+dfsg-5
Severity: grave
Tags: wheezy sid
Justification: renders package unusable

jvm reports this error at runtime and quits:

java: symbol lookup error: /usr/lib/jni/libjinput.so: undefined symbol: 
EVIOCGUSAGE

objdump shows this symbol in libjinput.so is indeed undefined.

$ objdump -T /usr/lib/jni/libjinput.so 

/usr/lib/jni/libjinput.so: file format elf32-i386

DYNAMIC SYMBOL TABLE:
  DF *UND*    GLIBC_2.0   read
  DF *UND*    GLIBC_2.0   ioctl
  w   DF *UND*    GLIBC_2.1.3 __cxa_finalize
  w   D  *UND*    __gmon_start__
  DF *UND*    GLIBC_2.0   open
  DF *UND*    GLIBC_2.0   write
  DF *UND*    GLIBC_2.0   __errno_location
  w   D  *UND*    _Jv_RegisterClasses
  DF *UND*    GLIBC_2.0   vsnprintf
  D  *UND*    EVIOCGUSAGE
  DF *UND*    GLIBC_2.0   close
23a8 gDF .fini    Base_fini

There is also a compiler warning about this when building the deb package:

compileNativeJinputLib:

[apply] 
/usr/local/src/jinput-20100502+dfsg/plugins/linux/src/native/net_java_games_input_LinuxEventDevice.c:122:2:
 warning: implicit declaration of function ‘EVIOCGUSAGE’ 
[-Wimplicit-function-declaration]

A proposed fix for this is to completely comment out the code in
Java_net_java_games_input_LinuxEventDevice_nGetDeviceUsageBits() because the
macro EVIOCGUSAGE is never defined in any version of linux/input.h.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.39-2-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libjinput-jni depends on:
ii  libc6 2.13-7 Embedded GNU C Library: Shared lib

libjinput-jni recommends no packages.

libjinput-jni suggests no packages.

-- no debconf information



__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.