2.8.14: matrix power with mv polynomial ring entries over QQ trouble on Solaris - libSingular

7 views
Skip to first unread message

mabshoff

unread,
Nov 27, 2007, 7:21:13 PM11/27/07
to sage-devel
Hello folks,

somewhere since 2.8.3 we introduced a new bug that seems to affect
computing the power of matrices when the entries are multivariate
polynomials with rational coefficients:

mabshoff@neron sage-2.8.14$ ./sage
----------------------------------------------------------------------
| SAGE Version 2.8.14, Release Date: 2007-11-24 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

sage: R.<x,y>=MPolynomialRing(QQ,2)
sage: A = matrix([[Integer(1),x], [y,Integer(1)]])
sage: A

[1 x]
[y 1]
sage: A*A

[x*y + 1 2*x]
[ 2*y x*y + 1]
sage: A**2


------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occured in SAGE.
This probably occured because a *compiled* component
of SAGE has a bug in it (typically accessing invalid memory)
or is not properly wrapped with _sig_on, _sig_off.
You might want to run SAGE under gdb with 'sage -gdb' to debug this.
SAGE will now terminate (sorry).
------------------------------------------------------------

When using ZZ as a coefficient ring the problem goes away:

mabshoff@neron sage-2.8.14$ ./sage
----------------------------------------------------------------------
| SAGE Version 2.8.14, Release Date: 2007-11-24 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

sage: R.<x,y>=MPolynomialRing(ZZ,2)
sage: A = matrix([[Integer(1),x], [y,Integer(1)]])
sage: A

[1 x]
[y 1]
sage: A*A

[x*y + 1 2*x]
[ 2*y x*y + 1]
sage: A**2

[x*y + 1 2*x]
[ 2*y x*y + 1]
sage: A**10

[x^5*y^5 + 45*x^4*y^4 + 210*x^3*y^3 + 210*x^2*y^2 + 45*x*y + 1
10*x^5*y^4 + 120*x^4*y^3 + 252*x^3*y^2 + 120*x^2*y + 10*x]
[ 10*x^4*y^5 + 120*x^3*y^4 + 252*x^2*y^3 + 120*x*y^2 + 10*y x^5*y^5
+ 45*x^4*y^4 + 210*x^3*y^3 + 210*x^2*y^2 + 45*x*y + 1]
sage:

These issues seems to rely on matrices, i.e. "just" polynomials does
work:

mabshoff@neron sage-2.8.14$ ./sage
----------------------------------------------------------------------
| SAGE Version 2.8.14, Release Date: 2007-11-24 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

sage: sage: R.<x,y>=MPolynomialRing(QQ,2)
sage: sage: f = x^3 + y
sage: f*f
x^6 + 2*x^3*y + y^2
sage: f^2
x^6 + 2*x^3*y + y^2
sage: f**2
x^6 + 2*x^3*y + y^2
sage: f**10
x^30 + 10*x^27*y + 45*x^24*y^2 + 120*x^21*y^3 + 210*x^18*y^4 +
252*x^15*y^5 + 210*x^12*y^6 + 120*x^9*y^7 + 45*x^6*y^8 + 10*x^3*y^9 +
y^10
sage:
Exiting SAGE (CPU time 0m0.03s, Wall time 0m29.97s).

And ideas? I know malb is on his way to Paris shortly, but I have
wasted a tremendous amount of time playing with 2.8.14 on Solaris
instead of doing "real" work since I wanted 2.8.15 to come close to
compilable out of the box on Solaris. We might get close to
compilable, but are certainly way off on the doctests at the moment

Cheers,

Michael

William Stein

unread,
Nov 28, 2007, 8:34:54 AM11/28/07
to sage-...@googlegroups.com
On Nov 27, 2007 4:21 PM, mabshoff

I cannot replicate this on either sage.math or osx 10.5 intel:

was@sage:~$ sage


----------------------------------------------------------------------
| SAGE Version 2.8.14, Release Date: 2007-11-24 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

sage: sage: R.<x,y>=MPolynomialRing(QQ,2)

sage: sage: A = matrix([[Integer(1),x], [y,Integer(1)]])
sage: A

[1 x]
[y 1]
sage: A*A

[x*y + 1 2*x]
[ 2*y x*y + 1]
sage: A**2

[x*y + 1 2*x]
[ 2*y x*y + 1]

keyah:~ was$ sage


----------------------------------------------------------------------
| SAGE Version 2.8.14, Release Date: 2007-11-24 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

sage: sage: R.<x,y>=MPolynomialRing(QQ,2)

sage: sage: A = matrix([[Integer(1),x], [y,Integer(1)]])
sage: A^3

[ 3*x*y + 1 x^2*y + 3*x]
[x*y^2 + 3*y 3*x*y + 1]
sage: A^2

[x*y + 1 2*x]
[ 2*y x*y + 1]

sage: A

[1 x]
[y 1]
sage: A**2

[x*y + 1 2*x]
[ 2*y x*y + 1]

-----

Your subject line suggests maybe this is a solaris-only issue? Is
that the case?
If so, what does "sage -gdb" have to say about it?

William

mabshoff

unread,
Nov 28, 2007, 8:45:13 AM11/28/07
to sage-devel
Yep.

> If so, what does "sage -gdb" have to say about it?
>

I get a pretty bt that point to __cmp__ in libSingular. Notice that it
depends on the coefficient ring, i.e. mv polynomials over ZZ are fine,
QQ not so much. I am currently building 2.8.14 on Linux PPC under
Linux because I suspect endianess issues and I have valgrind there
also to investigate.

I am doing "real" work right now, but I should be done with that in
8-10 hours ;). Once I am done I will get back to Sage and open ticket
for all the issues I have uncovered during the port. I have 2.8.14 on
neron in /tmp. You need to set LD_LIBRRAY_PATH to my 4.2.1-2 gcc to
play with it.

I also created http://wiki.sagemath.org/solaris to keep track of the
port.

> William

Cheers,

Michael

William Stein

unread,
Nov 28, 2007, 9:03:29 AM11/28/07
to sage-...@googlegroups.com
On Nov 28, 2007 5:45 AM, mabshoff

That's probably because polynomials over ZZ are still unfortunately *not*
implemented using libsingular (which is why they are amusing much
slower in Sage).

> I am currently building 2.8.14 on Linux PPC under
> Linux because I suspect endianess issues and I have valgrind there
> also to investigate.


The problem doesn't occur on OSX powerpc (fermat.math.harvard.edu), which
is maybe an endian data point.

> I am doing "real" work right now, but I should be done with that in
> 8-10 hours ;). Once I am done I will get back to Sage and open ticket
> for all the issues I have uncovered during the port. I have 2.8.14 on
> neron in /tmp. You need to set LD_LIBRRAY_PATH to my 4.2.1-2 gcc to
> play with it.
>
> I also created http://wiki.sagemath.org/solaris to keep track of the
> port.

Excellent.

>
> > William
>
>
> Cheers,
>
> Michael
> >
>

--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

mabshoff

unread,
Nov 28, 2007, 9:28:13 AM11/28/07
to sage-devel
Ok, I didn't know that. I did chat with malb in IRC shortly before he
took off to Paris and he will have a look at the libSingular bt once I
post it.

>
> > I am currently building 2.8.14 on Linux PPC under
> > Linux because I suspect endianess issues and I have valgrind there
> > also to investigate.
>
> The problem doesn't occur on OSX powerpc (fermat.math.harvard.edu), which
> is maybe an endian data point.
>

It is more than that. symmetrica fails with Schubert polynomials on
Solaris and just because the code works correctly on OSX doesn't mean
that there isn't something going wrong. I got valgrind on my PPC Linux
box, so it is always worth trying it out :)

> > I am doing "real" work right now, but I should be done with that in
> > 8-10 hours ;). Once I am done I will get back to Sage and open ticket
> > for all the issues I have uncovered during the port. I have 2.8.14 on
> > neron in /tmp. You need to set LD_LIBRRAY_PATH to my 4.2.1-2 gcc to
> > play with it.
>
> > I also createdhttp://wiki.sagemath.org/solaristo keep track of the
> > port.
>
> Excellent.
>

I added some more info there. Feel free to add your own issues ;)

>
>
> > > William
>
> > Cheers,
>
> > Michael
>
> --
> William Stein

Cheers,

Michael

mabshoff

unread,
Nov 28, 2007, 4:54:23 PM11/28/07
to sage-devel
This is now #1325.

Cheers,

Michael

mabshoff

unread,
Dec 1, 2007, 6:35:35 PM12/1/07
to sage-devel


On Nov 28, 10:54 pm, mabshoff <Michael.Absh...@fsmath.mathematik.uni-
One more data point: The coercion.pyx doctest fails with the exact
same backtrace (modulo the top of the call chain) when doing:

Trying:
f.parent()###line 207:_sage_ >>> f.parent()
Expecting:
Multivariate Polynomial Ring in t, x over Cyclotomic Field of
order 13 and degree 12
ok
Trying:
ZZ['x','y'].gen(0) + ~Frac(QQ['y']).gen(0)###line 209:_sage_
>>> ZZ['x','y'].0 + ~Frac(QQ['y']).0
Expecting:
(x*y + 1)/y


------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occured in SAGE.
This probably occured because a *compiled* component
of SAGE has a bug in it (typically accessing invalid memory)
or is not properly wrapped with _sig_on, _sig_off.
You might want to run SAGE under gdb with 'sage -gdb' to debug this.
SAGE will now terminate (sorry).
------------------------------------------------------------


[3.8 s]
exit code: 256

----------------------------------------------------------------------
The following tests failed:


sage -t -verbose devel/sage-main/sage/structure/coerce.pyx

So from my perspective now robertbw and malb need to agree whose fault
it is and send me a fix ;) This bug causes segfaults in nearly 100
doctests of the 105 still failing doctests on Solaris, so once this is
fixed we will be in excellent shape for an actually working Solaris
port.

I am adding the same info to the ticket.

Cheers,

Michael
Reply all
Reply to author
Forward
0 new messages