Issue2589

classification
Title: Two copies of jansi DLL created per invocation of Jython
Type: behaviour Severity: minor
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: jeff.allen, zyasoft
Priority: Keywords:

Created on 2017-05-07.08:38:40 by jeff.allen, last changed 2017-06-10.08:07:11 by jeff.allen.

Messages
msg11358 (view) Author: Jeff Allen (jeff.allen) Date: 2017-05-07.08:38:39
Noted in passing on Windows, the jansi DLL that is necessary to support the JLine console is extracted twice from the JLine JAR every time I run Jython. Doing it twice appears to be a bug in org.fusesource.hawtjni.runtime.Library, which cannot find the file it extracted earlier when loading a class.

Files extracted from a URL are given (by Java) a randomly-generated name component, so the DLL ends up as "jansi-64-2636578793605407255.dll", or some such, and go into the temporary directory.

However, WIBNI JLine (and jnr-posix for that matter) found the necessary dependencies, instead of regenarating them?
msg11420 (view) Author: Jim Baker (zyasoft) Date: 2017-06-08.18:25:50
Duplicate of #2270

Are we still seeing duplicated DLLs generated for JNR, per #2269 ? This supposedly was fixed in JNR, but we didn't upgrade jars because of other problems.
msg11431 (view) Author: Jeff Allen (jeff.allen) Date: 2017-06-10.08:07:10
Not quite a duplicate. #2269 and #2270 are about leaving the copies behind when Jython exits.

At the time of this report, I traced far enough into the console to learn that JLine looks for its library when you load it, in a few likely places, then resorts to unpacking a copy into TEMP with the random name (generated by Java, I think). Then when you actually use it, it fails to find the copy it created. This part of the code has changed since the version we are/were using, but I haven't tried the later version. (Other things more pressing.)

However, I did notice that if it had found the DLL present already, we wouldn't have these copies at all.
History
Date User Action Args
2017-06-10 08:07:11jeff.allensetstatus: pending -> open
resolution: duplicate -> accepted
messages: + msg11431
2017-06-08 18:25:50zyasoftsetstatus: open -> pending
resolution: duplicate
messages: + msg11420
nosy: + zyasoft
2017-05-07 08:38:40jeff.allencreate