Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with SBCL: error in any evaluation #6

Closed
mobius-eng opened this issue Jul 1, 2017 · 2 comments
Closed

Issue with SBCL: error in any evaluation #6

mobius-eng opened this issue Jul 1, 2017 · 2 comments

Comments

@mobius-eng
Copy link

I followed the instructions for installation. To produce the executable I used the following commands (in the directory of maxima-jupyter):

maxima
to_lisp();
(load "load-maxima-jupyter")
(sb-ext:save-lisp-and-die #P"path/to/maxima-jupyter-exec" :executable t :toplevel 'cl-jupyter:kernel-start)

Then the installation of the kernel:

python3 ./install-maxima-jupyter.py --maxima-jupyter-exec=/path/to/maxima-jupyter-exec

All went fine. I can even start the console by doing:

 jupyter console --Session.key="b''" --kernel=maxima

And I get

[ZMQTerminalIPythonApp] WARNING | Message signing is disabled.  This is insecure and not recommended!

cl-jupyter: an enhanced interactive Maxima REPL
(Version 0.6 - Jupyter protocol v.5.0)
--> (C) 2014-2015 Frederic Peschanski (cf. LICENSE)

connection file = /run/user/1000/jupyter/kernel-3338.json
stdin endpoint is: tcp://127.0.0.1:34315
[Heartbeat] thread started
[Heartbeat] thread started
[Kernel] Entering mainloop ...
[Shell] loop started
WARNING:
   [Shell] message type 'history_request' not (yet ?) supported, skipping...
/usr/local/lib/python3.5/dist-packages/jupyter_console/ptshell.py:94: UserWarning: No lexer found for language 'maxima'. Treating as plain text.
  warn("No lexer found for language %r. Treating as plain text." % name)
Jupyter console 5.1.0

In [1]: 

Apart from the warning, everything seems to be fine (and I get the same warning when I start cl-jupyter which does work). Attempt to evaluate any expression, however, results in an infinite loop of thrown errors that look like this:

debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {10038ADAC3}>:
  The value
    NIL
  is not of type
    (OR (AND SYMBOL (NOT NULL)) RESTART)
  when binding RESTART

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT   ] Reduce debugger level (to debug level 3).
  1: [CONTINUE] Return from SB-UNIX:SIGINT.
  2:            Return from SB-UNIX:SIGINT.

(INVOKE-RESTART NIL) [more]
0[4] 
0[3] 

and they keep repeating until the process is killed.

SysInfo: Ubuntu 16.04 LTS, SBCL 1.3.19 (built from sources), Maxima 5.40.0 built with SBCL 1.3.19 from sources, *FEATURES* of Maxima's lisp core:

(CL MK-DEFSYSTEM CLTL2 QUICKLISP SB-BSD-SOCKETS-ADDRINFO ASDF-PACKAGE-SYSTEM
 ASDF3.1 ASDF3 ASDF2 ASDF OS-UNIX NON-BASE-CHARS-EXIST-P ASDF-UNICODE 64-BIT
 64-BIT-REGISTERS ALIEN-CALLBACKS ANSI-CL ASH-RIGHT-VOPS
 C-STACK-IS-CONTROL-STACK COMMON-LISP COMPACT-INSTANCE-HEADER
 COMPARE-AND-SWAP-VOPS COMPLEX-FLOAT-VOPS CYCLE-COUNTER ELF FLOAT-EQL-VOPS
 FP-AND-PC-STANDARD-SAVE GENCGC IEEE-FLOATING-POINT IMMOBILE-CODE
 IMMOBILE-SPACE INLINE-CONSTANTS INTEGER-EQL-VOP LARGEFILE LINKAGE-TABLE LINUX
 LITTLE-ENDIAN MEMORY-BARRIER-VOPS MULTIPLY-HIGH-VOPS OS-PROVIDES-BLKSIZE-T
 OS-PROVIDES-DLADDR OS-PROVIDES-DLOPEN OS-PROVIDES-GETPROTOBY-R
 OS-PROVIDES-POLL OS-PROVIDES-PUTWC OS-PROVIDES-SUSECONDS-T
 PACKAGE-LOCAL-NICKNAMES PRECISE-ARG-COUNT-ERROR RAW-INSTANCE-INIT-VOPS
 RAW-SIGNED-WORD SB-AFTER-XC-CORE SB-CORE-COMPRESSION SB-DOC SB-EVAL SB-FUTEX
 SB-LDB SB-PACKAGE-LOCKS SB-SIMD-PACK SB-SOURCE-LOCATIONS SB-THREAD
 SB-TRACEROOT SB-UNICODE SB-XREF-FOR-INTERNALS SBCL STACK-ALLOCATABLE-CLOSURES
 STACK-ALLOCATABLE-FIXED-OBJECTS STACK-ALLOCATABLE-LISTS
 STACK-ALLOCATABLE-VECTORS STACK-GROWS-DOWNWARD-NOT-UPWARD SYMBOL-INFO-VOPS
 UNBIND-N-VOP UNDEFINED-FUN-RESTARTS UNIX UNWIND-TO-FRAME-AND-CALL-VOP X86-64)
@robert-dodier
Copy link
Owner

robert-dodier commented Jul 5, 2017

Thanks for your message. I followed your recipe to create the maxima-jupyter executable and it works successfully when I try the Jupyter console. I don't recognize the error message you are getting; maybe ask on the SBCL mailing list about it?

I may be working with older versions of Ubuntu, gcc, SBCL, and Jupyter; I don't know what difference that makes.

$ uname -a
Linux freekbox 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:23:46 UTC 2014 i686 i686 i686 GNU/Linux

$ gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04

$ sbcl --version
SBCL 1.3.13

$ jupyter --version
4.0.4

However the Maxima version is post-5.40:

$ maxima --version
Maxima branch_5_40_base_95_g4c9cbbd

I had to patch ironclad-0.33 (loaded via Quicklisp):

$ diff -u src/digests/digest.lisp-original src/digests/digest.lisp
--- src/digests/digest.lisp-original	2017-07-04 17:09:03.973101995 -0700
+++ src/digests/digest.lisp	2017-07-04 17:09:28.553223882 -0700
@@ -50,7 +50,7 @@
       ;; Otherwise, we have a bignum.
       (t
        (locally (declare (optimize (safety 0))
-                         (type sb-bignum:bignum-type length))
+                         (type sb-bignum:bignum-element-type length))
          (cond
            ((= (sb-bignum:%bignum-length length) 1)
             (setf (aref block lo) (sb-bignum:%bignum-ref length 0)))

Not sure where to go from here. Thanks for your interest all the same.

@robert-dodier
Copy link
Owner

I'm closing this discussion thread due to lack of activity, but if you want to resume this topic, please open a new thread. Thanks for your interest in Maxima-Jupyter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants