Debian Bug report logs - #620122
libjna-java: JNA does not support multi-arch system library paths

version graph

Package: libjna-java; Maintainer for libjna-java is Debian Java maintainers <pkg-java-maintainers@lists.alioth.debian.org>; Source for libjna-java is src:libjna-java.

Reported by: James Page <james.page@canonical.com>

Date: Wed, 30 Mar 2011 10:45:01 UTC

Severity: normal

Tags: patch

Found in version libjna-java/3.2.4-2

Fixed in version libjna-java/3.2.7-3

Done: Andrew Ross <ubuntu@rossfamily.co.uk>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, james.page@canonical.com, Debian Java maintainers <pkg-java-maintainers@lists.alioth.debian.org>:
Bug#620122; Package libjna-java. (Wed, 30 Mar 2011 10:45:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Page <james.page@canonical.com>:
New Bug report received and forwarded. Copy sent to james.page@canonical.com, Debian Java maintainers <pkg-java-maintainers@lists.alioth.debian.org>. (Wed, 30 Mar 2011 10:45:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: James Page <james.page@canonical.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libjna-java: JNA does not support multi-arch system library paths
Date: Wed, 30 Mar 2011 11:41:05 +0100
[Message part 1 (text/plain, inline)]
Package: libjna-java
Version: 3.2.4-2
Severity: normal
Tags: patch


Ubuntu has moved over to multi-arch based system libraries; the code in libjna-java
that generates the library search path does not support this directory structure.

The attached patched fixes this for archs supported on Ubuntu.

I would like to expand this to support all archs for Debian as well.

I have also reported this upstream - http://java.net/jira/browse/JNA-184.
[07-multiarch-support.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Java maintainers <pkg-java-maintainers@lists.alioth.debian.org>:
Bug#620122; Package libjna-java. (Wed, 30 Mar 2011 12:51:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Page <james.page@canonical.com>:
Extra info received and forwarded to list. Copy sent to Debian Java maintainers <pkg-java-maintainers@lists.alioth.debian.org>. (Wed, 30 Mar 2011 12:51:07 GMT) Full text and rfc822 format available.

Message #10 received at 620122@bugs.debian.org (full text, mbox):

From: James Page <james.page@canonical.com>
To: Debian Java List <debian-java@lists.debian.org>
Cc: 620122@bugs.debian.org
Subject: Impact of switching to multi-arch on Java & native library handling.
Date: Wed, 30 Mar 2011 13:32:50 +0100
[Message part 1 (text/plain, inline)]
Hi All

You may (or may not) know that Ubuntu Natty (the current development
release) has started to make the transition to multi-arch based
libraries (see [0] & [4]). 

This basically means that instead of libraries being located
in /usr/lib:/lib they are installed to architecture specific locations
(/usr/lib/i386-linux-gnu...), allowing libraries for multiple archs to
be installed on the same system (i386 and amd64 for example).

For the majority of Java code this will have no impact as the JVM
abstracts this underlying change away from the developer; however code
that integrates with native libraries is potentially impacted by this
change (see [1] & [2]).  

We encountered two separate issues in Ubuntu related to this
switch-over:

1) Incomplete library search paths

        openjdk-6 and libjna-java have both been updated to be
        multi-arch aware when generating paths for library searching;
        This was a fairly simple fix but it will need to be expanded to
        support all of the various architectures that Debian builds for
        over and above Ubuntu (see [3]).
        
        I have submitted the patch to libjna-java back upstream (see
        [2]) with these comments as anyone using JNA on a multi-arch
        enabled Linux distro will have this issue.

2) Version-less library names.
        
        The second issue (which is not directly related to the
        multi-arch change) related to how native libraries are typically
        loaded in Java code.  Calls to the loadLibrary function provided
        by the Java Runtime Environment simply take library names - for
        example 'pam'.  The JVM maps this to 'libpam.so' and then tries
        to resolve this against the native libraries on the system.
        
        This is OK where a library provides both the Java code and the
        native shared object (without a ABI version number) which should
        be installed to /usr/lib/jni.  However where the Java code is
        relying on a system library such as PAM this is unresolvable -
        i.e. the JRE will not be able to load the library as there is no
        version-less .so available.
        
        libjna-java works in a similar way but resolves this issue by
        'best matching' the library - i.e. it takes a guess at which
        version is required and picks the highest one it finds - this is
        inherently a little dangerous as the Java 'native' code might
        not map to the version it picks to load.
        
        libjna-java also understands versioned libraries and passes
        these directly to libdl to resolve - 'libpam.so.0' would be
        handled in this way.  This would be a better way to ensure that
        native Java integration is fixed and tested against a specific
        ABI version of the underlying native library.

The intent of this email is really to:

        a) give the team a heads-up on issue 1) as I believe Wheezy is
        due to move to multi-arch.
        
        b) generate some discussion around version-less system library
        handling. Hoping that JNA will match a request for 'xx' to the
        right version of library 'xx' does not feel like a good thing to
        be doing.

I don't think that this issue is particularly widespread in the Java
code-base in Debian or Ubuntu (not many libraries use libjna-java);
however I have at least two new packages I want to contribute that use
JNA in this way and it would be great to get a consensus on how to
handle this in Debian and derivatives.  

I think that fixing to a particular version of a library is the right
way to go - this can be managed using a patch and ensures that ABI
compatibility is maintained between the Java library and the native
system library for this type of package.

Cheers

James


[0] https://wiki.ubuntu.com/MultiarchSpec
[1] https://bugs.launchpad.net/ubuntu/+source/libjna-java/+bug/737603
[2] http://java.net/jira/browse/JNA-184
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620122
[4] http://wiki.debian.org/Multiarch/

James Page
Software Engineer, Ubuntu Server Team
[signature.asc (application/pgp-signature, inline)]

Reply sent to Andrew Ross <ubuntu@rossfamily.co.uk>:
You have taken responsibility. (Fri, 27 May 2011 23:36:05 GMT) Full text and rfc822 format available.

Notification sent to James Page <james.page@canonical.com>:
Bug acknowledged by developer. (Fri, 27 May 2011 23:36:05 GMT) Full text and rfc822 format available.

Message #15 received at 620122-close@bugs.debian.org (full text, mbox):

From: Andrew Ross <ubuntu@rossfamily.co.uk>
To: 620122-close@bugs.debian.org
Subject: Bug#620122: fixed in libjna-java 3.2.7-3
Date: Fri, 27 May 2011 23:33:50 +0000
Source: libjna-java
Source-Version: 3.2.7-3

We believe that the bug you reported is fixed in the latest version of
libjna-java, which is due to be installed in the Debian FTP archive:

libjna-java-doc_3.2.7-3_all.deb
  to main/libj/libjna-java/libjna-java-doc_3.2.7-3_all.deb
libjna-java_3.2.7-3.debian.tar.gz
  to main/libj/libjna-java/libjna-java_3.2.7-3.debian.tar.gz
libjna-java_3.2.7-3.dsc
  to main/libj/libjna-java/libjna-java_3.2.7-3.dsc
libjna-java_3.2.7-3_amd64.deb
  to main/libj/libjna-java/libjna-java_3.2.7-3_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 620122@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andrew Ross <ubuntu@rossfamily.co.uk> (supplier of updated libjna-java package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 25 May 2011 21:19:02 +0100
Source: libjna-java
Binary: libjna-java libjna-java-doc
Architecture: source amd64 all
Version: 3.2.7-3
Distribution: experimental
Urgency: low
Maintainer: Debian Java maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Changed-By: Andrew Ross <ubuntu@rossfamily.co.uk>
Description: 
 libjna-java - Dynamic access of native libraries from Java without JNI
 libjna-java-doc - Dynamic access of native libraries from Java without JNI (documen
Closes: 620122
Changes: 
 libjna-java (3.2.7-3) experimental; urgency=low
 .
   * Seach multiarch paths for libraries (Closes: #620122)
Checksums-Sha1: 
 d563194f72c73d563c5594583fed5e0056703dec 2150 libjna-java_3.2.7-3.dsc
 d593131ecdc957da9e25a86b9522a1cbc3173264 12594 libjna-java_3.2.7-3.debian.tar.gz
 f24987592e77a5502905405389dce26499bc06f6 416126 libjna-java_3.2.7-3_amd64.deb
 3ecf630a61c9de3a8883681d91d043ebb317c102 140774 libjna-java-doc_3.2.7-3_all.deb
Checksums-Sha256: 
 d005df1f0bb03b8f991e51cc84bc0185df48042a69f598d20325be4cdc3ff226 2150 libjna-java_3.2.7-3.dsc
 6a9c709572ffcf22fe96c9c1de823cc3650691161b087db3520702bb1037f4e1 12594 libjna-java_3.2.7-3.debian.tar.gz
 7d76772fc82ea7cf33a8addb1cd69acb4411319d340e7e26d9f7656d89327def 416126 libjna-java_3.2.7-3_amd64.deb
 7909c820f8dc7ae38b5a6717ba95e3484703e5c9aef8627e67ed823da372aacf 140774 libjna-java-doc_3.2.7-3_all.deb
Files: 
 0694ca8fa744ea65000f7eedbae4c23e 2150 java optional libjna-java_3.2.7-3.dsc
 86f94631fadc5540945db77a1dd3d603 12594 java optional libjna-java_3.2.7-3.debian.tar.gz
 8a415786b855bdc86653b274545d16f2 416126 java optional libjna-java_3.2.7-3_amd64.deb
 67f6edb1e606a57c5cdebcb157561a96 140774 doc optional libjna-java-doc_3.2.7-3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBAgAGBQJN4DAqAAoJECHSBYmXSz6Wh70QAMOHEjC7LsoeAtjZ1axHNY8m
4EiFeb/AF2NzzsvZueacmolJmmQryYHDHKw7wnTdSDf4YsiNZSL4AxIGLSqFKW7P
ghFlm6avzo939gayTvuV8E7BAiK56upU3p+/BJIfj0hwOpOiT8ItN7nRCIUkzEQs
w4Cr4KX4sMd3vnd536WUa38VuTDA2OBlliKjU8GujJqH6pHAlpD5u6tQldLJNmk9
cI33LS7pl8U93d3LN0ie9PsJTDRrxxstlrfh5elNGn4O7QJj0H6b2cOamZYOoFCg
0kawjZy6tmq2mRb+y00tT9QmaK5fwOQ78vcMxiw+smUhgP5ZCP/dbU67EOq8NFw7
7FjVIGYIXco9Y90VMs2zB0PJjThw1OENtgpwRrkSY0iYTyW7taLbPo8AMCS35cYQ
pc34aZwJNp78+DfmLsIrwX4gqKOKuK51ZpAQAN6CEszQO8E0uiY9tQrPlPpy1sH4
NU/QEYWmQfwrBNZa7gdzH9OxFNa3oJs8GHv1ttd4fGISjlv1a49uKtwtPWwD1OfI
nrtLhyjQbGPqqH9dwgDFBjOeFSgPLsCwqMGc/fjM3M/NuPnEF2IM3YFJdn3tsWV0
YIJ4uVziKPzL0955f64DaNlzzaxtmeXc32gsPNxToFqaaigXHS9AKbkGeZHNUD26
hwcg/v6kqVnpvGEBDL7T
=Y9ig
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 15 Jul 2011 07:34:22 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 23:56:15 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.