sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.37k stars 465 forks source link

Upgrade Maxima to 5.29.1 #13364

Closed kcrisman closed 11 years ago

kcrisman commented 12 years ago
Message: 5
Date: Sun, 12 Aug 2012 23:18:05 +0000 (UTC)
From: Robert Dodier <robert.dodier@gmail.com>
To: maxima@math.utexas.edu
Subject: [Maxima] Maxima 5.28.0 release
Message-ID: <k09djd$dvj$2@dough.gmane.org>

Hi, I've created branch-5_28 in Git and tagged branch-5_28-base and
5.28.0. I've created tar.gz, srpm, and rpm's and uploaded them to the
SourceForge file manager. (http://sourceforge.net/projects/maxima/files)

The new spkg is for ECL 11 as well as for ECL 12, i.e. ASDF-agnostic, along the lines of maxima 5.26.0 at #13860. Moreover it has an upstream patch preventing segfaults. This fixes few tickets.

Install http://boxen.math.washington.edu/home/jdemeyer/spkg/maxima-5.29.1.p1.spkg

Apply

Upstream: Reported upstream. Developers acknowledge bug.

CC: @jpflori @dimpase @nbruin @zimmermann6

Component: packages: standard

Keywords: maxima spkg

Author: Jean-Pierre Flori, Dmitrii Pasechnik

Reviewer: Karl-Dieter Crisman, François Bissey, Leif Leonhardy, Paul Zimmermann

Merged: sage-5.7.beta0

Issue created by migration from https://trac.sagemath.org/ticket/13364

kiwifb commented 12 years ago
comment:1

From my test with 5.27.0 that will break a number of things.... The interface to a number of functions changed and requires extra arguments which throws things all over the place of course.

kcrisman commented 12 years ago
comment:2

True. I just opened this in order to have a ticket for it at all; I couldn't find one for 5.27 update alone (as opposed to things noting that 5.27 would fix various things) so I opened this. Feel free to close it if it's a dup.

kiwifb commented 12 years ago
comment:3

No duplicate that I know off. May be an opportunity to update ecl as well, 12.2.1 works well with a few tweaks. 12.7.1 seems to have issues see #12985.

kcrisman commented 11 years ago
comment:4

The newest Maxima is now 5.29. Ugrading ECL is #13324 and hopefully will have positive review soon.

jpflori commented 11 years ago
comment:5

We'll have to make some change to spkg-install when ECL >= 12.12.1 gets in. See #13324 comment:77

I'm waiting for more info from upstream ECL on this change.

jpflori commented 11 years ago

Changed keywords from none to maxima spkg

jpflori commented 11 years ago
comment:7

Here comes a 5.29.1 spkg at http://boxen.math.washington.edu/home/jpflori/maxima-5.29.1.p0.spkg

It builds and runs and passes most tests in sage/calculus on Linux. Some tests fails because Maxima adds ? in some strings in calculus.py.

jpflori commented 11 years ago

Work Issues: fix doctets

kcrisman commented 11 years ago
comment:9

Your spkg diff for the readme says that you removed a patch, but I don't see that in the diff. But we track the patches directory, right?

jpflori commented 11 years ago
comment:10

Yup, I forgot to run hg addremove.

jpflori commented 11 years ago
comment:11

It also seems Maxima does not integrate sqrt(x + sqrt(x)) anymore, maybe that needs assumptions which were incorectly assumed before, don't want to think about that now.

kcrisman commented 11 years ago
comment:12

Yes, don't worry about this now, as François has put a lot of time into cataloguing things anyway on some sage-devel discussion a while ago.

jpflori commented 11 years ago
comment:13

Could you provide a link to that discussion?

kcrisman commented 11 years ago
comment:14

No, it's too old, I'm not sure how to find it. It wasn't part of a thread only about this, I think. François, do you remember?

kiwifb commented 11 years ago
comment:15

Haven't tried 5.29.1 only 5.28 after it came out. I remember that a number of function now require an extra argument (an assumption) as you have found out. But I haven't looked at it in a long time. I'll check what I can find.

kiwifb commented 11 years ago
comment:16

Actually I haven't done a report on upgrade that break things badly for a little while. You may remember a report from a long time ago. I don't have as much time to write those these days.

kiwifb commented 11 years ago
comment:17

Doing some tests with ecl 12.2.1+maxima 5.29.1 right now. I assume the target will be 12.12.1 /5.29.1 and enabling unicode in ecl if possible. Anyway I have a nasty

sage -t -long -verbose "devel/sage-main/sage/symbolic/integration/integral.py" # Killed/crashed

Probably ecl/maxima rather than pure maxima it goes in a panic

;;;
;;; Stack overflow.
;;; Jumping to the outermost toplevel prompt
;;;

for quite a bit before getting killed. The other interesting bits:

sage -t -long "devel/sage-main/sage/interfaces/maxima_abstract.py"
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/interfaces/maxima_abstract.py", line 422:
    sage: maxima.version()
Expected:
    '5.26.0'
Got:
    '5.29.1'
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/interfaces/maxima_abstract.py", line 2354:
    sage: maxima_version()
Expected:
    '5.26.0'
Got:
    '5.29.1'
**********************************************************************
2 items had failures:
   1 of   4 in __main__.example_13
   1 of   5 in __main__.example_84
***Test Failed*** 2 failures.
For whitespace errors, see the file /home/fbissey/.sage/tmp/maxima_abstract_3312.py
         [7.4 s]
sage -t -long "devel/sage-main/sage/interfaces/maxima_lib.py"
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/interfaces/maxima_lib.py", line 716:
    sage: integrate(sqrt(x + sqrt(x)), x).simplify_full()
Expected:
    1/12*sqrt(sqrt(x) + 1)*((8*x - 3)*x^(1/4) + 2*x^(3/4)) - 1/8*log(sqrt(sqrt(x) + 1) - x^(1/4)) + 1/8*log(sqrt(sqrt(x) + 1) + x^(1/4))
Got:
    integrate(sqrt(x + sqrt(x)), x)
#0: simplify_sum(expr='sum(q^k,k,0,inf))
#1: simplify_sum(expr=a*'sum(q^k,k,0,inf))
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/interfaces/maxima_lib.py", line 819:
    sage: limit(x^a,x=0)
Expected:
    Traceback (most recent call last):
    ...
    ValueError: Computation failed since Maxima requested additional
    constraints; using the 'assume' command before limit evaluation
    *may* help (see `assume?` for more details)
    Is a an integer?
Got:
    Traceback (most recent call last):
      File "/usr/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/usr/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/usr/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_26[9]>", line 1, in <module>
        limit(x**a,x=Integer(0))###line 819:
    sage: limit(x^a,x=0)
      File "/usr/lib64/python2.7/site-packages/sage/calculus/calculus.py", line 1188, in limit
        l = maxima.sr_limit(ex, v, a)
      File "/usr/lib64/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 856, in sr_limit
        raise ValueError, "Computation failed since Maxima requested additional constraints; using the 'assume' command before limit evaluation *may* help (see `assume?` for more details)\n" + s
    ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before limit evaluation *may* help (see `assume?` for more details)
    Is a an ?integer?
**********************************************************************
2 items had failures:
   1 of  25 in __main__.example_24
   1 of  19 in __main__.example_26
***Test Failed*** 2 failures.
For whitespace errors, see the file /home/fbissey/.sage/tmp/maxima_lib_3431.py
         [4.0 s]

it is not as bad as I remember but it is just pinpointing on some obvious tests right now.

jpflori commented 11 years ago
comment:18

Replying to @kiwifb:

Doing some tests with ecl 12.2.1+maxima 5.29.1 right now. I assume the target will be 12.12.1 /5.29.1 and enabling unicode in ecl if possible. Anyway I have a nasty

Yup 12.12.1 plus 5.29.1. About the name changes I mentioned here and on #13324, I got upstream confimation it was expected and is not a problem, see http://sourceforge.net/mailarchive/message.php?msg_id=30232028

I'd prefer to postpone Unicode and deal with it in let's say #12985, unless it is really trivial.

sage -t -long -verbose "devel/sage-main/sage/symbolic/integration/integral.py" # Killed/crashed

Probably ecl/maxima rather than pure maxima it goes in a panic

;;;
;;; Stack overflow.
;;; Jumping to the outermost toplevel prompt
;;;

Nice, I did not get that one though.

for quite a bit before getting killed. The other interesting bits:

sage -t -long "devel/sage-main/sage/interfaces/maxima_abstract.py"
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/interfaces/maxima_abstract.py", line 422:
    sage: maxima.version()
Expected:
    '5.26.0'
Got:
    '5.29.1'
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/interfaces/maxima_abstract.py", line 2354:
    sage: maxima_version()
Expected:
    '5.26.0'
Got:
    '5.29.1'
**********************************************************************
2 items had failures:
   1 of   4 in __main__.example_13
   1 of   5 in __main__.example_84
***Test Failed*** 2 failures.
For whitespace errors, see the file /home/fbissey/.sage/tmp/maxima_abstract_3312.py
         [7.4 s]
sage -t -long "devel/sage-main/sage/interfaces/maxima_lib.py"
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/interfaces/maxima_lib.py", line 716:
    sage: integrate(sqrt(x + sqrt(x)), x).simplify_full()
Expected:
    1/12*sqrt(sqrt(x) + 1)*((8*x - 3)*x^(1/4) + 2*x^(3/4)) - 1/8*log(sqrt(sqrt(x) + 1) - x^(1/4)) + 1/8*log(sqrt(sqrt(x) + 1) + x^(1/4))
Got:
    integrate(sqrt(x + sqrt(x)), x)
#0: simplify_sum(expr='sum(q^k,k,0,inf))
#1: simplify_sum(expr=a*'sum(q^k,k,0,inf))
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/interfaces/maxima_lib.py", line 819:
    sage: limit(x^a,x=0)
Expected:
    Traceback (most recent call last):
    ...
    ValueError: Computation failed since Maxima requested additional
    constraints; using the 'assume' command before limit evaluation
    *may* help (see `assume?` for more details)
    Is a an integer?
Got:
    Traceback (most recent call last):
      File "/usr/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/usr/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/usr/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_26[9]>", line 1, in <module>
        limit(x**a,x=Integer(0))###line 819:
    sage: limit(x^a,x=0)
      File "/usr/lib64/python2.7/site-packages/sage/calculus/calculus.py", line 1188, in limit
        l = maxima.sr_limit(ex, v, a)
      File "/usr/lib64/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 856, in sr_limit
        raise ValueError, "Computation failed since Maxima requested additional constraints; using the 'assume' command before limit evaluation *may* help (see `assume?` for more details)\n" + s
    ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before limit evaluation *may* help (see `assume?` for more details)
    Is a an ?integer?
**********************************************************************
2 items had failures:
   1 of  25 in __main__.example_24
   1 of  19 in __main__.example_26
***Test Failed*** 2 failures.
For whitespace errors, see the file /home/fbissey/.sage/tmp/maxima_lib_3431.py
         [4.0 s]

it is not as bad as I remember but it is just pinpointing on some obvious tests right now.

Got these ones and similar in other places. Everything looked trivial to fix and consisted in:

jpflori commented 11 years ago

Dependencies: #13324

jpflori commented 11 years ago

Author: Jean-Pierre Flori

jpflori commented 11 years ago

Changed work issues from fix doctets to fix doctests, build with latest ECL

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:21

The Maxima spkg fails to build for me because makeinfo is missing... :-)

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:22

Ok, now the build "succeeded", although I get:

Now installing the Maxima library as '$SAGE_ROOT/local/lib/ecl//maxima.fas'...
cp: cannot stat `maxima.fasb': No such file or directory

real    18m37.266s
user    14m24.494s
sys     1m52.139s
Successfully installed maxima-5.29.1.p0
...

(I think this was already mentioned on the ECL ticket. Not sure how the new library is supposed to work when it doesn't get installed...)

I also get a couple of new warnings (w.r.t. Maxima 5.26.0 and the old ECL) like

;;; Compiling (DEFUN HAIPART ...).
;;; Warning:
;;;   in file clmacs.lisp, position 6071
;;;   at (DEFUN HAIPART ...)
;;;   ! Too few arguments for proclaimed function LOGAND

(I.e., 164/2 [I think] instances of "Too few arguments for proclaimed function LOGAND".)

dimpase commented 11 years ago
comment:23

Replying to @nexttime:

Ok, now the build "succeeded", although I get:

Now installing the Maxima library as '$SAGE_ROOT/local/lib/ecl//maxima.fas'...
cp: cannot stat `maxima.fasb': No such file or directory

as far as I understand, the name might have changed, due to asdf changes in ECL. It might be maxima-system. rather than maxima.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago

Reviewer: Karl-Dieter Crisman, François Bissey, Leif Leonhardy

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago

Changed work issues from fix doctests, build with latest ECL to fix doctests, build with latest ECL, fix spkg-install

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:24

Replying to @nexttime:

Ok, now the build "succeeded", although I get:

Now installing the Maxima library as '$SAGE_ROOT/local/lib/ecl//maxima.fas'...
cp: cannot stat `maxima.fasb': No such file or directory

real    18m37.266s
user    14m24.494s
sys     1m52.139s
Successfully installed maxima-5.29.1.p0
...

That the build "succeeded" despite of the error is due to a subtle bug in spkg-install:

...
check_error() {
    if [[ $? -ne 0 ]]; then
        echo >&2 "***********************************************************"
        echo >&2 "Error:" $@
        echo >&2 "***********************************************************"
        exit 1
    fi
}

...

echo "Now installing the Maxima library as '$ECLLIB/maxima.fas'..."
cp -f maxima.fasb "$ECLLIB/maxima.fas"
check_error "Failed to install '`pwd`/maxima.fasb' as '$ECLLIB/maxima.fas'."

...

The exit status ($?) tested in check_error() is that of `pwd`, not the one we're interested in, namely that of cp.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:25

Replying to @dimpase:

Replying to @nexttime:

Ok, now the build "succeeded", although I get:

Now installing the Maxima library as '$SAGE_ROOT/local/lib/ecl//maxima.fas'...
cp: cannot stat `maxima.fasb': No such file or directory

as far as I understand, the name might have changed, due to asdf changes in ECL. It might be maxima-system. rather than maxima.

I do have $SPKG_BUILD_DIR/src/src/maxima.system.fasb (i.e., with a period rather than a hyphen).

jpflori commented 11 years ago
comment:26

The fact that this spkg would not install the maxima library (and the error was undetected) was expected. That is what I meant by "build with latest ECL". And thanks for finding out why the error was undetected!!! And yes the new library file is the maxima.system.fasb. See http://sourceforge.net/mailarchive/message.php?msg_id=30232028 I've not replied yet but I don't think we need to ask more work from upstream adsf-bundle. We'll just change the filename in spkg-install.

The makeinfo thing reminds me of something. It should definitely not be required. I think the solution was to touch some files, but I guess something changed in Maxima and the file we touch are not sufficient now.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:27

Replying to @jpflori:

The fact that this spkg would not install the maxima library (and the error was undetected) was expected. That is what I meant by "build with latest ECL".

?

And thanks for finding out why the error was undetected!!! And yes the new library file is the maxima.system.fasb. See http://sourceforge.net/mailarchive/message.php?msg_id=30232028 I've not replied yet but I don't think we need to ask more work from upstream adsf-bundle. We'll just change the filename in spkg-install.

I just manually copied maxima.system.fasb to $SAGE_LOCAL/lib/ecl/maxima.fas, hoping that this was correct. (Currently running ptestlong with Sage 5.5.rc0 on Ubuntu 10.04.4 x86, i.e., an old Pentium4 with currently just 1 GB RAM, which will take ages...)

Or should we keep the new name (.fas or .fasb?), probably having to make changes elsewhere?

The makeinfo thing reminds me of something. It should definitely not be required. I think the solution was to touch some files, but I guess something changed in Maxima and the file we touch are not sufficient now.

Presumably yes, I was thinking of the same... (Although IMHO configure should have checked whether makeinfo is available in advance, in order to eventually skip a few things later.)

Probably similar for some autotools-generated files, although at least some of the warnings were present in previous spkg logs as well. (I personally don't mind, but these may annoy a few users actually reading or grepping the logs, or watching the build process... We occasionally get "needless" questions regarding such on the IRC.)

jpflori commented 11 years ago
comment:28

Replying to @nexttime:

Replying to @jpflori:

The fact that this spkg would not install the maxima library (and the error was undetected) was expected. That is what I meant by "build with latest ECL".

?

I mean the fact that the produced file for Maxima in Lisp libary mode is no longer maxima.fasb but maxima.system.fasb and its not because of the updated Maxima, but of the updated ECL.

And thanks for finding out why the error was undetected!!! And yes the new library file is the maxima.system.fasb. See http://sourceforge.net/mailarchive/message.php?msg_id=30232028 I've not replied yet but I don't think we need to ask more work from upstream adsf-bundle. We'll just change the filename in spkg-install.

I just manually copied maxima.system.fasb to $SAGE_LOCAL/lib/ecl/maxima.fas, hoping that this was correct. (Currently running ptestlong with Sage 5.5.rc0 on Ubuntu 10.04.4 x86, i.e., an old Pentium4 with currently just 1 GB RAM, which will take ages...)

Or should we keep the new name (.fas or .fasb?), probably having to make changes elsewhere?

I thing we keep maxima.fas as the name of the file in the Sage library ($SAGE_???/lib/ecl/).

The makeinfo thing reminds me of something. It should definitely not be required. I think the solution was to touch some files, but I guess something changed in Maxima and the file we touch are not sufficient now.

Presumably yes, I was thinking of the same... (Although IMHO configure should have checked whether makeinfo is available in advance, in order to eventually skip a few things later.)

Probably similar for some autotools-generated files, although at least some of the warnings were present in previous spkg logs as well. (I personally don't mind, but these may annoy a few users actually reading or grepping the logs, or watching the build process... We occasionally get "needless" questions regarding such on the IRC.)

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:29

P.S.: The new Maxima (and/or ECL) seems to [somehowTM] fix #13831...

kiwifb commented 11 years ago
comment:30

Replying to @nexttime:

The Maxima spkg fails to build for me because makeinfo is missing... :-)

I had fixed that in a previous spkg. One file needed touching. The doc is ready for dispatch but one of the source file is regenerated which triggers rebuild.

kcrisman commented 11 years ago
comment:31

The Maxima spkg fails to build for me because makeinfo is missing... :-)

I had fixed that in a previous spkg. One file needed touching. The doc is ready for dispatch but one of the source file is regenerated which triggers rebuild.

Yeah, that sounded familiar to me too.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:32

Replying to @kiwifb:

Doing some tests with ecl 12.2.1+maxima 5.29.1 right now. I assume the target will be 12.12.1 /5.29.1 and enabling unicode in ecl if possible. Anyway I have a nasty

sage -t -long -verbose "devel/sage-main/sage/symbolic/integration/integral.py" # Killed/crashed

Probably ecl/maxima rather than pure maxima it goes in a panic

;;;
;;; Stack overflow.
;;; Jumping to the outermost toplevel prompt
;;;

for quite a bit before getting killed.

On Ubuntu 10.04.4 x86 (Pentium4; FSF GCC 4.7.2, with -march=native and -O3, FWIW) I get slightly more than 23,000 instances (exact number varies) of

;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;

and finally

Segmentation fault

     [56.5 s]

...

The following tests failed:

    sage -t --long -force_lib devel/sage/sage/symbolic/integration/integral.py # 0 doctests failed
----------------------------------------------------------------------
Total time for all tests: 66.3 seconds

(with ./sage -tp 1 --long ...; with make ptestlong, the test was said to have timed out).

P.S.: The "kwown" is not a copy-paste accident. Probably some ECL idiom, like ''"outermost toplevel"'... ;-)

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:33

The other failing doctests seem to be the same you already reported:

The following tests failed:

        sage -t --long -force_lib devel/sage/sage/calculus/calculus.py # 2 doctests failed
        sage -t --long -force_lib devel/sage/sage/functions/exp_integral.py # 1 doctests failed
        sage -t --long -force_lib devel/sage/sage/interfaces/maxima_abstract.py # 2 doctests failed
        sage -t --long -force_lib devel/sage/sage/interfaces/maxima_lib.py # 2 doctests failed
        sage -t --long -force_lib devel/sage/sage/misc/functional.py # 1 doctests failed

Not sure whether you also get

sage -t --long -force_lib devel/sage/sage/functions/exp_integral.py
**********************************************************************
File "$SAGE_ROOT/devel/sage-main/sage/functions/exp_integral.py", line 1074:
    sage: integrate(sinh_integral(x), x, 0, 0.5).n() # incorrect!
Expected:
    0.125872409703453 + 1.57079632679490*I
Got:
    0.125872409703453
**********************************************************************
1 items had failures:
   1 of  18 in __main__.example_31
***Test Failed*** 1 failures.
83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:34

Replying to @nexttime:

Replying to @kiwifb:

I have a nasty

sage -t -long -verbose "devel/sage-main/sage/symbolic/integration/integral.py" # Killed/crashed

Probably ecl/maxima rather than pure maxima it goes in a panic

;;;
;;; Stack overflow.
;;; Jumping to the outermost toplevel prompt
;;;

for quite a bit before getting killed.

On Ubuntu 10.04.4 x86 (Pentium4; FSF GCC 4.7.2, with -march=native and -O3, FWIW) I get slightly more than 23,000 instances (exact number varies) of

;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;

and finally

Segmentation fault

   [56.5 s]

...

The following tests failed:

  sage -t --long -force_lib devel/sage/sage/symbolic/integration/integral.py # 0 doctests failed
----------------------------------------------------------------------
Total time for all tests: 66.3 seconds

(with ./sage -tp 1 --long ...; with make ptestlong, the test was said to have timed out).

The offending test seems to be

...

Trying:
    f = abs(sin(x))###line 653:_sage_    >>> f = abs(sin(x))
Expecting nothing
ok
Trying:
    integrate(f, x, Integer(0), Integer(2)*pi)  # long time (4s on sage.math, 2012)###line 654:_sage_    >>> integrate(f, x, 0, 2*pi)  # long time (4s on sage.math, 2012)
Expecting:
    integrate(abs(sin(x)), x, 0, 2*pi)
;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;

...

(provided the output is in sync, which is not always the case with -verbose).

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:35

Replying to @nexttime:

The offending test seems to be

...

Trying:
    f = abs(sin(x))###line 653:_sage_    >>> f = abs(sin(x))
Expecting nothing
ok
Trying:
    integrate(f, x, Integer(0), Integer(2)*pi)  # long time (4s on sage.math, 2012)###line 654:_sage_    >>> integrate(f, x, 0, 2*pi)  # long time (4s on sage.math, 2012)
Expecting:
    integrate(abs(sin(x)), x, 0, 2*pi)
;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;

...

(provided the output is in sync, which is not always the case with -verbose).

Yep,

sage: f = abs(sin(x))
sage: integrate(f, x, 0, 2*pi)

behaves exactly the same, i.e., the interpreter "exits" with a segmentation fault, after thousands of "Detected access to protected memory ..." messages.

(Sage's own signal handler doesn't get called.)

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:36

P.S.: That's the only test that fails in .../symbolic/integration/integral.py (i.e., all other tests pass if I comment it out).

kiwifb commented 11 years ago
comment:37

Do we know the expression that get passed to maxima? I would check a direct call to maxima and possibly a couple of lisp to check it is not actually a lisp fault.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:38

Replying to @kiwifb:

Do we know the expression that get passed to maxima? I would check a direct call to maxima and possibly a couple of lisp to check it is not actually a lisp fault.

Well, using the Maxima library segfaults.

I'm not at all familiar with Maxima, but


Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.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) integrate(abs(sin(x)),x,0,2*pi);
                              2 pi
                             /
                             [
(%o1)                        I     abs(sin(x)) dx
                             ]
                             /
                              0
(%i2) display2d : false$

(%i3) integrate(abs(sin(x)),x,0,2*pi);

(%o3) 'integrate(abs(sin(x)),x,0,2*pi)
(%i4)

FWIW.

dimpase commented 11 years ago
comment:39

I tried the spkg, and I needed to modify it as follows

diff -r 31ff16046f0b spkg-install
--- a/spkg-install      Fri Dec 14 19:46:53 2012 +0100
+++ b/spkg-install      Sun Dec 16 15:13:21 2012 +0800
@@ -110,7 +110,7 @@
 ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
 echo
 echo "Now installing the Maxima library as '$ECLLIB/maxima.fas'..."
-cp -f maxima.fasb "$ECLLIB/maxima.fas"
+cp -f maxima.system.fasb "$ECLLIB/maxima.fas"
 check_error "Failed to install '`pwd`/maxima.fasb' as '$ECLLIB/maxima.fas'."

to get it installed.

I can confirm the trouble with integrate(abs(sin(x))). It's in the library interface, I reckon.

dimpase commented 11 years ago
comment:40

Replying to @nexttime:

On Ubuntu 10.04.4 x86 (Pentium4; FSF GCC 4.7.2, with -march=native and -O3, FWIW) I get slightly more than 23,000 instances (exact number varies) of

;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;

this comes from ECL, namely, from handler_fn_prototype in src/src/c/unixint.d.

kiwifb commented 11 years ago
comment:41

Replying to @nexttime:

Replying to @kiwifb:

Do we know the expression that get passed to maxima? I would check a direct call to maxima and possibly a couple of lisp to check it is not actually a lisp fault.

Well, using the Maxima library segfaults.

I'm not at all familiar with Maxima, but


Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.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) integrate(abs(sin(x)),x,0,2*pi);
                              2 pi
                             /
                             [
(%o1)                        I     abs(sin(x)) dx
                             ]
                             /
                              0
(%i2) display2d : false$

(%i3) integrate(abs(sin(x)),x,0,2*pi);

(%o3) 'integrate(abs(sin(x)),x,0,2*pi)
(%i4)

FWIW.

Which according to the doctest is pretty much what we expect. Trying with clisp give exactly the same result. Problem at the library interface is a good candidate.

kiwifb commented 11 years ago
comment:42

Replying to @nexttime:

The other failing doctests seem to be the same you already reported:

The following tests failed:

        sage -t --long -force_lib devel/sage/sage/calculus/calculus.py # 2 doctests failed
        sage -t --long -force_lib devel/sage/sage/functions/exp_integral.py # 1 doctests failed
        sage -t --long -force_lib devel/sage/sage/interfaces/maxima_abstract.py # 2 doctests failed
        sage -t --long -force_lib devel/sage/sage/interfaces/maxima_lib.py # 2 doctests failed
        sage -t --long -force_lib devel/sage/sage/misc/functional.py # 1 doctests failed

Not sure whether you also get

sage -t --long -force_lib devel/sage/sage/functions/exp_integral.py
**********************************************************************
File "$SAGE_ROOT/devel/sage-main/sage/functions/exp_integral.py", line 1074:
    sage: integrate(sinh_integral(x), x, 0, 0.5).n() # incorrect!
Expected:
    0.125872409703453 + 1.57079632679490*I
Got:
    0.125872409703453
**********************************************************************
1 items had failures:
   1 of  18 in __main__.example_31
***Test Failed*** 1 failures.

I get all of these and that last doctest is actually a good thingTM from the file

    Note that due to some problems with the way Maxima handles these
    expressions, definite integrals can sometimes give unexpected
    results (typically when using inexact endpoints) due to
    inconsistent branching::

       sage: integrate(sinh_integral(x), x, 0, 1/2)
        -cosh(1/2) + 1/2*sinh_integral(1/2) + 1
        sage: integrate(sinh_integral(x), x, 0, 1/2).n() # correct
        0.125872409703453
        sage: integrate(sinh_integral(x), x, 0, 0.5).n() # incorrect!
        0.125872409703453 + 1.57079632679490*I

One problem may be fixed here.

kiwifb commented 11 years ago
comment:43

Replying to @nexttime:

The Maxima spkg fails to build for me because makeinfo is missing... :-)

Do you have a log for that? I'd like to pinpoint the file(s) that cause this, this time around.

dimpase commented 11 years ago
comment:44

Replying to @kiwifb: [...]

Which according to the doctest is pretty much what we expect. Trying with clisp give exactly the same result. Problem at the library interface is a good candidate.

I checked that the new ECL is (probably) not guilty, as this example with Maxima 5.26.0 works as expected.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:45

Replying to @kiwifb:

Replying to @nexttime:

The Maxima spkg fails to build for me because makeinfo is missing... :-)

Do you have a log for that? I'd like to pinpoint the file(s) that cause this, this time around.

Well, if you like to... -- Have fun, it's here.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:46

Hmmm, I was probably quicker (but I'm leaving it up to you to fix this! :-) ):


# Touching html and info files to avoid to regenerate them.
# This must be done after configuration since the timestamps need
# to be later than include-maxima.texi which is generated at
# configuration time:
for i in doc/info/*.html ; do
    touch "${i}"
done
touch doc/info/maxima.info*
...
config.status: creating doc/info/Makefile
config.status: creating doc/info/include-maxima.texi
config.status: creating doc/info/de/Makefile
...

(The TeXinfo file is created twice, since config.status gets run when building Maxima as well.)

There are also

maxima-5.29.1.p0/src/interfaces/xmaxima/doc/xmaxima.info
maxima-5.29.1.p0/src/interfaces/emacs/imaxima/imaxima.info

so we should perhaps use

touch `find doc/info -name \*.info\*`

or

find doc/info -name \*.info\* -exec touch {} \;

Using -name \*.info\* -o -name \*.html in a single statement (instead of the for-loop) would also make sense.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:47

P.S.: Now that I've read the comment in spkg-install... We probably have to "patch" config.status after configuring Maxima, to avoid "recreation" of the TeXinfo file.