develooper Front page | perl.perl5.porters | Postings from May 2010

Re: 5.12: inplace sort <*> segfault (gcc 4.5.0 bug?)

Thread Previous
From:
Alex Hunsaker
Date:
May 11, 2010 08:08
Subject:
Re: 5.12: inplace sort <*> segfault (gcc 4.5.0 bug?)
Message ID:
AANLkTik7wgkAQpz6jec0SvrWmKyjr3y6MmrTr7zmzdRT@mail.gmail.com
On Tue, May 11, 2010 at 03:36, Rafael Garcia-Suarez <rgs@consttype.org> wrote:
> On 11 May 2010 01:21, Alex Hunsaker <badalex@gmail.com> wrote:
>>  $ ./perl -Ilib/ -e 'sort <*>'
>> Segmentation fault
> [...]
>> Hrm Ok seems like gcc decided oright can never be NULL and so took out
>> those checks.  If I do an optimize='-g' no -O2 it seems to work.  Any
>> ideas?
>
> You could disable the optimisation by sticking op_ccflags="-O0" in
> hints/linux.sh. Ideally this should be made conditional on the gcc
> version. If that works could you provide a patch ?

-O1 seems to work.  Also find the below attached in the event of
whitespace damage.

Against v5.12.1-RC1-1-gd549206
--
diff --git a/hints/linux.sh b/hints/linux.sh
index d208129..c61cf97 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -441,3 +441,16 @@ case "$libdb_needs_pthread" in
     libswanted="$libswanted pthread"
     ;;
 esac
+
+# gcc 4.5.0 and -Dusemultiplicity dont play nice
+# see http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2010-05/msg00316.html
+op_cflags=$op_cflags
+case "$op_cflags" in
+  '')
+    case "`${cc:-gcc} -v 2>&1`" in
+      *"version 4.5.0"*)
+        op_cflags='optimize="-O1"'
+        ;;
+    esac
+    ;;
+esac

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About