Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Oct 2013 00:49:24 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Jung-uk Kim <jkim@FreeBSD.org>
Cc:        jlh@freebsd.org, java@FreeBSD.org, Sevan / Venture37 <venture37@gmail.com>, Jimmy Olgeni <olgeni@freebsd.org>
Subject:   Re: JNA broken with r251668 as libc.so cant be loaded
Message-ID:  <20131004214924.GB41229@kib.kiev.ua>
In-Reply-To: <524F3599.4060708@FreeBSD.org>
References:  <524DFB7D.2000207@gmail.com> <20131004050824.GK41229@kib.kiev.ua> <524E934D.70303@gmail.com> <20131004152000.GS41229@kib.kiev.ua> <524F2FD2.3020801@FreeBSD.org> <524F3599.4060708@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--opzWO/wrBSGPRF8K
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 04, 2013 at 05:39:37PM -0400, Jung-uk Kim wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>=20
> On 2013-10-04 17:14:58 -0400, Jung-uk Kim wrote:
> > On 2013-10-04 11:20:00 -0400, Konstantin Belousov wrote:
> >> On Fri, Oct 04, 2013 at 02:07:09PM +0400, Sevan / Venture37
> >> wrote:
> >>> On 04/10/2013 09:08, Konstantin Belousov wrote:
> >>>> Does the source contain some workaround for Linux, already ?=20
> >>>> Linux uses script for libc.so for very long time, and should=20
> >>>> have the same issue unless code explicitely dlopen()s
> >>>> libc.so.6 or such.
> >>>=20
> >>>=20
> >>> No=20
> >>> https://svn.java.net/svn/jna~svn/trunk/jnalib/test/com/sun/jna/Librar=
yLoadTest.java
> >
> >>>=20
> >>>=20
> >> I do not know what should I see in the pointer you provided, and=20
> >> how it implies the answer 'No' to my question.
> >=20
> >> I just verified dlopen("libc.so") on some fresh Linux box, and
> >> the function returned expected error '/lib/libc.so: invalid ELF=20
> >> header'.
> >=20
> > I haven't verified it but it seems to have special case for Linux.=20
> > Please see:
> >=20
> > https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.=
java#L206
> >
> >=20
> https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.ja=
va#L741
> > https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.=
java#L768
>=20
> Verified.
> >=20
> This simple patch fixed the problem for me.
>=20
> http://people.freebsd.org/~jkim/jna.diff

The patch looks like a proper solution.

Thank you for figuring it out.

--opzWO/wrBSGPRF8K
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQIcBAEBAgAGBQJSTzfjAAoJEJDCuSvBvK1BWBQP/3Ynfv/h9gt4zaKSsGqPEao6
JH2VDjYOr8ehGDwNW7LUMbzwYe5Jw9pP/bMYqEAxDCTTgneGqYrjkIfSKZzwo/BH
pjJgQtf9AIh3GdLtvaOhMPgYaqUBu1vzbuP/FigAComdGIJygLuwsqYq7W26ZNTQ
mmrwhNCiWG/Wa7zOWznxD5ksrDNf3EcUg8YtloB/pPRNHmartOf0THlCH44ufZnC
F3gxcQtwrpeb6CqILZbbWgU1G0sELVsnZD1rkddVnbVm++TrRK8oR2Bn9Dc45tL2
CMSIiaJ0UeGHYbYb+and3mjmDfaQPDFjhbL0W1KDo0MRSL/NcTsNcHX6cNkjmia8
BLSIep3e7AqJ4qAM1W0cgvAkdBSkFWe0S9HUKRaIeyc/yE7LMehRd9sREZlE1vpB
WXS0JYKmCQ4te+ivl2/1yIpsShAP5P6SqzhltWOnRKMh2W5CxGn37Cb2eOXRwltv
CrAvizF1+Pgh4KJhkCq55fo1otWFwNLxKlGJxqPX4ODITsYwJcgoDUbte3evw2xO
CC79VVigT++H+fPfbopbYMfGBFmcXAnaVIQcART1MP97kLAjTz96N2qZjXBtHFlH
+v6FKlsXd9tA1K8B3Tv8PPpGTKcd4AuMbEzTtQvRnPwZdJy/pB+hBVsUlk7Wou0w
WK2Ozujh2m94c3tybSxB
=xlIu
-----END PGP SIGNATURE-----

--opzWO/wrBSGPRF8K--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131004214924.GB41229>