Open
Description
Steps To Reproduce
This unit test causes a segfault in flint, possibly a singular issue:
$ ./sage -gdb
sage: A.<x,y> = AffineSpace(QQ, 2) ## line 304 ##
sage: C = A.curve([x^5 - x^3*y^2 + 5*x^4 - x^3*y - 3*x^2*y^2 +
....: x*y^3 + 10*x^3 - 3*x^2*y - 3*x*y^2 + y^3 + 10*x^2 - 3*x*y - y^2 +
....: 5*x - y + 1]) ## line 305 ##
[Thread 0x7fff997496c0 (LWP 1881254) exited]
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffa3315f4a in fmpz_poly_divides (q=q@entry=0x7fffffffacb0, a=0x555557c5bef8, b=0xffffffffffffffe8) at src/fmpz_poly/divides.c:69
69 if (fmpz_poly_is_zero(b))
(gdb) bt
#0 0x00007fffa3315f4a in fmpz_poly_divides (q=q@entry=0x7fffffffacb0, a=0x555557c5bef8, b=0xffffffffffffffe8) at src/fmpz_poly/divides.c:69
#1 0x00007fffa35a4c54 in fmpz_bpoly_divides (Q=Q@entry=0x7fffffffae10, A=A@entry=0x7fffffffb290, B=B@entry=0x7fffffffae50)
at src/fmpz_mpoly_factor/bpoly_factor.c:169
#2 0x00007fffa35a610e in _recombine_naive (F=0x7fffffffb2c0, B=0x7fffffffb290, alpha=0x7fffffffadb0, I=0x7fffffffaf00)
at src/fmpz_mpoly_factor/bpoly_factor.c:744
#3 fmpz_bpoly_factor (c=c@entry=0x7fffffffb100, F=F@entry=0x7fffffffb2c0, B=B@entry=0x7fffffffb290) at src/fmpz_mpoly_factor/bpoly_factor.c:918
#4 0x00007fffa35a7f92 in _factor_irred_compressed (Af=Af@entry=0x7fffffffb3b0, A=0x555558111c30, ctx=ctx@entry=0x7fffffffb970, algo=algo@entry=7)
at src/fmpz_mpoly_factor/factor.c:186
#5 0x00007fffa35a95ec in _compressed_content_to_irred (g=g@entry=0x7fffffffb4c0, f=f@entry=0x555557b4a8f8, e=<optimized out>,
ctx=ctx@entry=0x7fffffffb970, algo=algo@entry=7) at src/fmpz_mpoly_factor/factor.c:650
#6 0x00007fffa35a9818 in _factor (f=0x7fffffffb940, ctx=0x7fffffffb970, algo=7, A=<optimized out>) at src/fmpz_mpoly_factor/factor.c:727
#7 0x00007fffa1a4db45 in factorize (f=..., issqrfree=issqrfree@entry=false) at cf_factor.cc:710
#8 0x00007fffa1d2d378 in singclap_factorize (f=<optimized out>, v=v@entry=0x7fffffffbe98, with_exps=with_exps@entry=0, r=r@entry=0x7fffa1825030)
at clapsing.cc:1077
#9 0x00007fffa2217e3f in __pyx_pf_4sage_5rings_10polynomial_28multi_polynomial_libsingular_23MPolynomial_libsingular_104factor (
[...]
(gdb) l
64 return (len1 == 0);
65 }
66
67 int fmpz_poly_divides(fmpz_poly_t q, const fmpz_poly_t a, const fmpz_poly_t b)
68 {
69 if (fmpz_poly_is_zero(b))
70 {
71 flint_throw(FLINT_ERROR, "Exception (fmpz_poly_divides). Division by zero.\n");
72 }
73 if (fmpz_poly_is_zero(a))
(gdb)
74 {
75 fmpz_poly_zero(q);
76 return 1;
77 }
78 if (a->length < b->length)
79 {
80 return 0;
81 }
82
83 {
Expected Behavior
No segfault
Actual Behavior
Segfault
$ sage -t --long --warn-long 30.0 --random-seed=0 src/sage/schemes/curves/point.py # SignalError in doctesting framework
[...]
File "/home/vbraun/Code/sage.git/src/sage/schemes/curves/constructor.py", line 87, in _is_irreducible_and_reduced
factors = F.factor()
File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 4586, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.factor
sig_on()
cysignals.signals.SignalError: Segmentation fault
----------------------------------------------------------------------
sage -t --long --warn-long 30.0 --random-seed=0 src/sage/schemes/curves/point.py # SignalError in doctesting framework
----------------------------------------------------------------------
Additional Information
No response
Environment
- OS: Fedora 42 x86_64
- Sage Version: 10.7.beta5
Checklist
- I have searched the existing issues for a bug report that matches the one I want to file, without success.
- I have read the documentation and troubleshoot guide