Opened 10 years ago

Closed 10 years ago

#13921 closed defect (fixed)

Make the GP executable work with SAGE_DEBUG on Darwin

Reported by: Simon King Owned by: William Stein
Priority: critical Milestone: sage-5.6
Component: number theory Keywords: pari gp debug
Cc: Jeroen Demeyer 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:

Status badges

Description (last modified by Jeroen Demeyer)

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 Jeroen Demeyer 10 years ago.
Diff for the PARI spkg, for review only

Download all attachments as: .zip

Change History (11)

comment:1 Changed 10 years ago by Simon King

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 10 years ago by Jeroen Demeyer

Description: modified (diff)

comment:3 Changed 10 years ago by Jeroen Demeyer

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

comment:4 Changed 10 years ago by Simon King

Report Upstream: Not yet reported upstream; Will do shortly.Reported upstream. No feedback yet.

Thank you, Jeroen!

comment:5 Changed 10 years ago by Jeroen Demeyer

Same problem with GCC-4.7.2.

comment:6 Changed 10 years ago by Jeroen Demeyer

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

comment:7 Changed 10 years ago by Jeroen Demeyer

Authors: Jeroen Demeyer
Description: modified (diff)

Changed 10 years ago by Jeroen Demeyer

Attachment: pari-2.5.3.p2.diff added

Diff for the PARI spkg, for review only

comment:8 Changed 10 years ago by Jeroen Demeyer

Status: newneeds_review

comment:9 Changed 10 years ago by Volker Braun

Reviewers: Volker Braun
Status: needs_reviewpositive_review

Looks good to me.

comment:10 Changed 10 years ago by Jeroen Demeyer

Merged in: sage-5.6.rc0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.