Skip Menu |

This queue is for tickets about the Math-Pari CPAN distribution.

Report information
The Basics
Id: 127442
Status: open
Priority: 0/
Queue: Math-Pari

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 2.030507
  • 2.030517
Fixed in: (no value)



Subject: SEGV on Mac
With self-compiled perls on a MacOSX system all test scripts fail with a segmentation fault. A backtrace shows the following: (lldb) bt * thread #1, stop reason = signal SIGSTOP * frame #0: 0x00000001064da4c9 Pari.bundle`XS_Math__Pari_pari_version_exp + 41 frame #1: 0x00000001062715eb perl5.29.4`Perl_pp_entersub + 1131 frame #2: 0x0000000106266653 perl5.29.4`Perl_runops_standard + 19 frame #3: 0x00000001061cc72b perl5.29.4`Perl_call_sv + 971 frame #4: 0x00000001061c8f57 perl5.29.4`Perl_call_list + 455 frame #5: 0x00000001061b6c75 perl5.29.4`S_process_special_blocks + 437 frame #6: 0x00000001061aed5a perl5.29.4`Perl_newATTRSUB_x + 4794 frame #7: 0x00000001061afe9e perl5.29.4`Perl_utilize + 1518 frame #8: 0x0000000106207329 perl5.29.4`Perl_yyparse + 8681 frame #9: 0x00000001062b3642 perl5.29.4`S_doeval_compile + 1394 frame #10: 0x00000001062b2ef8 perl5.29.4`Perl_pp_entereval + 1944 frame #11: 0x0000000106266653 perl5.29.4`Perl_runops_standard + 19 frame #12: 0x00000001061cbf19 perl5.29.4`S_run_body + 185 frame #13: 0x00000001061cbd9e perl5.29.4`perl_run + 590 frame #14: 0x00000001061a04b7 perl5.29.4`main + 151 frame #15: 0x00007fff7795d015 libdyld.dylib`start + 1 frame #16: 0x00007fff7795d015 libdyld.dylib`start + 1 (Don't know why it says SIGSTOP here, it's clearly a segmentation fault)
CC: ;
Subject: Re: [rt.cpan.org #127442] SEGV on Mac
Date: Thu, 25 Oct 2018 14:17:45 -0700
To: Slaven_Rezic via RT <bug-Math-Pari [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
On Thu, Oct 25, 2018 at 05:07:39AM -0400, Slaven_Rezic via RT wrote: Show quoted text
> With self-compiled perls on a MacOSX system all test scripts fail with a segmentation fault. > > A backtrace shows the following: > > (lldb) bt > * thread #1, stop reason = signal SIGSTOP > * frame #0: 0x00000001064da4c9 Pari.bundle`XS_Math__Pari_pari_version_exp + 41 > frame #1: 0x00000001062715eb perl5.29.4`Perl_pp_entersub + 1131
This part is very easy: cc -DPARI_VERSION_EXP=2005000 … ⇒ #define pari_version_exp() PARI_VERSION_EXP ⇒ (in XSUB) long pari_version_exp() The only thing which may break is typemap for long. Can you check the generated Pari.c (from Pari.xs) for problems? Thanks, Ilya
Subject: Re: [rt.cpan.org #127442] SEGV on Mac
Date: Thu, 25 Oct 2018 14:19:57 -0700
To: Slaven_Rezic via RT <bug-Math-Pari [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
On Thu, Oct 25, 2018 at 02:17:45PM -0700, Ilya Zakharevich wrote: Show quoted text
> On Thu, Oct 25, 2018 at 05:07:39AM -0400, Slaven_Rezic via RT wrote:
> > With self-compiled perls on a MacOSX system all test scripts fail with a segmentation fault. > > > > A backtrace shows the following: > > > > (lldb) bt > > * thread #1, stop reason = signal SIGSTOP > > * frame #0: 0x00000001064da4c9 Pari.bundle`XS_Math__Pari_pari_version_exp + 41 > > frame #1: 0x00000001062715eb perl5.29.4`Perl_pp_entersub + 1131
I presume it is this failure: http://www.cpantesters.org/cpan/report/957068b6-d7d2-11e8-b944-b13c9c1d5ab2 ? Ilya
RT-Send-CC: nospam-abuse [...] ilyaz.org
On 2018-10-25 17:17:58, nospam-abuse@ilyaz.org wrote: Show quoted text
> On Thu, Oct 25, 2018 at 05:07:39AM -0400, Slaven_Rezic via RT wrote:
> > With self-compiled perls on a MacOSX system all test scripts fail > > with a segmentation fault. > > > > A backtrace shows the following: > > > > (lldb) bt > > * thread #1, stop reason = signal SIGSTOP > > * frame #0: 0x00000001064da4c9 > > Pari.bundle`XS_Math__Pari_pari_version_exp + 41 > > frame #1: 0x00000001062715eb perl5.29.4`Perl_pp_entersub + 1131
> > This part is very easy: > > cc -DPARI_VERSION_EXP=2005000 … > ⇒ > #define pari_version_exp() PARI_VERSION_EXP > ⇒ (in XSUB) > > long > pari_version_exp() > > The only thing which may break is typemap for long. Can you check the > generated Pari.c (from Pari.xs) for problems?
The .c for pari_version looks unsuspicious for my untrained eye: XS_EUPXS(XS_Math__Pari_pari_version_exp); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_Math__Pari_pari_version_exp) { dVAR; dXSARGS; if (items != 0) croak_xs_usage(cv, ""); { long RETVAL; dXSTARG; RETVAL = pari_version_exp(); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } With -g I get a somewhat different stack trace: * thread #1, stop reason = signal SIGSTOP * frame #0: 0x0000000101abb058 Pari.bundle`S_POPMARK at inline.h:173 frame #1: 0x0000000101ab942f Pari.bundle`XS_Math__Pari_pari_version_exp(cv=0x00007fbf4d019cf0) at Pari.c:5944 And running a simple "perl -Mblib -e 'require Math::Pari'" in the debugger shows the following: * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x000000010201b058 Pari.bundle`S_POPMARK at inline.h:173 170 (PL_markstack_ptr-1), 171 (IV)*(PL_markstack_ptr-1)))); 172 assert((PL_markstack_ptr > PL_markstack) || !"MARK underflow"); -> 173 return *PL_markstack_ptr--; 174 } 175 176 /* ----------------------------- regexp.h ----------------------------- */ Target 0: (perl5.29.4) stopped. (lldb) p PL_markstack_ptr (int *) $0 = 0xfffffffffffffffc Other xs-using CPAN modules seem to work fine here.
On 2018-10-25 17:20:28, nospam-abuse@ilyaz.org wrote: Show quoted text
> On Thu, Oct 25, 2018 at 02:17:45PM -0700, Ilya Zakharevich wrote:
> > On Thu, Oct 25, 2018 at 05:07:39AM -0400, Slaven_Rezic via RT wrote:
> > > With self-compiled perls on a MacOSX system all test scripts fail > > > with a segmentation fault. > > > > > > A backtrace shows the following: > > > > > > (lldb) bt > > > * thread #1, stop reason = signal SIGSTOP > > > * frame #0: 0x00000001064da4c9 > > > Pari.bundle`XS_Math__Pari_pari_version_exp + 41 > > > frame #1: 0x00000001062715eb perl5.29.4`Perl_pp_entersub + 1131
> > I presume it is this failure: > http://www.cpantesters.org/cpan/report/957068b6-d7d2-11e8-b944- > b13c9c1d5ab2 > ?
Yes.
RT-Send-CC: nospam-abuse [...] ilyaz.org
On 2018-10-26 10:44:55, SREZIC wrote: Show quoted text
> On 2018-10-25 17:20:28, nospam-abuse@ilyaz.org wrote:
> > On Thu, Oct 25, 2018 at 02:17:45PM -0700, Ilya Zakharevich wrote:
> > > On Thu, Oct 25, 2018 at 05:07:39AM -0400, Slaven_Rezic via RT wrote:
> > > > With self-compiled perls on a MacOSX system all test scripts fail > > > > with a segmentation fault. > > > > > > > > A backtrace shows the following: > > > > > > > > (lldb) bt > > > > * thread #1, stop reason = signal SIGSTOP > > > > * frame #0: 0x00000001064da4c9 > > > > Pari.bundle`XS_Math__Pari_pari_version_exp + 41 > > > > frame #1: 0x00000001062715eb perl5.29.4`Perl_pp_entersub + 1131
> > > > I presume it is this failure: > > http://www.cpantesters.org/cpan/report/957068b6-d7d2-11e8-b944- > > b13c9c1d5ab2 > > ?
> > Yes. >
More insight: it fails with unthreaded perls, and passes with threaded ones: http://matrix.cpantesters.org/?dist=Math-Pari%202.030518;os=darwin;reports=1