crash in factor

Bugs

Modérateur : xcasadmin

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

crash in factor

Message par jocaps » lun. oct. 02, 2017 4:16 am

I get a crash when I execute the following (in python with giacpy):

Code : Tout sélectionner

from giacpy import factor
factor("(a1*l1^2*x0^2+a1*l1^2*x3^2-a1*x1^2-a1*x2^2)/(2*l1)")
Can someone confirm this? I am able to use factor for other polynomials but for this particular one it crashes. Any ideas?

Edit: I want to also point out that the crash also occurs without the denominator "2l1"

frederic han
Messages : 1113
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: crash in factor

Message par frederic han » lun. oct. 02, 2017 8:46 pm

Hi,
I am not able to reproduce this on linux or win10. What version is it? (system and python...)

May be many other things will also crash?

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

Re: crash in factor

Message par jocaps » mar. oct. 03, 2017 9:17 am

frederic han a écrit :Hi,
I am not able to reproduce this on linux or win10. What version is it? (system and python...)

May be many other things will also crash?
How can I know the giacpy version? I cannot remember anymore. I can update with pip and retry (I'll let you know soon). The system is Windows 10, python is 2.7 for 32bit.

frederic han
Messages : 1113
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: crash in factor

Message par frederic han » mar. oct. 03, 2017 10:10 am

So the latest should be 0.6.1.

Code : Tout sélectionner

python.exe -mpip show giacpy
also inside python you can check what file is used if you have several giacpy.
Ex: here I was launching python from a directory contining giacpy so I can see that the system one was not used:

Code : Tout sélectionner

>>> help('giacpy')
Help on package giacpy:

NAME
    giacpy - giacpy: Interface to the C++ library giac (Computer Algebra System).

FILE
    z:\home\fred\dev\giacpy\build\lib.win32-2.7\giacpy\__init__.py

in case there is a conflict with another giac.dll on your system you may try:

Code : Tout sélectionner

>>> import giacpy
>>> A=giacpy.table(())
>>> A
table(
)
>>> A[1,1]=1   # in giacpy 0.6 you can change coeff of matrices (sparse or not)
>>> A
table(
(1,1) = 1
)
>>> A-A  # this bug in libgiac is only fixed in giac.dll provided with giacpy 0.6.x
table(
)

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

Re: crash in factor

Message par jocaps » jeu. oct. 05, 2017 1:05 am

Sorry for the late response, I'm having a flu.

I had an older version of giacpy. But that did not matter (I forgot to see that you made some updates). Now I have giacpy 0.6.1 and in windows 7 (32 bit) with python 2.7 32 bit, I indeed still get the crash. I have another laptop with windows 10 (64bit) and python 2.7 32 bit, I can check that later as well. I am not optimistic about it though (i.e. I suspect the same crash). I can try to figure out how this crash occurs.

Edit: It seems that windows is telling me that the crash is from giac.dll. I have attached a screenshot

Image

frederic han
Messages : 1113
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: crash in factor

Message par frederic han » jeu. oct. 05, 2017 9:52 am

I was able to have a crash on one computer. I think it is related to NTL
I have built a new giac.dll for 32bits. could you try if is solves your pb?
(put it in your giacpy dir instead of the old one)
webusers.imj-prg.fr/~frederic.han/giac.dll

for me on 32bits

Code : Tout sélectionner

from giacpy import giac
x,y,z=giac('x,y,z')
f=(x+y+z+1)**30+1
g=(f*(f+1)).normal()
from time import time
t=time()
g.factor().nops()
print(time()-t)
is loosing only 1s over 16s without ntl.

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

Re: crash in factor

Message par jocaps » jeu. oct. 05, 2017 10:55 am

frederic han a écrit :I was able to have a crash on one computer. I think it is related to NTL
I have built a new giac.dll for 32bits. could you try if is solves your pb?
(put it in your giacpy dir instead of the old one)
webusers.imj-prg.fr/~frederic.han/giac.dll
It works with the new dll you gave me to try. Please let us know if there is a stable ntl implementation anytime in the future. How come that you did not get a crash in your other computer (your first post)? Maybe there is clue for that there, does it crash in 64bit? I think I'll take this even if it is slower, stability is more important.

Thanks for the fix!

Jose

frederic han
Messages : 1113
Inscription : dim. mai 20, 2007 7:09 am
Localisation : Paris
Contact :

Re: crash in factor

Message par frederic han » jeu. oct. 05, 2017 6:43 pm

OK so I have update giacpy 0.6.2 with a giac.dll without NTL. Version 0.6.2 have also a _repr_html_ to display output in mathml in the ipython notebook.
NB: in version 0.6 I have enhanced the doc of the giac function of giacpy with a Linear algebra tutorial.

The crash is very strange and was also with amd64. I have the crash with a virtualbox Image on an older computer (core i3) but the strange thing is that I took this image a month ago and run it now on newer computer (core i7) and this image doesn't give the crash. (Also on the newer computer windows might have done some upgrade) So Either it is a built problem with some cpu optimisation or I have installed something after moving the virtual machine...

If speed matter then:

Code : Tout sélectionner

from giacpy import giac
x,y,z=giac('x,y,z')
f=(x+y+z+1)**30+1
g=(f*(f+1)).normal()
from time import time
t=time()
g.factor().nops()
print(time()-t)
is 17s in 32bits while 4.5s in win64.
These giac.dll are built with mingw (gcc6) so they are very different than bernard version of giac because he uses cygwin.

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

Re: crash in factor

Message par jocaps » ven. oct. 06, 2017 10:26 am

Thank you Frederic and good job as always.
frederic han a écrit : is 17s in 32bits while 4.5s in win64.
These giac.dll are built with mingw (gcc6) so they are very different than bernard version of giac because he uses cygwin.
I'll note those times, it might be useful to know for me in the future.

Yes I see that from the dependencies. I see now why your distributed libintl-8.dll was only 100kb large. I have mingw with gcc 5.3 and my libintl-8.dll is around 470kb.

Répondre