Changeset 15288


Ignore:
Timestamp:
05/30/20 09:59:17 (6 months ago)
Author:
Mark Evenson
Message:

ci: test CL+SSL

Update version of ci tested CL+SSL to use patch for openjdk14, and
update the local version of the patch under <file:patches/>.

Location:
trunk/abcl
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/.travis.yml

    r15284 r15288  
    5656
    5757  # Install the patched version of cl+ssl
    58   - bash -x ${ABCL_ROOT}/ci/install-patched-cl+ssl.bash
     58  - bash -x ${ABCL_ROOT}/ci/install-cl+ssl.bash
    5959
    6060  # Install the ANSI-TEST suite
  • trunk/abcl/ci/test-cl+ssl.lisp

    r15174 r15288  
    1 (require :asdf)
    2 (require :abcl-contrib)
     1#+abcl
     2(progn
     3  (require :asdf)
     4  (require :abcl-contrib))
    35
    46(ql:quickload :cl+ssl)
  • trunk/abcl/patches/cl-plus-ssl-abcl.patch

    r15285 r15288  
    11# HG changeset patch
    2 # Parent  97a70ad89e9799a7cfb1c794095bf372522c8f81
    3 Implement stream-fd for ABCL
     2# Parent  e997fa4665748951d229e8622102c67fca5f22f9
     3abcl: fix getting the underlying stream fd for openjdk14
    44
    5 This fixes for broken BIO on OpenSSL 1.1.1 ff. which causes ABCL to
    6 segfault.
    7 
    8 This hack allows ABCL to get at the underlying file descriptor using
    9 undocumented portions of the JVM that are not guaranteed to be stable.
    10 
    11 Tested under openjdk8 and openjdk11.
    12 
    13 c.f. <https://github.com/cl-plus-ssl/cl-plus-ssl/issues/72>,
    14 <https://abcl.org/trac/ticket/464>.
    15 
    16 diff -r 97a70ad89e97 src/streams.lisp
    17 --- a/src/streams.lisp  Sat Mar 14 15:07:32 2020 +0300
    18 +++ b/src/streams.lisp  Fri May 15 21:34:28 2020 +0200
    19 @@ -208,7 +208,7 @@
    20    (when unwrap-stream-p
    21      (let ((fd (stream-fd socket)))
    22        (when fd
    23 -  (setf socket fd))))
    24 +        (setf socket fd))))
    25    (etypecase socket
    26      (integer
    27       (install-nonblock-flag socket)
    28 @@ -486,3 +486,21 @@
    29  #+lispworks
    30  (defmethod stream-fd ((stream comm::socket-stream))
    31    (comm:socket-stream-socket stream))
    32 +
    33 +#+abcl
    34 +(progn
    35 +  (require :abcl-contrib)
    36 +  (require :jss)
    37 +
    38 +  (defmethod stream-fd ((stream system::socket-stream))
    39 +    ;;; Don't ask...
    40 +    (let* ((s0
    41 +             (#"getWrappedInputStream" (two-way-stream-input-stream stream)))
    42 +           (s1
    43 +             (jss:get-java-field s0 "in" t))
    44 +           (s2
    45 +             (jss:get-java-field s1 "ch" t)))
    46 +      (jss:get-java-field s2 "fdVal" t))))
    47 +   
    48 +
    49 +
     5diff -r e997fa466574 -r 58f46634d03d src/streams.lisp
     6--- a/src/streams.lisp  Wed May 27 17:20:38 2020 +0300
     7+++ b/src/streams.lisp  Sat May 30 08:30:17 2020 +0200
     8@@ -493,18 +493,25 @@
     9   (require :jss)
     10 
     11   ;;; N.b. Getting the file descriptor from a socket is not supported
     12-  ;;; by any published JVM API, but the following private data
     13-  ;;; structures have been present from openjdk6 through openjdk14 so
     14-  ;;; there's hope that this is somewhat unofficially official.
     15+  ;;; by any published JVM API, so every JVM implementation may behave
     16+  ;;; somewhat differently.  By using the ability of
     17+  ;;; jss:get-java-fields to access private fields, it is usually
     18+  ;;; possible to "find" an access path to read the underlying integer
     19+  ;;; value of the file decriptor, which is all we need to pass to
     20+  ;;; SSL.
     21   (defmethod stream-fd ((stream system::socket-stream))
     22+    (setf *debug* stream)
     23     (flet ((get-java-fields (object fields) ;; Thanks to Cyrus Harmon
     24              (reduce (lambda (x y)
     25                        (jss:get-java-field x y t))
     26                      fields
     27-                     :initial-value object)))
     28+                     :initial-value object))
     29+           (jvm-version ()
     30+             (parse-integer (java:jstatic "getProperty" "java.lang.System"
     31+                                          "java.specification.version"))))
     32       (ignore-errors
     33        (get-java-fields (java:jcall "getWrappedInputStream"  ;; TODO: define this as a constant
     34                                     (two-way-stream-input-stream stream))
     35-                        '("in" "ch" "fdVal"))))))
     36-
     37-
     38+                        (if (< (jvm-version) 14)
     39+                            '("in" "ch" "fdVal")
     40+                            '("in" "this$0" "sc" "fd" "fd")))))))
Note: See TracChangeset for help on using the changeset viewer.