8 Oct 2010 22:21
Possible Bug in javax-usb-ri-linux_1.0.2 on 32-bit architectures
Tim Noell <tnoell <at> gmail.com>
2010-10-08 20:21:31 GMT
2010-10-08 20:21:31 GMT
Hi javax-usb-devel:
I just recently upgraded to 1.0.2 and found a problem ...
Target is 32-bit architecture.
In src/com/ibm/jusb/os/linux/LinuxPipeRequest.java line 123
the type of urbAddress is a java long (64-bit)
In jni/JavaxUsbPipeRequest.c, line 76, where setUrbAddress() is called, the urb is a 32-bit pointer.
If it is not cast to jlong, then later when we call getUrbAddress, we get garbage.
Here is a changeset that add the jong cast and fixes it for 32-bit architectures:
log( LOG_XFER_REQUEST, "Submitted URB" );
- CheckedCallVoidMethod( env, linuxPipeRequest, setUrbAddress, urb );
+ CheckedCallVoidMethod( env, linuxPipeRequest, setUrbAddress, (jlong)urb );
Probably worked just fine on 64-bit, and maybe was not regressed on 32-bit ???
Anyway, FYI,
T.
--
// "Only dead fish go with the flow"
// "Only dead fish go with the flow"
------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb
_______________________________________________ javax-usb-devel mailing list javax-usb-devel <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
RSS Feed