Opened 8 years ago

Closed 8 years ago

#13921 closed defect (fixed)

Make the GP executable work with SAGE_DEBUG on Darwin

Reported by: SimonKing Owned by: was
Priority: critical Milestone: sage-5.6
Component: number theory Keywords: pari gp debug
Cc: jdemeyer Merged in: sage-5.6.rc0
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: Reported upstream. No feedback yet. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

On bsd.math (hence, Darwin), there is a problem with the GP executable when building Sage (or: only the pari/gp spkg) with SAGE_DEBUG=yes.

As Jeroen found, a crash occurs as follows:

$ ./sage --gp
? factor(10356613*10694706299664611221)

With gdb, one then gets

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00007fff8a66cfc1 in dyld_stub_binder ()
(gdb) bt
#0  0x00007fff8a66cfc1 in dyld_stub_binder ()
#1  0x000000010040e398 in  stub helpers ()

The problem vanishes with Apple's gcc. The problem also vanishes with static linking.

Reported to PARI/GP: http://pari.math.u-bordeaux.fr/archives/pari-dev-1301/msg00000.html

spkg: http://boxen.math.washington.edu/home/jdemeyer/spkg/pari-2.5.3.p2.spkg

Attachments (1)

pari-2.5.3.p2.diff (7.3 KB) - added by jdemeyer 8 years ago.
Diff for the PARI spkg, for review only

Download all attachments as: .zip

Change History (11)

comment:1 Changed 8 years ago by SimonKing

It seems to be an upstream bug, either in pari/gp or in gcc. But who is upstream? How to contact them?

comment:2 Changed 8 years ago by jdemeyer

  • Description modified (diff)

comment:3 Changed 8 years ago by jdemeyer

I am building GCC-4.7.2 to see whether that solves the problem.

comment:4 Changed 8 years ago by SimonKing

  • Report Upstream changed from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet.

Thank you, Jeroen!

comment:5 Changed 8 years ago by jdemeyer

Same problem with GCC-4.7.2.

comment:6 Changed 8 years ago by jdemeyer

The offending file in mp.c. Another workaround is to compile that file always with -O1.

comment:7 Changed 8 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Description modified (diff)

Changed 8 years ago by jdemeyer

Diff for the PARI spkg, for review only

comment:8 Changed 8 years ago by jdemeyer

  • Status changed from new to needs_review

comment:9 Changed 8 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Looks good to me.

comment:10 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.6.rc0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.