Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#470 closed defect (fixed)

run-program issues with OpenJDK 11

Reported by: Mark Evenson Owned by:
Priority: major Milestone: 1.8.0
Component: other Version: 1.7.1-dev
Keywords: Cc:
Parent Tickets:

Description

<https://mailman.common-lisp.net/pipermail/armedbear-devel/2020-July/004080.html>

+ The prebuilt jar is unable to use sys:run-program at all.

+ When built from source, sys:run-program works, but sys:process-pid
  does not.

lisp-implementation-version:

"1.7.1"
"OpenJDK_64-Bit_Server_VM-Debian-11.0.7+10-post-Debian-3deb10u1"
"amd64-Linux-4.19.0.9-amd64"

Change History (7)

comment:1 Changed 4 years ago by Mark Evenson

Confirmed as failing from ABCL invoked as shell script, but *not* running under SLIME.

comment:2 in reply to:  1 Changed 4 years ago by Mark Evenson

Replying to Mark Evenson:

Confirmed as failing from ABCL invoked as shell script, but *not* running under SLIME.

The cause of this error is the load of run_program.abcl fails to find java.lang.UNIXProcess. This can be replicated even from a source build if ABCL is invoked as

java -jar abcl.jar

The java.lang.UNIXProcess only comes into existence after the initialization of java.lang.Process occurs. And since java.lang.UNIXProcess is not going to exist under Windows, we need to figure out a better strategy.

Interestingly, the constant is being compiled into a SHARPSIGN-DOT reader macro.

   #61 = Utf8               #.(JAVA:JCLASS \"java.lang.UNIXProcess\")
   #62 = String             #61           // #.(JAVA:JCLASS \"java.lang.UNIXProcess\")
Last edited 4 years ago by Mark Evenson (previous) (diff)

comment:3 Changed 4 years ago by Mark Evenson

This error occurs for all tested openjdk11 on freebsd, Linux, and macOS.

comment:4 Changed 4 years ago by Mark Evenson

Apparently, the Lisp compiler in ABCL is behaving differently depending on whether it is running on openjdk8 versus openjdk11. When run-program.lisp is compiled with openjdk8 the SHARPSIGN-DOT reader macro is stuffed into the string, when compiled with openjdk11, the unadorned string is utilized. Since the ABCL compiler is written entirely in Lisp, there should be no such platform differences present, and yet this problem is reproducible.

Well, I needed to understand the current compiler better anyways, so this is good practice at examining its innards…

comment:5 Changed 4 years ago by Mark Evenson

This bug occurs when the system compiled with openjdk8 is run
under the openjdk11 runtime. Inconsistently, the abcl-1.7.0 binaries were
compiled with openjdk11 while the abcl-1.7.1 binaries were compiled with
openjdk8.

In openjdk11, the java.lang.UNIXProcess class has been
replaced with java.lang.ProcessImpl, so our code needs to
conditionally find the pid of a given process based on the
platform that the ABCL finds itself running upon.

As a workaround until we fix and release the next version of
ABCL, one may get sys:run-program running as long as one
doesn't try to get the pid via running the following code

(ignore-errors (sys:run-program "true" nil))

An easy fix would be to place such code in <file:~/.abclrc>.

Last edited 4 years ago by Mark Evenson (previous) (diff)

comment:7 Changed 4 years ago by Mark Evenson

Milestone: 1.7.21.8.0

Milestone renamed

Note: See TracTickets for help on using tickets.