Singular
https://www.singular.uni-kl.de/forum/

Singular seems to hang doing factorization over a numberfiel
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=1639
Page 1 of 1

Author:  Michel [ Sun May 20, 2007 4:33 pm ]
Post subject:  Singular seems to hang doing factorization over a numberfiel

Hi,

I am using Singular 3.0.2, the version that comes with sage (http://www.sagemath.org).

I do
ring r=(0,a),(x),dp;
minpoly=a^2+1;

factorize(x^18+1);
returns very fast, whereas
factorize(x^20+1);
seems to hang Singular.

Is this a bug?

Michel

Author:  mabshoff [ Sat Oct 13, 2007 5:44 am ]
Post subject: 

Hello folks,

there is a problem with realloc in gmp and then omalloc:
Quote:
mabshoff@sage:/tmp/Work-mabshoff/sage-2.8.6/local/bin$ ./valgrind --tool=memcheck --leak-resolution=high ./Singular-3-0-3
==25414== Memcheck, a memory error detector.
==25414== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==25414== Using LibVEX rev 1788, a library for dynamic binary translation.
==25414== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==25414== Using valgrind-3.3.0.SVN, a dynamic binary instrumentation framework.
==25414== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==25414== For more details, rerun with: -v
==25414==
SINGULAR / Development
A Computer Algebra System for Polynomial Computations / version 3-0-3
0<
by: G.-M. Greuel, G. Pfister, H. Schoenemann May 2007
FB Mathematik der Universitaet, D-67653 Kaiserslautern
> ring r=(0,a),(x),dp;
> minpoly=a^2+1;
> factorize(x^18+1);
start Factorize2(int_flag=0)
end Factorize2(0)
[1]:
_[1]=1
_[2]=x6+(-a)*x3-1
_[3]=x6+(a)*x3-1
_[4]=x2+(a)*x-1
_[5]=x2+(-a)*x-1
_[6]=x+(-a)
_[7]=x+(a)
[2]:
1,1,1,1,1,1,1
> factorize(x^20+1);
start Factorize2(int_flag=0)
==25414== Source and destination overlap in memcpy(0x4214460, 0x4215300, 3752)
==25414== at 0x4A1DA2B: memcpy (mc_replace_strmem.c:402)
==25414== by 0x66F7A0: rEALLOc (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)
==25414== by 0x669788: omReallocSizeFromSystem (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)
==25414== by 0x6698A0: omReallocLarge (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)
==25414== by 0x5CA5F6: reallocSize (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)
==25414== by 0x4F04E30: __gmpz_realloc (in /tmp/Work-mabshoff/sage-2.8.6/local/lib/libgmp.so.3.4.1)
==25414== by 0x4EF76FE: __gmpz_add (in /tmp/Work-mabshoff/sage-2.8.6/local/lib/libgmp.so.3.4.1)
==25414== by 0x654485: InternalInteger::addsame(InternalCF*) (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)
==25414== by 0x628FD7: CanonicalForm::operator+=(CanonicalForm const&) (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)
==25414== by 0x657B95: InternalPoly::mulAddTermList(term*, term*, CanonicalForm const&, int, term*&, bool) (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)
==25414== by 0x657F4E: InternalPoly::mulsame(InternalCF*) (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)
==25414== by 0x627D44: CanonicalForm::operator*=(CanonicalForm const&) (in /tmp/Work-mabshoff/sage-2.8.6/local/bin/Singular-3-0-3)


You can reach me via #sage-devel or by email which I am sure you guys have :)

Cheers,

Michael

Author:  mabshoff [ Sun Oct 14, 2007 6:57 pm ]
Post subject: 

Hello Singular folks,

we are tracking the issue at

http://www.sagetrac.org/sage_trac/ticket/872

There is also now a patch you might want to have a look at.

Cheers,

Michael

Author:  hannes [ Tue Oct 16, 2007 8:07 pm ]
Post subject:  Re: Singular seems to hang ....

Really 2 different issues are reported here:
- unsafe use of memcpy
- (algebraic) coefficient in factorization/gcd
Both are solved in Singular-3-0-3-2 (Singular version after Tue, Oct. 16)

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/