Ask Your Question
3

Error in SageMath Code which crash my PC

asked 2018-12-20 09:09:40 +0200

ortollj gravatar image

updated 2023-01-09 23:59:48 +0200

tmonteil gravatar image

Hi

W10 , SageMath 8.4, Web Browser Edge or Chrome I report this problem because even if it is a code error on my part(QQ,9,9, is misplaced) it is not normal that it systematically crash my PC.

this little simple program made freeze Chrome (same problem with Edge), and then crashed my PC.

forget()
var('pi_1 pi_2 pi_3 pi_4 pi_5 pi_6 pi_7 pi_8 pi_9')
assume(pi_7 > 0)
assume(pi_8 > 0)
# good
m = matrix(QQ,9,9,[   \
# when I uncomment the line below (and comment the line above), then the browser(Edge or Chrome begin to freeze,
#    and after a while my W10 PC crash !!)
# BAD !! Line with ERROR !!!                   
#m = matrix([ QQ,9,9,  \
                [1/3 , 5/9 ,  0  ,  0  , 1/9 ,  0  ,  0  ,  0  ,  0   ], \
                [ 0  , 1/3 ,  0  ,  0  ,  0  ,  0  ,  0  ,  0  , 2/3  ], \
                [ 0  ,  0  , 1/3 , 1/3 ,  0  ,  0  , 1/3 ,  0  ,  0   ], \
                [ 0  ,  0  , 1/2 , 1/4 ,  0  ,  0  ,  0  , 1/4 ,  0   ], \
                [ 0  ,  0  ,  0  ,  0  , 3/4 , 1/4 ,  0  ,  0  ,  0   ], \
                [ 0  ,  0  ,  0  ,  0  , 2/3 , 1/3 ,  0  ,  0  ,  0   ], \
                [ 0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  1  ,  0  ,  0   ], \
                [ 0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  1  ,  0   ], \
                [ 0  ,  0  , 2/3 ,  0  ,  0  ,  0  ,  0  ,  0  , 1/3  ]  \

 ])
v=vector([pi_1,pi_2,pi_3,pi_4,pi_5,pi_6,pi_7,pi_8,pi_9])
eqT=[]
for i in range(0,len(v)):
    eqT.append(m[i]*v==v[i])
eqT.append(sum(v)==1)
#eqT.append(pi_7==1)
#eqT.append(pi_8==1)
show(eqT)
S=solve(eqT,pi_1,pi_2,pi_3,pi_4,pi_5,pi_6,pi_7,pi_8,pi_9)
show(S)
edit retag flag offensive close merge delete

Comments

I also reported on a Microsoft forum: same post On Microsoft forum

besides I realized that I had privileged Chrome (at the time I had encountered a problem with the display of curves in 3D), but I realized that Edge is faster for the execution of Sagemath code. On the other hand with Edge we no longer have the little hourglass that indicated that the code was executing.

ortollj gravatar imageortollj ( 2018-12-20 10:14:31 +0200 )edit

syntax error, the brackets are not right. You are trying to iterate over QQ...

FrédéricC gravatar imageFrédéricC ( 2018-12-21 08:17:08 +0200 )edit

Thank you Frederic . Joking aside, I crashed my PC 3 times in the evening, without seeing the fault of syntax ! . It's just the next morning ,re-reading the code, that I saw the syntax fault ;-)

ortollj gravatar imageortollj ( 2018-12-21 09:35:27 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2018-12-20 21:36:21 +0200

tmonteil gravatar image

updated 2018-12-20 21:52:32 +0200

I can reproduce the problem on Linux as well. This is a Sage bug, note a Chrome^TM or a Microsoft^TM one. Thanks for reporting ! This is now trac ticket 26928

We can reduce the bug to:

sage: matrix([ZZ])
edit flag offensive delete link more

Comments

But I think there is also a problem on the OS side (at least on Windows, I do not know if it also crash the Linux OS ?) because this code error in Sagemath ended up crashing the PC. For me this behavior is not normal.

ortollj gravatar imageortollj ( 2018-12-21 09:27:31 +0200 )edit

You'd have to describe what you mean by "crashing the PC". What does that mean? Does it get slow? Does the browser crash? Does the OS BSOD?

Iguananaut gravatar imageIguananaut ( 2019-01-07 14:24:06 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-12-20 09:09:40 +0200

Seen: 279 times

Last updated: Dec 20 '18