Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#17667 closed defect (fixed)

Maxima parser fails on ==

Reported by: vbraun Owned by:
Priority: blocker Milestone: sage-6.5
Component: packages: standard Keywords:
Cc: kcrisman Merged in:
Authors: Volker Braun Reviewers: Jeroen Demeyer
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: 3e7f09a (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges

Description

There is no == operator in Maxima, but on invalid input it does bad things to the C-level stream. On Linux (below) this is caught by gilbc, on OSX the Maxima process hangs indefinitely:

$ sage -maxima
;;; Loading #P"/home/vbraun/Code/sage.git/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/home/vbraun/Code/sage.git/local/lib/ecl/sockets.fas"
;;; Loading #P"/home/vbraun/Code/sage.git/local/lib/ecl/defsystem.fas"
;;; Loading #P"/home/vbraun/Code/sage.git/local/lib/ecl/cmp.fas"
Maxima 5.35.1 http://maxima.sourceforge.net
using Lisp ECL 13.5.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) 1 == 1;

Maxima encountered a Lisp error:

 Read or write operation signaled an error
C library explanation: Illegal seek.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.

This syntax error was diagnosed correctly in Maxima-5.34.1:

$ ./sage -maxima
;;; Loading #P"/home/vbraun/Sage/git-temp/local/lib/ecl/cmp.fas"
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
;;; Loading #P"/home/vbraun/Sage/git-temp/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/home/vbraun/Sage/git-temp/local/lib/ecl/sockets.fas"
;;; Loading #P"/home/vbraun/Sage/git-temp/local/lib/ecl/defsystem.fas"
Maxima 5.34.1 http://maxima.sourceforge.net
using Lisp ECL 13.5.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) 1 == 1;
incorrect syntax: = is not a prefix operator
1 ==
  ^ 

Change History (16)

comment:1 Changed 6 years ago by vbraun

  • Report Upstream changed from N/A to Reported upstream. No feedback yet.

comment:2 follow-up: Changed 6 years ago by vbraun

This is apparently a bug in ECL: https://sourceforge.net/p/ecls/bugs/298/

comment:3 in reply to: ↑ 2 Changed 6 years ago by nbruin

Replying to vbraun:

This is apparently a bug in ECL: https://sourceforge.net/p/ecls/bugs/298/

There's a proposed almost trivial patch there now. If we need this bug solved in Sage, we can patch our ECL.

There is a good chance that Maxima/SBCL on OSX has the same problem as Maxima/ECL, since the underlying problem is a rather unfortunate interpretation of POSIX mandated behaviour of lseek on terminal streams. It might be worth trying that, because if the problem surfaces there too, then the Maxima developers might want to avoid depending on the behaviour of the "file-position" lisp function that ends up wrapping lseek. (Similarly for other lisps for which Maxima is supported).

comment:4 Changed 6 years ago by kcrisman

  • Cc kcrisman added

comment:5 Changed 6 years ago by vbraun

  • Branch set to u/vbraun/maxima_parser_fails_on___

comment:6 Changed 6 years ago by vbraun

  • Authors set to Volker Braun
  • Commit set to 3e30ef9a2bd56dafa1a16aadbcae18c3bca3b50a
  • Priority changed from major to blocker
  • Status changed from new to needs_review

We should put the backported fix into 6.5, too


New commits:

3e30ef9Add upstream patch for the "illegal seek" isuse

comment:7 Changed 6 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to needs_work

Hang on...

comment:8 Changed 6 years ago by jdemeyer

The patch doesn't actually apply due to mismatched TABS/spaces.

comment:9 Changed 6 years ago by jdemeyer

  • Branch changed from u/vbraun/maxima_parser_fails_on___ to u/jdemeyer/ticket/17667
  • Created changed from 01/24/15 19:47:53 to 01/24/15 19:47:53
  • Modified changed from 02/13/15 09:11:46 to 02/13/15 09:11:46

comment:10 Changed 6 years ago by git

  • Commit changed from 3e30ef9a2bd56dafa1a16aadbcae18c3bca3b50a to b039178a1c2ff536de8c56ba4913519a4fd9f775

Branch pushed to git repo; I updated commit sha1. New commits:

b039178Trac #17667: add doctest

comment:11 Changed 6 years ago by jdemeyer

  • Status changed from needs_work to needs_review

comment:12 Changed 6 years ago by vbraun

  • Branch changed from u/jdemeyer/ticket/17667 to u/vbraun/ticket/17667

comment:13 Changed 6 years ago by git

  • Commit changed from b039178a1c2ff536de8c56ba4913519a4fd9f775 to 3e7f09ae9a657433a6d66555bd4c215e1df4e7c5

Branch pushed to git repo; I updated commit sha1. New commits:

fc0820aFix Maxima patch
b039178Trac #17667: add doctest
3e7f09aMerge Jeroen's added doctest

comment:14 Changed 6 years ago by vbraun

  • Status changed from needs_review to positive_review

lgtm

comment:15 Changed 6 years ago by vbraun

  • Branch changed from u/vbraun/ticket/17667 to 3e7f09ae9a657433a6d66555bd4c215e1df4e7c5
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:16 Changed 6 years ago by dimpase

  • Commit 3e7f09ae9a657433a6d66555bd4c215e1df4e7c5 deleted
  • Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.

ECL devs merged Nils' pull request http://sourceforge.net/p/ecls/ecl/merge-requests/1

Note: See TracTickets for help on using tickets.