RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Maurizio Cimadamore
This patch overhauls the library loading mechanism used by the Foreign Linker API. We realized that, while handy, the *default* lookup abstraction (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. This patch replaces `LibraryLookup` with a simpler `SymbolLookup` abstract

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Maurizio Cimadamore
On Wed, 2 Jun 2021 17:19:06 GMT, Maurizio Cimadamore wrote: > This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > T

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Jorn Vernee
On Wed, 2 Jun 2021 17:19:06 GMT, Maurizio Cimadamore wrote: > This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > T

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Maurizio Cimadamore
On Wed, 2 Jun 2021 17:19:06 GMT, Maurizio Cimadamore wrote: > This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > T

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-10-07 Thread Cheng Jin
On Wed, 2 Jun 2021 20:13:34 GMT, Maurizio Cimadamore wrote: >> This patch overhauls the library loading mechanism used by the Foreign >> Linker API. We realized that, while handy, the *default* lookup abstraction >> (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. >>

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-10-08 Thread Maurizio Cimadamore
On Fri, 8 Oct 2021 04:43:08 GMT, Cheng Jin wrote: > So I am wondering what happened to the system lookup in such case given there > should be no fundamental difference in leveraging `NativeLibraries` (I assume > the library loading in OpenJDK16 & 17 is the same at this point) unless there > i

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-10-08 Thread Cheng Jin
On Fri, 8 Oct 2021 21:29:19 GMT, Maurizio Cimadamore wrote: >> Hi @mcimadamore, >> >> As you mentioned at >> https://github.com/openjdk/jdk/pull/4316#issuecomment-853238872, the system >> lookup is supported by the underlying `NativeLibraries` which also works on >> OpenJDK16 to support `Lib

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-10-12 Thread Maurizio Cimadamore
On Fri, 8 Oct 2021 21:45:21 GMT, Cheng Jin wrote: > That's what I thought to be the only way around but might need to figure out > the specifics on AIX. Is `libc.a` loadable on AIX (e.g. with System.loadLibrary) ? (Sorry I don't have a machine to test readily available). If so, we might just l

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-10-12 Thread Cheng Jin
On Tue, 12 Oct 2021 15:04:02 GMT, Maurizio Cimadamore wrote: > Is libc.a loadable on AIX (e.g. with System.loadLibrary) ? I tried to load `libc.a` and `libc` this way but neither of them works on AIX. e.g. public class StdLibTest { private static CLinker clinker = CLinker.getInstance()

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-10-12 Thread Maurizio Cimadamore
On Tue, 12 Oct 2021 15:24:41 GMT, Cheng Jin wrote: > I tried to load `libc.a` and `libc` this way but neither of them works on AIX. Sorry - what I meant is - `System::load`, which accepts a full path and extension. E.g. System.load("/usr/lib/libc.a"); - PR: https://git.openjdk.j

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v2]

2021-06-02 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v2]

2021-06-02 Thread Paul Sandoz
On Wed, 2 Jun 2021 20:17:20 GMT, Maurizio Cimadamore wrote: >> This patch overhauls the library loading mechanism used by the Foreign >> Linker API. We realized that, while handy, the *default* lookup abstraction >> (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. >>

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v3]

2021-06-02 Thread Maurizio Cimadamore
On Wed, 2 Jun 2021 18:40:48 GMT, Paul Sandoz wrote: >> Maurizio Cimadamore has updated the pull request incrementally with 10 >> additional commits since the last revision: >> >> - Update test/jdk/java/foreign/TestIntrinsics.java >> >>Co-authored-by: Paul Sandoz >> - Update test/jdk/

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v3]

2021-06-02 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v4]

2021-06-02 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v5]

2021-06-03 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v6]

2021-06-03 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v6]

2021-06-03 Thread Erik Joelsson
On Thu, 3 Jun 2021 16:43:51 GMT, Maurizio Cimadamore wrote: >> This patch overhauls the library loading mechanism used by the Foreign >> Linker API. We realized that, while handy, the *default* lookup abstraction >> (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. >>

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v7]

2021-06-03 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v7]

2021-10-12 Thread Cheng Jin
On Thu, 3 Jun 2021 20:49:44 GMT, Maurizio Cimadamore wrote: >> This patch overhauls the library loading mechanism used by the Foreign >> Linker API. We realized that, while handy, the *default* lookup abstraction >> (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. >>

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v7]

2021-10-12 Thread Maurizio Cimadamore
On Tue, 12 Oct 2021 18:11:56 GMT, Cheng Jin wrote: > Just tried with `System.load()` but still ended up with pretty much the same > failure given both of them eventually invokes `ClassLoader.loadLibrary` to > load the library in which case there is no big difference at this point. Yes and no.

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v7]

2021-10-12 Thread Cheng Jin
On Thu, 3 Jun 2021 20:49:44 GMT, Maurizio Cimadamore wrote: >> This patch overhauls the library loading mechanism used by the Foreign >> Linker API. We realized that, while handy, the *default* lookup abstraction >> (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. >>

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v7]

2021-10-12 Thread Jorn Vernee
On Thu, 3 Jun 2021 20:49:44 GMT, Maurizio Cimadamore wrote: >> This patch overhauls the library loading mechanism used by the Foreign >> Linker API. We realized that, while handy, the *default* lookup abstraction >> (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. >>