mkcl issueshttps://gitlab.common-lisp.net/mkcl/mkcl/-/issues2019-11-25T19:22:30Zhttps://gitlab.common-lisp.net/mkcl/mkcl/-/issues/10(ql:quickload :parenstcript) fails on Windows and Linux2019-11-25T19:22:30ZJacek Podkanski(ql:quickload :parenstcript) fails on Windows and Linuxsomething to do with named read tablessomething to do with named read tablesJean-Claude BeaudoinJean-Claude Beaudoinhttps://gitlab.common-lisp.net/mkcl/mkcl/-/issues/9quicklisp freezes on Linux2019-11-25T19:22:00ZJacek Podkanskiquicklisp freezes on LinuxThank you for writing an implementation that works on Windows. I have tried several and could not make them work.
But this time the problem is with Linux. I have noticed that I could not use my existing quicklisp. So I tried to install ...Thank you for writing an implementation that works on Windows. I have tried several and could not make them work.
But this time the problem is with Linux. I have noticed that I could not use my existing quicklisp. So I tried to install quicklisp this way: mkcl -load ~/Downloads/quicklisp.lisp
I got the initial prompts and ran: (quicklisp-quickstart:install) and got stuck. When I was trying to find my lost gitlab credentials and wrote some of the report I have noticed it has made some progress. But the following is a lie
> 317,858 bytes in 0.63 seconds (489.15KB/sec)
>
> ==== quicklisp installed ====
Whatever it was it was not 0.63 seconds!Jean-Claude BeaudoinJean-Claude Beaudoinhttps://gitlab.common-lisp.net/mkcl/mkcl/-/issues/8DOLIST macro expansion can't handled type declaration properly.2017-10-19T12:42:18ZCHIBA MasaomiDOLIST macro expansion can't handled type declaration properly.## How to reproduce the issue
### Type 1
```cl
> (compile nil
(lambda ()
(dolist (s '("foo" "bar" "baz"))
(declare (type string s))
(check-type s string))))
;;; Warning: In LET*...## How to reproduce the issue
### Type 1
```cl
> (compile nil
(lambda ()
(dolist (s '("foo" "bar" "baz"))
(declare (type string s))
(check-type s string))))
;;; Warning: In LET* body, the type of the form S is SYMBOL, not STRING.
#<compiled-function 000000000394e630>
T
T
> (macroexpand
'(dolist (s '("foo" "bar" "baz"))
(declare (type string s))
(check-type s string)))
(BLOCK NIL
(LET* ((SI::%DOLIST-VAR '("foo" "bar" "baz"))
S ;; <==== initialized by NIL
)
(DECLARE (TYPE STRING S))
(SI:WHILE SI::%DOLIST-VAR
(SETQ S (FIRST SI::%DOLIST-VAR))
(CHECK-TYPE S STRING)
(SETQ SI::%DOLIST-VAR (REST SI::%DOLIST-VAR)))
NIL))
T
```
### Type 2
```cl
> (compile nil
(lambda ()
(dolist (s '("foo" "bar" "baz") s)
(declare (type string s))
(check-type s string))))
;;; Warning: Type mismatch between S and NIL.
#<compiled-function 7ff51fe16f30>
T
T
> (macroexpand
'(dolist (s '("foo" "bar" "baz") s)
(declare (type string s))
(check-type s string)))
(BLOCK NIL
(LET* ((SI::%DOLIST-VAR '("foo" "bar" "baz")) S)
(DECLARE (TYPE STRING S))
(SI:WHILE SI::%DOLIST-VAR
(SETQ S (FIRST SI::%DOLIST-VAR))
(CHECK-TYPE S STRING)
(SETQ SI::%DOLIST-VAR (REST SI::%DOLIST-VAR)))
(SETQ S NIL) ;; <=== SETQ by NIL
S))
```
## How to fix this issue (in my opinion)
I also reported this bug to the ECL team.
https://gitlab.com/embeddable-common-lisp/ecl/issues/348https://gitlab.common-lisp.net/mkcl/mkcl/-/issues/7make failure on macOS2017-10-19T12:42:19ZAlex Dunnmake failure on macOSI get the following build errors when trying to compile MKCL 1.1.10 and HEAD (at db99a9d) on macOS 10.12.2:
```
mkcc.c:290:3: error: Incomplete mkcc_set_self_context();
# error Incomplete mkcc_set_self_context();
^
mkcc.c:298:31: error...I get the following build errors when trying to compile MKCL 1.1.10 and HEAD (at db99a9d) on macOS 10.12.2:
```
mkcc.c:290:3: error: Incomplete mkcc_set_self_context();
# error Incomplete mkcc_set_self_context();
^
mkcc.c:298:31: error: use of undeclared identifier 'os_self'
char * true_self = realpath(os_self, NULL);
^
2 errors generated.
```
Full logs: https://gist.github.com/dunn/2e9e1ee8fe2fb0f3cc14c7504f23d4b0#file-02-make-L18-L24
Let me know if there's anything else you need for debugging.https://gitlab.common-lisp.net/mkcl/mkcl/-/issues/6git_describe.lsp conflicts with version information elsewhere in MKCL sources2017-10-19T12:42:19ZRobert Goldmangit_describe.lsp conflicts with version information elsewhere in MKCL sourcesThis gives me an MKCL executable confused about its identity:
Here's what happens for me:
1. `make clean`
2. I now should have MKCL version 1.1.10, but I have sources that are confused about the version:
```
~/src/mkcl$ find ...This gives me an MKCL executable confused about its identity:
Here's what happens for me:
1. `make clean`
2. I now should have MKCL version 1.1.10, but I have sources that are confused about the version:
```
~/src/mkcl$ find . -type f -exec fgrep -q 1.1.9 {} \; -print
./src/util/ms-windows/mkcl.nsi.w64
./src/lsp/git_describe.lsp
./src/Makefile.w64
./src/mkcl/config.h.w64
./src/c/Makefile.w64
~/src/mkcl$ cat src/lsp/git_describe.lsp
(defun mkcl::git-describe-this-mkcl () "1.1.9.166-269e172")
$ find . -type f -exec fgrep -q 1.1.10 {} \; -print
./src/make-install.out
./src/trivial-garbage.asd
./src/configure.in
./src/doc/Makefile
./src/lsp/config.pre
./src/babel.asd
./src/fiveam.asd
./src/Makefile
./src/mkcl/configpre.h
./src/mkcl/object.h
./src/mkcl/config.h
./src/rt.asd
./src/trivial-features.asd
./src/config.log
./src/configure
./src/config.status
./src/alexandria.asd
./src/cffi.asd
./src/bordeaux-threads.asd
./src/uiop.asd
./Makefile
~/src/mkcl$ fgrep 1.1.10 Makefile
VERSION=1.1.10
```
when I run the script to detect the git config, it gives 1.1.9, which is perhaps the source of the problem?
```
~/src/mkcl/src$ ./git_describe_this_mkcl.sh
(defun mkcl::git-describe-this-mkcl () "1.1.9.166-269e172")
```
This is the hash of the head commit, so I'm not sure why it's labeled as 1.1.9 when the Makefiles are labeled as 1.1.10.https://gitlab.common-lisp.net/mkcl/mkcl/-/issues/5Run-program hangs in synchronous mode with string stream input2017-10-19T12:42:19ZElias PippingRun-program hangs in synchronous mode with string stream input```common-lisp
(with-input-from-string (in-stream "input")
(mk-ext:run-program "cat" nil :wait t :input in-stream :output nil))
```
Hangs for me. This might be a duplicate of #3.```common-lisp
(with-input-from-string (in-stream "input")
(mk-ext:run-program "cat" nil :wait t :input in-stream :output nil))
```
Hangs for me. This might be a duplicate of #3.Jean-Claude BeaudoinJean-Claude Beaudoinhttps://gitlab.common-lisp.net/mkcl/mkcl/-/issues/4Crash when run-program writes to a file stream2017-10-19T12:42:19ZElias PippingCrash when run-program writes to a file streamIf I run
```common-lisp
(with-open-file (output "output-file" :direction :output :if-exists :supersede)
(mk-ext:run-program "echo" '("foo") :input nil :wait t :output output))
```
Three values are returned but I also get
```
Deb...If I run
```common-lisp
(with-open-file (output "output-file" :direction :output :if-exists :supersede)
(mk-ext:run-program "echo" '("foo") :input nil :wait t :output output))
```
Three values are returned but I also get
```
Debugger called in: #<thread "from-subprocess-worker (pid: 3101)" active detached (3102) 0x7f32d7fff700 7f32ec4be000>.
#<a SI:OS-STREAM-ERROR 139856689642976>:
Stream error: OS level error on stream #<closed output stream (C stdio) "output-file">.
Read or write operation signaled an error.
OS Explanation: (errno == 9) Bad file descriptor
```
And then once I `quit`:
```
*** Error in `mkcl': corrupted double-linked list: 0x0000000002b7b580 ***
```Jean-Claude BeaudoinJean-Claude Beaudoinhttps://gitlab.common-lisp.net/mkcl/mkcl/-/issues/3Run-program hangs in synchronous mode with file input2017-10-19T12:42:19ZElias PippingRun-program hangs in synchronous mode with file input```common-lisp
(mk-ext:run-program "cat" nil :input "may-or-may-not-exist" :if-input-does-not-exist :create :wait t)
```
Hangs for me.```common-lisp
(mk-ext:run-program "cat" nil :input "may-or-may-not-exist" :if-input-does-not-exist :create :wait t)
```
Hangs for me.Jean-Claude BeaudoinJean-Claude Beaudoinhttps://gitlab.common-lisp.net/mkcl/mkcl/-/issues/2Sleeping process not reported as sleeping2017-10-19T12:42:19ZElias PippingSleeping process not reported as sleepingI’m trying to find out how different lisp compilers handle external processes(*). As a part of that, I’ve created a short piece of code that launches an external process, sends it `SIGSTOP`, asks its about its well-being, and allows its ...I’m trying to find out how different lisp compilers handle external processes(*). As a part of that, I’ve created a short piece of code that launches an external process, sends it `SIGSTOP`, asks its about its well-being, and allows its to go about its business again by sending `SIGCONT`.
I would expect that `mk-ext:process-status` consequently reports
1. :running before `SIGSTOP` is sent
2. then :stopped
3. then :running again once `SIGCONT` was received
4. and finally :exited.
Indeed, that is what `ps` would do if you ran it on the command line (so I’ve added that to the example for comparison). Here’s the output of my script:
```
external status: [S] (expected: [S])
internal status: RUNNING (expected: running)
external status: [T] (expected: [T])
internal status: RUNNING (expected: stopped)
external status: [S] (expected: [S])
internal status: RUNNING (expected: running)
external status: [Z] (expected: [] or [Z])
internal status: EXITED (expected: exited)
```
My expectations aren’t met in (2): The process should be stopped but is never reported as such.
So I’d like to ask: Is this a bug or intentional?
(*) I’ve already sent very similar messages and/or filed bugs for Clozure CL, ECL, and SBCL.
Here’s the script that I used:
```common-lisp
;; careful with cmucl. it doesn't actually sleep when external processes
;; are around https://gitlab.common-lisp.net/cmucl/cmucl/issues/26
#+clozure (use-package :ccl)
#+sbcl (use-package :sb-ext)
#+cmu (use-package :ext)
#+mkcl (use-package :mk-ext)
#+clozure (setf (fdefinition 'process-output) #'external-process-output-stream)
#+ecl (setf (fdefinition 'process-output) #'ext:external-process-output)
(defun my-run-program (&rest rest)
#+ecl (nth-value 2 (apply #'ext:run-program rest))
#+mkcl (nth-value 1 (apply #'mk-ext:run-program rest))
#-(or ecl mkcl) (apply #'run-program rest))
(defconstant +sigstop+
#+clozure (symbol-value (read-from-string "#$SIGSTOP"))
#+cmu unix:sigstop
#+ecl ext:+sigstop+
#+sbcl (progn (require :sb-posix)
(symbol-value (find-symbol (symbol-name :sigstop)
(find-package :sb-posix))))
#-(or clozure cmu ecl sbcl) (or #+darwin 17 #-darwin 19)) ; FIXME
(defconstant +sigtstp+
#+clozure (symbol-value (read-from-string "#$SIGTSTP"))
#+cmu unix:sigtstp
#+ecl ext:+sigtstp+
#+sbcl (progn (require :sb-posix)
(symbol-value (find-symbol (symbol-name :sigtstp)
(find-package :sb-posix))))
#-(or clozure cmu ecl sbcl) (or #+darwin 18 #-darwin 20)) ; FIXME
(defconstant +sigcont+
#+clozure (symbol-value (read-from-string "#$SIGCONT"))
#+cmu unix:sigcont
#+ecl ext:+sigcont+
#+sbcl (progn (require :sb-posix)
(symbol-value (find-symbol (symbol-name :sigcont)
(find-package :sb-posix))))
#-(or clozure cmu ecl sbcl) (or #+darwin 19 #-darwin 18)) ; FIXME
(defun internal-status (process)
#+clozure (external-process-status process)
#+(or sbcl cmu) (process-status process)
#+ecl (ext:external-process-status process)
#+mkcl (mk-ext:process-status process))
(defun external-kill (pid signal)
(my-run-program "/usr/bin/env" (list "kill"
(format nil "-~a" signal)
(format nil "~a" pid))))
;; ecl does not support writing to a string stream
(defun external-status (pid)
(let* ((arg-list (list "ps" "-h" "-p" (format nil "~a" pid) "-o" "state"))
(process (my-run-program "/usr/bin/env" arg-list :output :stream))
(output (process-output process))
; we expect a single letter
(target (make-string 1)))
(read-sequence target output)
target))
(defun get-pid (process)
#+clozure (ccl::external-process-pid process)
#+ecl (ext:external-process-pid process)
#+(or sbcl cmu) (process-pid process)
#+mkcl (mkcl:process-id process))
(let* ((p (my-run-program "/usr/bin/env" '("sleep" "3") :wait nil))
(pid (get-pid p)))
(format t "external status: [~a] (expected: [S])~%" (external-status pid))
(format t "internal status: ~a (expected: running)~%" (internal-status p))
(external-kill pid +sigstop+)
(sleep 1)
(format t "external status: [~a] (expected: [T])~%" (external-status pid))
(format t "internal status: ~a (expected: stopped)~%" (internal-status p))
(external-kill pid +sigcont+)
(sleep 1)
(format t "external status: [~a] (expected: [S])~%" (external-status pid))
(format t "internal status: ~a (expected: running)~%" (internal-status p))
(sleep 3)
(format t "external status: [~a] (expected: [] or [Z])~%" (external-status pid))
(format t "internal status: ~a (expected: exited)~%" (internal-status p)))
```Jean-Claude BeaudoinJean-Claude Beaudoinhttps://gitlab.common-lisp.net/mkcl/mkcl/-/issues/1Feature request: Export unix signals2017-10-19T12:42:19ZElias PippingFeature request: Export unix signalsSince the numerical value of a signal depends on the version of the posix standard and is thus different on different operating systems (e.g. SIGCONT is 19 on macOS but 18 on Linux (it might even be more complicated than that)), it's nic...Since the numerical value of a signal depends on the version of the posix standard and is thus different on different operating systems (e.g. SIGCONT is 19 on macOS but 18 on Linux (it might even be more complicated than that)), it's nice to be able to query the lisp compiler/interpreter for the number behind a name.
Allegro CL, Clozure CL, CMU CL, ECL, and SBCL each provide such a mechanism (through constants, functions, or through a direct FFI reader macro). It would be nice if so did MKCL.Jean-Claude BeaudoinJean-Claude Beaudoin