Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#13863 closed defect (duplicate)

Segfault in pari galoisconj0

Reported by: vbraun Owned by: was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: number theory Keywords:
Cc: jdemeyer Merged in:
Authors: Reviewers: Volker Braun
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by chapoton)

I found this using electric fence:

[vbraun@volker-desktop sage-5.6.beta0]$ ef ./sage -gdb
...
sage: K.<a> = NumberField(x^2+1)
sage: K.pari_nf().nfgaloisconj()

Program received signal SIGSEGV, Segmentation fault.
galoisanalysis (T=T@entry=0x7fffa570cf88, ga=ga@entry=0x7fffffffba50, calcul_l=calcul_l@entry=1)
    at ../src/basemath/galconj.c:1305
1305 ../src/basemath/galconj.c: No such file or directory.
Missing separate debuginfos, use: debuginfo-install atlas-3.8.4-7.fc18.x86_64 expat-2.1.0-4.fc18.x86_64 fontconfig-2.10.2-1.fc18.x86_64 glibc-2.16-28.fc18.x86_64 libgcc-4.7.2-8.fc18.x86_64 libpng-1.5.13-1.fc18.x86_64 libstdc++-4.7.2-8.fc18.x86_64
(gdb) bt
#0  galoisanalysis (T=T@entry=0x7fffa570cf88, ga=ga@entry=0x7fffffffba50, calcul_l=calcul_l@entry=1)
    at ../src/basemath/galconj.c:1305
#1  0x00007fffea0b4353 in galoisconj4_main (T=0x7fffa570cf88, T@entry=0x7fffa570cfb0, 
    den=0x7fffea2d2c40 <readonly_constants+32>, flag=0) at ../src/basemath/galconj.c:2212
#2  0x00007fffea0b4f86 in galoisconj (nf=0x7fffa570cfb0, d=<optimized out>) at ../src/basemath/galconj.c:2312
#3  0x00007fffea0b56c9 in galoisconj0 (nf=<optimized out>, flag=flag@entry=0, d=<optimized out>, 
    prec=<optimized out>) at ../src/basemath/galconj.c:2321
#4  0x00007fffe2cc6974 in __pyx_pf_4sage_4libs_4pari_3gen_3gen_608nfgaloisconj (
    __pyx_v_self=__pyx_v_self@entry=0x7fffa73cde68, __pyx_v_flag=0, __pyx_v_denom=<optimized out>, 
    __pyx_v_precision=0) at sage/libs/pari/gen.c:38446
#5  0x00007fffe2cc6dd0 in __pyx_pw_4sage_4libs_4pari_3gen_3gen_609nfgaloisconj (__pyx_v_self=0x7fffa73cde68, 
    __pyx_args=<optimized out>, __pyx_kwds=0x0) at sage/libs/pari/gen.c:38360
#6  0x00007ffff7ae7742 in call_function (oparg=<optimized out>, pp_stack=0x7fffffffbf80) at Python/ceval.c:4021
#7  PyEval_EvalFrameEx (f=f@entry=0x7fffa55aee30, throwflag=throwflag@entry=0) at Python/ceval.c:2666

The relevant piece of the pari code seems to be

static int
galoisanalysis(GEN T, struct galois_analysis *ga, long calcul_l)
{
...
  n = degpol(T);
  O = const_vecsmall(n, 0);
...
  ga->p4 = O[4];     <--- this is where the segfault occurs

Reported upstream: http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1389

Change History (8)

comment:1 Changed 7 years ago by vbraun

  • Cc jdemeyer added

comment:2 Changed 7 years ago by jdemeyer

  • Description modified (diff)
  • Report Upstream changed from N/A to Reported upstream. No feedback yet.

comment:3 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.6 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

I added a patch for this to the spkg at #13921.

comment:4 Changed 7 years ago by jdemeyer

Volker, could you review the PARI spkg at #13921, or at least check the patch galoisanalysis_p4.patch that I added?

comment:5 Changed 7 years ago by vbraun

  • Authors set to Jeroen Demeyer
  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Does fix the issue for me.

comment:6 Changed 7 years ago by jdemeyer

  • Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.

Upstream also accepted the patch.

comment:7 Changed 7 years ago by jdemeyer

  • Authors Jeroen Demeyer deleted
  • Resolution set to duplicate
  • Status changed from positive_review to closed

comment:8 Changed 4 years ago by chapoton

  • Description modified (diff)
Note: See TracTickets for help on using tickets.