Skip Menu |
Report information
Id: 127894
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: tonyc <tony [at] develop-help.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: 5.24.0

Attachments
0001-perl-127894-take-usequadmath-into-account-for-alignb.patch



Subject: -DDEBUGGING -Dusequadmath -Dusethreads builds crash early
Download (untitled) / with headers
text/plain 1.6k
tony@mars:.../git/perl$ git describe v5.24.0-RC1 tony@mars:.../git/perl$ ./Configure -des -DDEBUGGING -Dusequadmath -Dusethreads -Doptimize=-ggdb3\ -O0 && make miniperl ... ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1' Segmentation fault Failed to build miniperl. Please run make minitest makefile:382: recipe for target 'lib/buildcustomize.pl' failed make: *** [lib/buildcustomize.pl] Error 1 tony@mars:.../git/perl$ gdb --args ./miniperl -e0 ... Program received signal SIGSEGV, Segmentation fault. 0x00000000006325b5 in Perl_init_constants (my_perl=0xac5010) at sv.c:15408 15408 SvNV_set(&PL_sv_no, 0); (gdb) bt #0 0x00000000006325b5 in Perl_init_constants (my_perl=0xac5010) at sv.c:15408 #1 0x000000000044718f in perl_construct (my_perl=0xac5010) at perl.c:238 #2 0x0000000000775355 in main (argc=2, argv=0x7fffffffe898, env=0x7fffffffe8b0) at miniperlmain.c:116 (gdb) disassemble $pc,$pc+16 Dump of assembler code from 0x6325b5 to 0x6325c5: => 0x00000000006325b5 <Perl_init_constants+1192>: movaps %xmm0,0x30(%rax) 0x00000000006325b9 <Perl_init_constants+1196>: mov -0x8(%rbp),%rax 0x00000000006325bd <Perl_init_constants+1200>: mov 0x16c(%rax),%eax 0x00000000006325c3 <Perl_init_constants+1206>: and $0xf,%eax End of assembler dump. (gdb) info register rax rax 0xac6de8 11300328 movaps requires 16-byte aligned pointers: tony@mars:.../git/perl$ grep alignbytes config.sh alignbytes='8' Oops. The alignbytes check in Configure doesn't appear to take usequadmath into account. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 142b
On Wed Apr 13 21:02:19 2016, tonyc wrote: Show quoted text
> The alignbytes check in Configure doesn't appear to take usequadmath > into account.
Patch. Tony
Subject: 0001-perl-127894-take-usequadmath-into-account-for-alignb.patch
From 001d4714f4564d74f3af9ce05470c698f534d0a8 Mon Sep 17 00:00:00 2001 From: Tony Cook <tony@develop-help.com> Date: Thu, 14 Apr 2016 14:30:50 +1000 Subject: [PATCH] (perl #127894) take usequadmath into account for alignbytes --- Configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Configure b/Configure index ff864b0..94fb17e 100755 --- a/Configure +++ b/Configure @@ -20168,6 +20168,10 @@ case "$alignbytes" in $cat >try.c <<'EOCP' typedef long double NV; EOCP + elif $test "X$usequadmath" = Xdefine -a "X$i_quadmath" = Xdefine; then + $cat >try.c <<'EOCP' +typedef __float128 NV; +EOCP else $cat >try.c <<'EOCP' typedef double NV; -- 2.1.4
Date: Thu, 14 Apr 2016 09:05:14 +0200
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
To: perl5-porters [...] perl.org
CC: perlbug-followup [...] perl.org
Subject: Re: [perl #127894] -DDEBUGGING -Dusequadmath -Dusethreads builds crash early
Download (untitled) / with headers
text/plain 586b
On Wed, 13 Apr 2016 21:33:10 -0700, "Tony Cook via RT" <perlbug-followup@perl.org> wrote: Show quoted text
> On Wed Apr 13 21:02:19 2016, tonyc wrote:
> > The alignbytes check in Configure doesn't appear to take usequadmath > > into account.
> > Patch.
So close before 5.24? Is Rugby (#QAH) soon enough? Show quoted text
> Tony
-- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.23 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Download (untitled)
application/pgp-signature 490b

Message body not shown because it is not plain text.

Subject: Re: [perl #127894] -DDEBUGGING -Dusequadmath -Dusethreads builds crash early
To: perl5-porters [...] perl.org
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
Date: Thu, 14 Apr 2016 20:32:20 +0100
Download (untitled) / with headers
text/plain 1.5k
"Tony Cook via RT" <perlbug-followup@perl.org> writes: Show quoted text
> On Wed Apr 13 21:02:19 2016, tonyc wrote:
>> The alignbytes check in Configure doesn't appear to take usequadmath >> into account.
[...] Show quoted text
> diff --git a/Configure b/Configure > index ff864b0..94fb17e 100755 > --- a/Configure > +++ b/Configure > @@ -20168,6 +20168,10 @@ case "$alignbytes" in > $cat >try.c <<'EOCP' > typedef long double NV; > EOCP > + elif $test "X$usequadmath" = Xdefine -a "X$i_quadmath" = Xdefine; then > + $cat >try.c <<'EOCP' > +typedef __float128 NV; > +EOCP > else > $cat >try.c <<'EOCP' > typedef double NV;
Instead of having to modify this every time a new NV type comes along, why not make the check use $nvtype instead? diff --git a/Configure b/Configure index ff864b0..2f4ffcc 100755 --- a/Configure +++ b/Configure @@ -20164,20 +20164,11 @@ eval $inlibc echo " " case "$alignbytes" in '') echo "Checking alignment constraints..." >&4 - if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then - $cat >try.c <<'EOCP' -typedef long double NV; -EOCP - else - $cat >try.c <<'EOCP' -typedef double NV; -EOCP - fi - $cat >>try.c <<'EOCP' + $cat >try.c <<EOCP #include <stdio.h> struct foobar { char foo; - NV bar; + $nvtype bar; } try_algn; int main() { -- "I use RMS as a guide in the same way that a boat captain would use a lighthouse. It's good to know where it is, but you generally don't want to find yourself in the same spot." - Tollef Fog Heen
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 900b
On Thu Apr 14 12:33:04 2016, ilmari wrote: Show quoted text
> Instead of having to modify this every time a new NV type comes along, > why not make the check use $nvtype instead? > > diff --git a/Configure b/Configure > index ff864b0..2f4ffcc 100755 > --- a/Configure > +++ b/Configure > @@ -20164,20 +20164,11 @@ eval $inlibc > echo " " > case "$alignbytes" in > '') echo "Checking alignment constraints..." >&4 > - if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then > - $cat >try.c <<'EOCP' > -typedef long double NV; > -EOCP > - else > - $cat >try.c <<'EOCP' > -typedef double NV; > -EOCP > - fi > - $cat >>try.c <<'EOCP' > + $cat >try.c <<EOCP > #include <stdio.h> > struct foobar { > char foo; > - NV bar; > + $nvtype bar; > } try_algn; > int main() > {
Good point, applied as ab462c7d2da3570ffe26e717642be96cccef8b23. Tony
Download (untitled) / with headers
text/plain 252b
Thank you for submitting this report. You have helped make Perl better. With the release of Perl 5.24.0 on May 9, 2016, this and 149 other issues have been resolved. Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 110b
This bug exists in 5.22.2, so this fix should probably be backported to 5.22.3 if we're still supporting that?


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org